Set unit moves to maxmoves?

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
Gwledig
Posts: 539
Joined: March 30th, 2009, 5:10 pm
Location: UK

Set unit moves to maxmoves?

Post by Gwledig »

Hi I have an effect which sets units current available moves but seem to have to specify this literally eg moves=5 is there some wml which would set to max availavble moves?
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
User avatar
Ravana
Forum Moderator
Posts: 2482
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Set unit moves to maxmoves?

Post by Ravana »

{VARIABLE unit.moves $unit.max_moves}
User avatar
Gwledig
Posts: 539
Joined: March 30th, 2009, 5:10 pm
Location: UK

Re: Set unit moves to maxmoves?

Post by Gwledig »

thx gave me some idea to use this

Code: Select all

moves=$unit.max_moves

Code: Select all

#define RESTORE_MV_PROJECTILE_ADJ
#if player moved new projectile to a location adjacent to unit which spawned it on an option menu, restore all mv points
[event]
name=moveto
first_time_only=no
	[modify_unit]
		[filter]
		role=projectile
		side=$side_number
		x=$unit.x  
		y=$unit.y 
			[filter_adjacent]
			adjacent=n,ne,se,s,sw,nw
			is_enemy=false
			side=$side_number
			
			id=$unit.modifications.trait[0].id
			
			#role=Commander #replace with some filter for unit which spawned the projectile
			[/filter_adjacent]
	[/filter]
	 moves=$unit.max_moves
	[/modify_unit]
[/event]
#enddef
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
Post Reply