new event-util macro: {CALL_FUNCTION}

This commit is contained in:
Patrick Parker 2009-01-28 03:47:47 +00:00
parent 999d4d1444
commit 3c5eaa03b9

View file

@ -167,3 +167,33 @@
{ACTION_WML}
[/event]
#enddef
#define CALL_FUNCTION FNAME PARAMS
# This will fire an event with a set of parameters, for example:
#! {CALL_FUNCTION my_event a,b,c=1,2,3}
#
# That example would fire an event with name "my_event"
# and inside that event, $param.c will be equal to "3"
# This will hold true even if the event is fired recursively
[set_variables]
mode=insert
name=param[0]
[value]
{PARAMS}
[/value]
[/set_variables]
[fire_event]
name={FNAME}
[primary_unit]
x,y=$unit.x,$unit.y
[/primary_unit]
[second_unit]
x,y=$second_unit.x,$second_unit.y
[/second_unit]
[/fire_event]
[clear_variable]
name=param[0]
[/clear_variable]
#enddef