Thread: Sword System
View Single Post
  #5  
Old 02-14-2003, 06:30 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
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.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /