Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   callnpc param's (https://forums.graalonline.com/forums/showthread.php?t=10101)

Warcaptain 08-22-2001 02:44 AM

callnpc param's
 
NPC Code:

for (i=0;i<npcscount;i++){
callnpc i,hit,50;
}




now how do i make an npc read the param 50 for the flag hit?

LiquidIce00 08-22-2001 02:54 AM

i never knew callnpc had params..

normal callnpc (and i think u know this)
if just like

callnpc whatever,hi;

then on the npc
if (hi) { setcharprop #c,hi; }

Falcor 08-22-2001 03:11 AM

Quote:

Originally posted by LiquidIce00
i never knew callnpc had params..

They dont

LiquidIce00 08-22-2001 03:15 AM

triggeraction is like
triggeraction playerx,playery,trigger,;

then on the npc ..

if (actiontrigger) {
whatever
}

but i dunno how to use the param on it

Falcor 08-22-2001 03:21 AM

Triggeraction params are like gani aparms almost. ITs all string based so if you wanted a triggeraction to hit a person for like 1 damage (Would make more sence with hitobjects though) then...
NPC Code:

triggeraction targetx,targety,hitperson,1;


and the other person must have a weapon with contains
NPC Code:

if(actionhitperson) {
hurt strtofloat(#p(0));
}


LiquidIce00 08-22-2001 03:26 AM

Quote:

Originally posted by Falcor
Triggeraction params are like gani aparms almost. ITs all string based so if you wanted a triggeraction to hit a person for like 1 damage (Would make more sence with hitobjects though) then...
NPC Code:

triggeraction targetx,targety,hitperson,1;


and the other person must have a weapon with contains
NPC Code:

if(actionhitperson) {
hurt strtofloat(#p(0));
}


thats what I thought
i hardly ever use trigger action and when I do I dont really need params

Warcaptain 08-22-2001 07:22 AM

*smacks head*

yeah its trigger action that has parameter.

Falcor 08-22-2001 10:19 AM

*hits Warcaptain with a salmon and knocks him unconscious*

Whoops! :(


...
:D

Tyhm 08-22-2001 02:17 PM

!Error
From experience, it sends strings, not integers.
triggeraction this.testx,this.testy,hit,#v(50);

if(actionhit){
if(this.justhit<1){
this.justhit=50;
hearts-=strtofloat(#p(0));
}
}
if(playerenters||timeout){
if(this.justhit>0) this.justhit--;
timeout=0.05;
}

nyghtGT 08-23-2001 08:44 AM

say wha .... ???
 
huh ....
http://www.deceptiononline.f2s.com/nyghtdoll.gif

Tyhm 08-23-2001 08:52 AM

Sorry, that should be #v(swordpower)...
if you're sending a variable, you gotta wrap it in #v() or it'll just send the name of the variable, ie "1" instead of "swordpower"

triggeraction this.testx,this.testy,fish,#v(this.oldpower);
this.damage=strtofloat(#p(0));


All times are GMT +2. The time now is 02:17 PM.

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