Help: change unit movements

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
hochbass
Posts: 50
Joined: October 4th, 2005, 8:48 pm
Location: Germany

Help: change unit movements

Post by hochbass »

I'm very new with the game and the code

I want to "slow" some units only for one single scenario

learning by doing I've included :

[unit]
type=Saurian Skirmisher
x,y=20,12
movement=5 ;original 6
#ifdef EASY
hitpoints=15
#endif
[/unit]

into the Scenario.cfg

But this does not work. How can I do this?

(Doing a little private investigation on the gryphon_tale campain, hope to make it winnable without frustration )
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

You can make the unit slower when you create it by giving it a custom trait. Here is a macro.

Code: Select all

	#define SLOWUNIT X Y SIDE UTYPE NAME
	[unit]
	type={UTYPE}
	description={NAME}
	x={X}
	y={Y}
	side={SIDE}
	[modifications]
		[trait]
		id=slow
		name= _ "slow"
			[effect]
			apply_to=movement
			increase=-1
			[/effect]
		[/trait]
	[/modifications]
	[/unit]
	#enddef
This is how you call it

Code: Select all

[event]
name=prestart

{SLOWUNIT 10 11 1 (Saurian Skirmisher) ( )}

[/event]
Hope springs eternal.
Wesnoth acronym guide.
Post Reply