Problems with hitpoint effect commands

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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
quartex
Inactive Developer
Posts: 2258
Joined: December 22nd, 2003, 4:17 am
Location: Boston, MA

Problems with hitpoint effect commands

Post by quartex »

You think I would have learned my lesson with all the trouble I had slowing and unslowing units using objects and effects. But now I'm having trouble using objects and effects to change a unit's hitpoints. I'm basing my work off the WML section for hitpoint effects:

"hitpoints" modifies the unit HP and/or max HP
increase the amount to increase the unit's HP
heal_full if present and not set to "no" the unit will be put back to full

I think that there may be bugs with the increase and heal_full commands. I tried:

Code: Select all

[effect]
	apply_to=hitpoints
	heal_full=yes
[/effect]
and nothing happened.

Can anyone confirm that commands such as heal_full actually work as they are supposed to when changing hitpoints?

I normally use [store_unit] to edit hitpoints, but the heal_full command seem so useful when trying to heal a unit to full hitpoints.
silene
Posts: 1109
Joined: August 28th, 2004, 10:02 pm

Post by silene »

I tried the following, and it works just fine.

Code: Select all

	[event]
		first_time_only="no"
		name="moveto"
		[filter]
			x="12"
			y="4"
		[/filter]
		[object]
			cannot_use_message=_ "You are not worthy of healing."
			description=_ "A feeling of well-being overwhelms the drinker."
			duration="level"
			id="OBJ3"
			image="misc/item-healingpotion.png"
			name=_ "Potion of Healing"
			[filter]
				x="12"
				y="4"
			[/filter]
			[then]
				[removeitem]
					x="12"
					y="4"
				[/removeitem]
			[/then]
			[effect]
				apply_to="hitpoints"
				heal_full="yes"
			[/effect]
		[/object]
	[/event]
(I simply edited a savefile of the test scenario)
quartex
Inactive Developer
Posts: 2258
Joined: December 22nd, 2003, 4:17 am
Location: Boston, MA

Post by quartex »

Thanks silene. It's probably just a problem with my scenario somehow. Just wanted to check, since I figured it wasn't used very often in campaigns.
Post Reply