I found a good example at NewFeatures:
triggeraction targetx,targety,action,params;
This is one of the commands that give you like 50% more scripting
power than before. It is like a combination of hitobjects and
callnpc, but better. With 'triggeraction' you invoke an event
to the object on positon (targetx,targety). If the object is
an npc, then the npc script is called with the flag
'action<action>' set, when the object is a player then the
weapon scripts of the that player are called with the
'action<action>' flag set.
'params' can be one or more parameters, divided by commas;
the called script can read the paramters by accessing the
message code #p(paramindex).
Because this is hard to explain with words, here some little examples:
Quote:
- trigger player weapons
You can easily do a weapon which freezes the other
player:
if (playertouchsme) toweapons Freezing-Weapon;
if (weaponfired) {
triggeraction playerx+1.5+vecx(playerdir)*2,
playery+2+vecy(playerdir)*2,freeze,;
}
if (actionfreeze) {
freezeplayer 3;
setplayerprop #c,FREEZED;
}
|
Both players must have this weapon for making it
working. Then use it on the other player, and he will
be freezed, because a 'freeze' action is sent to him
and his weapon script, called with flag 'actionfreeze',
will freeze him. You can also move the if (actionfreeze) ...
into an system npc so the weapon can be used on all
players.