|
Okay, A Param (Parameter) is just like a trailing piece of information on an object for the most part in graal script.
setshootparams isfire,#v(this.firepower);
Could be used to tell the client that is hit (if (actionprojectile) ...) or the Server (if (actionprojectile2) ...) The parameters above might be used like this in a weapon:
(In the -Systems npc or something that all players have)
if (actionprojectile) {
// This (#p(2) is the first thing in setshootparams, so its param2 (param0 and param1 are the X,Y positions of the impact)
if (strequals(#p(3),isfire) {
damage=strtofloat(#p(1))*2; // Times by 2 because hurt works in halfhearts.
hurt damage;
}
}
if (actionprojectile2) {
if (strequals(#p(2),isfire)) {
putnpc2 strtofloat(#p(0)),strtofloat(#p(1)),{
if (created) {
setimg fire.gif;
}
}
}
}
//This puts the npc and makes it fire.gif in the position of the impact of the projectile, this code above would be in the control-npc of your server, These are just examples of how to use Params with projectiles, any mistakes I may have made please feel free to correct me, its been 3 or 4 months since I had a server to script on.
More on Params.
Params are used with almost everything.
setplayerprop #P(20) is playerprop 20 if used in the current Gani.
Triggeractions Use Params, This is how many actions are carried player to player and player to server, npc to player, npc to server etc. with serverside Scripting.
triggeraction x,y,serverside,serverwarp,#a,newx,newy,newlevel;
(With params being serverwarp,#a,newx,newy,newlevel)
(this triggers an actionserverside)
if (actionserverside) {
}
was a commonly used server action, but is not used now, because of the ease of use for a 'hacker/trainer' user to abuse the fact that almost all servers used "serverwarp" in that format they could warp themselves using it.
I found that just messing around (Fiddling around with commands) is the best way to learn, Start from the basics though. |