How to damage/ kill people in a position with wml(trap)
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.
How to damage/ kill people in a position with wml(trap)
how to do it?
taken from Flight to Freedom, scenario 'Underground' (heavily edited to remove unnecisary stuff, like messages, terrain changes and sound/graphical effects):
to kill somebody
most of the stuff that people need help with is already in game, it's just a case of finding it.
I think that there was another one that damaged somewhere, but I cannot remember where, although this page should help too.
Code: Select all
[event]
name=moveto
[filter]
x=28
y=38
side=1
[/filter]
[kill]
x=28
y=38
animate=yes
[/kill]
[/event]
most of the stuff that people need help with is already in game, it's just a case of finding it.
I think that there was another one that damaged somewhere, but I cannot remember where, although this page should help too.
What do you mean?
If you mean x and y values by a position, there simply exist the filter keys x and y.
If you mean a standing position, facing=reverse or facing=normal could help you.
(You need a filter tag in [kill])
If you mean x and y values by a position, there simply exist the filter keys x and y.
If you mean a standing position, facing=reverse or facing=normal could help you.
(You need a filter tag in [kill])
First read, then think. Read again, think again. And then post!
I don't know hwo you can let some damage numbers float. The chance of the damage can be done with:
Code: Select all
[store_unit]
variable=damage
(unit filter for damaged unit)
kill=no
[/store_unit]
[store_locations]
x=$damge.x
y=$damage.y
variable=checkterrain
[/store_locations]
#define TERRAIN_DEF TYPE NUMBER
[if]
[variable]
name=checkterrain.terrain
equals={TYPE}
[/variable]
[then]
{RANDOM 0..100}
[if]
[variable]
name=random
greater_than_equal_to={NUMBER}
[/variable]
[then]
[object]
(unit filter)
[effect]
apply_to=hitpoints
increase=-10 #for 10 dmg
[/effect]
[/object]
[/then]
[/if]
[/then]
[/if]
#I give just 1 example
{TERRAIN_DEF g 40}
ascendant - objects are re-applied at level up. For trap damage, you should store the unit then modify its hp (or kill it).
custom floating damage numbers are possible in the latest trunk/SVN through:
custom floating damage numbers are possible in the latest trunk/SVN through:
Code: Select all
[unstore_unit]
variable=stored_unit_variable
text=$damage_amount
{COLOR_HARM}
[/unstore_unit]
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."