Bitrons WML Questions

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
User avatar
Ravana
Forum Moderator
Posts: 3000
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: [Ability] - Inspiration

Post by Ravana »

With first_time_only=no you might also want to add some limitation how it is allowed to trigger.
User avatar
Bitron
Developer
Posts: 453
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: [Ability] - Inspiration

Post by Bitron »

It is the leaders goal in the scenario. I just wanted that one needs more than one character in the specific area to win the game. One also have to free another character, before one can left the game winning, thats why the event needs to be able to trigger more than once, in case the character isn't free by then.

however, thants a lot to both of you (:
User avatar
Bitron
Developer
Posts: 453
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: Bitrons WML Questions

Post by Bitron »

Hey there!

Is there a possibility to get new sides into the game, but later? like in turn 7-8?
User avatar
Samonella
Posts: 382
Joined: January 8th, 2016, 5:41 pm
Location: USA

Re: Bitrons WML Questions

Post by Samonella »

Bitron wrote:Is there a possibility to get new sides into the game, but later? like in turn 7-8?
I don't think so, but you could always have a side with no units and hidden=yes. Then you could use [modify_side] to change "hidden," making the side seem to appear.
The last few months have been nothing but one big, painful reminder that TIMTLTW.

Creator of Armory Mod, The Rising Underworld, and Voyage of a Drake: an RPG
User avatar
Bitron
Developer
Posts: 453
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: Bitrons WML Questions

Post by Bitron »

I don't think so, but you could always have a side with no units and hidden=yes. Then you could use [modify_side] to change "hidden," making the side seem to appear.
I just set the victory_when_enemies_defeated to no and stored them and unstore in turn 5 again. It's a "moveto" scenario so that worked fine. (:

Thanks anyways, Samonella!

But acutally i have another question.. how exactly works the ca_score?

EDIT:
And one more about vision.

Code: Select all

[event]
    name=moveto
    first_time_only=yes
    [filter]
        side=2
        [filter_vision]
            side=1 
        [/filter_vision]
    [/filter]
    [message]
        speaker=unit
        message="I am your enemy. I know that you can see me here."
    [/message]
[/event]
This just work fine, but when i try to switch the sides, so that it triggers when side 1 moves into the vision of side 2, it does not work at all
Code is like this:

Code: Select all

[event]
	 		name=moveto
	 		first_time_only=yes
	 		[filter]
	 			side=1
	 			[filter_vision]
	 				side=2
	 			[/filter_vision]
	 		[/filter]
	 		[message]
	 			speaker=second_unit
	 			message= _ "There they are!"
	 		[/message]
	 		[endlevel]
	 			result=defeat
	 		[/endlevel]
	 	[/event]
why?
It triggers everytime I move a side 1 unit, wether its in vision of side 2 or not.
User avatar
Samonella
Posts: 382
Joined: January 8th, 2016, 5:41 pm
Location: USA

Re: Bitrons WML Questions

Post by Samonella »

Bitron wrote:But acutally i have another question.. how exactly works the ca_score?
You mean the ca_score from micro_ais? I don't know the details, but basically it determines how important the action described by the micro_ai is. The AI is made up of a bunch of "candid actions" or "ca"s, which are things like moving the leader towards a keep, moving units towards uncaptured villages, or attacking enemy units. Each action has a ca_score, and the ai will execute actions with a higher ca_score first. This way, the ai will always do certain things before others, such as recruiting before moving the leader away to attack. Now when you make a micro_ai, you are adding a candid action to the ai's list, so the ca_score determines when that action is executed relative to the other candid actions. For example:
The micro_ai wiki wrote:By setting it, for example, to 170,000, we can have it be executed after the default recruitment CA, but before most of the other default CAs.
(Of course, I'm far from an ai expert. If somebody else says something else, trust them not me.)

Bitron wrote:And one more about vision.
This just work fine, but when i try to switch the sides, so that it triggers when side 1 moves into the vision of side 2, it does not work at all
why?
It triggers everytime I move a side 1 unit, wether its in vision of side 2 or not.
My guess is that side 2 doesn't have fog or shroud turned on?
The last few months have been nothing but one big, painful reminder that TIMTLTW.

Creator of Armory Mod, The Rising Underworld, and Voyage of a Drake: an RPG
mattsc
Inactive Developer
Posts: 1217
Joined: October 13th, 2010, 6:14 pm

Re: Bitrons WML Questions

Post by mattsc »

Samonella wrote:(Of course, I'm far from an ai expert. If somebody else says something else, trust them not me.)
You got it right.
Except for one little detail: I like "candid actions", but unfortunately they are simply named "candidate actions" ;)

The only thing I would add is the link to the wiki page explaining what the default AI CAs and their scores are: RCA AI candidate actions
User avatar
Bitron
Developer
Posts: 453
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: Bitrons WML Questions

Post by Bitron »

Hey there. It is me again, with a question. I was looking for ways to tweak the AI in favour of balancing different difficulties and I've found this piece of code

Code: Select all

        [ai]
            [aspect]
                id=recruitment_instructions
                [facet]
                    [value]
                        [recruit]
                            type=2
#ifdef EASY
                            number=0
#endif
#ifdef NORMAL
                            number=1
#endif
#ifdef HARD
                            number=2
#endif
                            total=yes
                            importance=1
                        [/recruit]
                        [recruit]
                            type=1
                            importance=0
                        [/recruit]
                    [/value]
                [/facet]
            [/aspect]
        [/ai]
I recken this does mean that the ai recruits just a specific number of higher leveled units, but I don't really see how exactly it is done here. I haven't found it in the WML docs yet so I am asking right here now.

EDIT: Nevermind, if found it here.
User avatar
Bitron
Developer
Posts: 453
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: Bitrons WML Questions

Post by Bitron »

Hello guys! I'm here with a new problem. I have piece of wml code here which causes game crashes, and I don't know why. Here is the code:

Code: Select all

#define MOVEMENT_STONE_SLEEP
	[event]
		name=prerecruit
		first_time_only=no
		
		[filter]
			type_adv_tree=Vampire Deformity
		[/filter]
		
		[store_time_of_day]
		[/store_time_of_day]
		
		[if]
			[variable]
				name=time_of_day.lawful_bonus
				less_than_equal_to=0
			[/variable]
			[then]
				[unpetrify]
					type_adv_tree=Vampire Deformity
					side=$side_number
				[/unpetrify]
			[/then]
			[else]
				[petrify]
					type_adv_tree=Vampire Deformity
					side=$side_number
					[not]
						[filter_location]
							area=underground
						[/filter_location]
					[/not]
				[/petrify]
			[/else]
		[/if]
	[/event]
	
	[event]
		name=turn refresh
		first_time_only=no
		
		[store_time_of_day]
		[/store_time_of_day]
		
		[if]
			[variable]
				name=time_of_day.lawful_bonus
				less_than_equal_to=0
			[/variable]
			[then]
				[unpetrify]
					type_adv_tree=Vampire Deformity
					side=$side_number
				[/unpetrify]
			[/then]
			[else]
				[heal_unit]
					[filter]
						type_adv_tree=Vampire Deformity
						side=$side_number
						[not]
							[filter_location]
								area=underground
							[/filter_location]
						[/not]
					[/filter]
					amount=10
					animate=yes
					restore_statuses=yes
				[/heal_unit]
				[petrify]
					type_adv_tree=Vampire Deformity
					side=$side_number
					[not]
						[filter_location]
							area=underground
						[/filter_location]
					[/not]
				[/petrify]
			[/else]
		[/if]
	[/event]
#enddef
It has something to do with the filter_location, because when I delete the three area=underground filters, then it works fine. Otherwise, in Mutliplayer game, when playing with the Vampires (the code is for an ability of a vampire unit) the game just crashes right before the vampire's second turn. Maybe one of you knows why?
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Bitrons WML Questions

Post by gfgtdf »

how exactly does it crash? most of the times it gives you a message about the error, did you check your stderr.txt file ?
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
Bitron
Developer
Posts: 453
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: Bitrons WML Questions

Post by Bitron »

Just that.
error.png
error.png (13.87 KiB) Viewed 3121 times
(Wesnoth Game Client does not work anymore)
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Bitrons WML Questions

Post by gfgtdf »

hmm ok, so in your map, you you have a time area with the id "underground " defined?

please test the follwing things:
1) add a [time_area] to your scenairo wih id ="time_area"
2) add a [time_area] to your scenairo wih id ="underground "
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
Bitron
Developer
Posts: 453
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: Bitrons WML Questions

Post by Bitron »

Oh. I guess that means when I filter for a time_area, then I need to provide it in the szenario?
I played on normal Mutliplayer Maps, that's why there is no such area.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Bitrons WML Questions

Post by gfgtdf »

Bitron wrote: April 21st, 2018, 6:33 pm Oh. I guess that means when I filter for a time_area, then I need to provide it in the szenario?
I played on normal Mutliplayer Maps, that's why there is no such area.
Well clearly it shouldn't crash in that case, we likely be able to fix this before 1.14
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Bitrons WML Questions

Post by gfgtdf »

Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Post Reply