how to make it so that leaders don't start on keeps

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
Aramil312
Posts: 15
Joined: April 28th, 2006, 5:01 am
Location: NZ

how to make it so that leaders don't start on keeps

Post by Aramil312 »

Can anyone tell me how to make it so that leaders don't start on keeps? Using the map editor I cant figure it out.


please give your posts meaningful titles.

Old title was: How do you? ...
Aramil
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Leaders will always start on keeps. What you can do to make it look like they don't, is to change the terrain at their starting locations from keep to something else using the [terrain] tag in a prestart event, for example. So, if you're only drawing maps without writing a scenario, you're forced to always start on a keep.
Aramil312
Posts: 15
Joined: April 28th, 2006, 5:01 am
Location: NZ

Post by Aramil312 »

Thanks zookeeper, but although I have read the wiki for that tag, I am having trouble understanding it. Can you or someone else give me what I need to type in?
Aramil
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

If the starting location of player one is 10,2 and the starting location of player 2 is 17,19 and you'd want them both to start on grassland instead of a keep, you could do this:

Code: Select all

[event]
    name=prestart

    [terrain]
        x,y=10,2
        letter=g
    [/terrain]

    [terrain]
        x,y=17,19
        letter=g
    [/terrain]
[/event]
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

If it appears more often that you don´t want a keep, you could make a general macro.

Code: Select all

#define RESETKEEP SIDE TERRAIN
[store_starting_location]
side={SIDE}
variable=keep
[/store_starting_location]
{VARIABLE_OP x format $keep.x}
{VARIABLE_OP y format $keep.y}
[terrain]
x=$x
y=$y
letter={TERRAIN}
[/terrain]
{CLEAR_VARIABLE keep}
{CLEAR_VARIABLE x}
{CLEAR_VARIABLE y}
#enddef
I used that too.
First read, then think. Read again, think again. And then post!
Aramil312
Posts: 15
Joined: April 28th, 2006, 5:01 am
Location: NZ

Post by Aramil312 »

thanks very much
Aramil
User avatar
Viliam
Translator
Posts: 1341
Joined: January 30th, 2004, 11:07 am
Location: Bratislava, Slovakia
Contact:

Post by Viliam »

The other way to do this -- if you want some keep, but you just want your leader to start somewhere else -- is move the leader in a "prestart" event. Like this:

Code: Select all

#define MOVEUNIT DESCRIPTION X Y
	[store_unit]
		[filter]
			description={Description}
		[/filter]
		variable=move
		kill=yes
	[/store_unit]
	[set_variable]
		name=move.x
		value={X}
	[/set_variable]
	[set_variable]
		name=move.y
		value={Y}
	[/set_variable]
	[unstore_unit]
		variable=move
	[/unstore_unit]
	[clear_variable]
		name=move
	[/clear_variable]
#enddef

[event]
	name=prestart
	{MOVEUNIT MyLeader 51 60}
[/event]
Post Reply