Movement problem

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.
Post Reply
User avatar
Mirion147
Posts: 957
Joined: February 14th, 2008, 12:52 am

Movement problem

Post by Mirion147 »

Hello, I was just wondering how to make a leader's movement temporarily equal 0? No matter what I do the leader always seems to move. (It's the ai's leader).
Take a look at the Era of the Future!
Current factions: The Welkin, The Brungar, and The Nordhris!
^This is old news lol but I don't care^
New news -> Up the River Bork Campaign!
User avatar
Ravana
Forum Moderator
Posts: 3004
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Movement problem

Post by Ravana »

Code: Select all

	[event]
		name=side 1 turn 1
                [store_unit]
                    [filter]
                        side=1,2,3#edit if you need
						canrecruit=yes
                    [/filter]
                    variable=aileaders
                [/store_unit]
                {FOREACH aileaders i}
                    [object]
                        silent=yes
                        [filter]
                            id=$aileaders[$i].id
                        [/filter]
						[effect]
							apply_to=movement
							set=0
						[/effect]
                    [/object]
                {NEXT i}
                {CLEAR_VARIABLE aileaders}
	[/event]
Later just set movement something else.
User avatar
Mirion147
Posts: 957
Joined: February 14th, 2008, 12:52 am

Re: Movement problem

Post by Mirion147 »

Thank you :), that works perfectly. Would anyone now be able to tell me how to keep a leader from recruiting?
Take a look at the Era of the Future!
Current factions: The Welkin, The Brungar, and The Nordhris!
^This is old news lol but I don't care^
New news -> Up the River Bork Campaign!
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: Movement problem

Post by monochromatic »

The simplest way would be to give the AI leaders an empty recruit list at the start, and then using [modify_side] to update to a new recruit list.
User avatar
SkyOne
Posts: 1310
Joined: January 3rd, 2009, 7:23 pm

Re: Movement problem

Post by SkyOne »

I am not sure that I understand your question correctly or not, but it sounds me like you just need “passive_leader=yes” in his [ai] tag before doing anything (although it doesn’t mean that his movement is equal to zero)...
Fate of a Princess/feedback thread: "What is in own heart that is the most important, not who you are."
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
Post Reply