Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   if (actionblahblahblah) question. (https://forums.graalonline.com/forums/showthread.php?t=39368)

Googi 10-17-2002 04:59 AM

if (actionblahblahblah) question.
 
Now, on NPCServer servers, there are various "actions"

I want to know how to "create" those actions.

Like, when someone uses the apple seed NPCW, it "does" the action "actionseed"

But how?

amonrabr 10-17-2002 05:24 AM

hmm this "actions" atre from triggeractions.. example..

you put this script clientsided;

triggeraction 0,0,serverwarp,#a,onlienstartlocal.graal,30,30;


on your npc control you can have:

if (actionserverwarp){
with(getplayer(#p(0))){setlevel2 #p(1),strtofloat(#p(2)),strtofloat(#p(3))}

}

see? you put "action<something>" for triggeractions <x>,<y>,<something>,<param 1>....

Torankusu 10-17-2002 05:30 AM

Triggeraction.

example:
[/code]
if (actionserverside){
do stuffs;
}

//#CLIENTSIDE
if (weaponfired){
triggeraction 0,0,serverside,Apple Seed,;
}

[/code]

Explaination:
The triggeraction in this NPC Weapon works like this:
NPC Code:

triggeraction x,y,serverside,Weapon Name,params;


In this case, you don't really need an x/y, so I set it to 0.
I put serverside to trigger the action SERVERSIDE. Hence the actionserverside above the clientside part of the script.
params, I'll explain them when you need them. They're tidbits of information, read by #p(NUMBER OF PARAM);

ANYWAYS.
Another example of triggeraction:
NPC Code:

if (actionseed){
do stuffs;
}

//#CLIENTSIDE
if (weaponfired){
triggeraction X,Y,seed,;
}



Explaination:
NPC Code:

triggeraction X,Y,action name,params;


Again, X/Y is the X/Y you want to trigger this action.
The action name is seen in
(actionseed).
Then there are params again.


IMPORTANT
The ACTON-whatevers are Case sensitive.
For instance, if you had WeAPon as the NPC Weapon name:
you would have to use
triggeraction 0,0,serverside,WeAPon,;
in order for it to work.

Hope it helped.

Torankusu 10-17-2002 05:31 AM

Quote:

Originally posted by amonrabr

if (actionserverwarp){
with(getplayer(#p(0))){setlevel2 #p(1),strtofloat(#p(2)),strtofloat(#p(3))}

}

You don't need to use getplayer because NPC Server already knows you're editing the client by using setlevel2. If the client executes the script, it will know that that is the account it's supposed to warp.

user13-xo 10-17-2002 10:01 AM

There is others that isnt triggeraction like:

actionleftmouse
actionmiddlemouse
actionrightmouse
actiondoublemouse
actionpushed
actionpulled

osrs 10-17-2002 10:11 AM

Quote:

Originally posted by user13-xo
There is others that isnt triggeraction like:

actionleftmouse
actionmiddlemouse
actionrightmouse
actiondoublemouse
actionpushed
actionpulled

so...?

user13-xo 10-17-2002 10:17 AM

Quote:

Originally posted by osrs


so...?

I can see youre still mad at me. :o

HoudiniMan 10-17-2002 03:26 PM

Quote:

Originally posted by osrs


so...?

I can see why; because you just posted commands with no explanation, how is that supposed to help the person asking?

user13-xo 10-17-2002 08:53 PM

So would this help?

if (actionleftmouse) message Left Click;
if (actionmiddlemouse) message Middle Button Click;
if (actionrightmouse) message Right Click;
if (actiondoublemouse) message Double Click;

emortylone 10-17-2002 11:29 PM

I assume that since it starts with if (action...) then those certain mouse commands use triggeractions then... perhaps... who knows, oh well. but yes, you can do server or clientside triggeractions. server ones are VERY useful, but sometimes you need client ones for things such as an HP sys etc.
---Shifter

Torankusu 10-18-2002 03:11 AM

Quote:

Originally posted by emortylone
I assume that since it starts with if (action...) then those certain mouse commands use triggeractions then... perhaps... who knows, oh well. but yes, you can do server or clientside triggeractions. server ones are VERY useful, but sometimes you need client ones for things such as an HP sys etc.
---Shifter

You don't need to use triggeraction to trigger the mouse commands.

It's just
NPC Code:

if (actionleftmouse){ //THE LEFT MOUSE BUTTON WAS CLICKED ON THE NPC
script here;
}


emortylone 10-18-2002 06:10 AM

LOL! I am QUITE aware of that =P I was SAYING that perhaps the mouse commands use triggeraction ;) comparing it... nvm then ;)
---Shifter

Torankusu 10-18-2002 06:13 AM

Quote:

Originally posted by emortylone
LOL! I am QUITE aware of that
---Shifter

Then don't state you assume that if it starts with if (action...) you think it's triggeraction'ed. You didn't sound "QUITE" aware of it in your post.


All times are GMT +2. The time now is 07:55 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.