Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Can you use this on None P2p: (https://forums.graalonline.com/forums/showthread.php?t=27178)

Spark910 04-09-2002 02:32 AM

Can you use this on None P2p:
 
Can you use:

triggeraction on non p2p

?

Spanko 04-09-2002 02:44 AM

I think it's allowed, though I'm not completely sure.
It certainly makes things much more normally possible then otherwise.

royce 04-09-2002 03:34 AM

triggeraction x,y,action,params,.....;

It triggers action "action" at x y, however they failed to mention that you can add params, mostly for p2p stuff..but awww heck...
watch:


code:--------------------------------------------------------------------------------
if (playertouchsme) toweapons weapon;
if (playerchats) triggeraction playerx+1.5,playery+2,weapon,name,#c,#a;
if (actionname) setplayerprop #c,#p(1): #p(0);
--------------------------------------------------------------------------------

talk about a loop...

Slaktmaster 04-09-2002 03:40 AM

Yeah, it's allowed.

happyme 04-09-2002 04:33 AM

Quote:

Originally posted by Slaktmaster
Yeah, it's allowed.
un and alot of other people have it, so why cat you :P?

Gohan43331 04-09-2002 06:15 AM

Quote:

Originally posted by royce
if (playerchats) triggeraction playerx+1.5,playery+2,weapon,name,#c,#a;

so it's x,y,weapon,action,params...

I thought it was action before weapon

*Goes back to fix his system npcw*

[edit]

Funny thing is, that's not working either....

*ponders if he's doing this right...*

NPC Code:

if (weaponfired) triggeraction playerx+this.xdirgo[playerdir],playery+this.ydirgo[playerdir],-system,steal,#s(client.skill),#s(client.dex);


and in player system:
NPC Code:

if (actionsteal) {
if (isweapon) {
playerrupees-=strtofloat(#p(1))/2;
}
}



Can you see anything wrong?

Saga2001 04-09-2002 08:25 AM

Quote:

Originally posted by Gohan43331


so it's x,y,weapon,action,params...

I thought it was action before weapon

*Goes back to fix his system npcw*

[edit]

Funny thing is, that's not working either....

*ponders if he's doing this right...*

NPC Code:

if (weaponfired) triggeraction playerx+this.xdirgo[playerdir],playery+this.ydirgo[playerdir],-system,steal,#s(client.skill),#s(client.dex);


and in player system:
NPC Code:

if (actionsteal) {
if (isweapon) {
playerrupees-=strtofloat(#p(1))/2;
}
}



Can you see anything wrong?

it looks like that isweapon test is failing...? maybe? also why are you using +this.dirgo? I think you want playerx+1.5,playery+2...

Gohan43331 04-09-2002 09:47 AM

Well, i use that for later, when it needs to test other people...I guess i might try 1.5,2....see what happens

[edit]
Still no luck....do you think this would work online?
[/edit]

Spanko 04-09-2002 05:30 PM

Quote:

Originally posted by Gohan43331
Removed long post
Nah, the Weapon is only necesarry when you are calling to the serverside part of a weapon.
Otherwise if you want to call a weapon you'll just have to use callweapon.

amonrabr 04-10-2002 01:31 AM

Re: Can you use this on None P2p:
 
Quote:

Originally posted by Spark910
Can you use:
triggeraction on non p2p?

yap

G_yoshi 04-10-2002 01:43 AM

I think newfeatures2001.txt says triggeraction is for p2p only...I could be wrong though :)

Spanko 04-10-2002 03:00 AM

Quote:

Originally posted by G_yoshi
I think newfeatures2001.txt says triggeraction is for p2p only...I could be wrong though :)
I checked, it doesn't say anything about where it may be used or not.

Gohan43331 04-10-2002 04:10 AM

Quote:

Originally posted by Spanko

Nah, the Weapon is only necesarry when you are calling to the serverside part of a weapon.
Otherwise if you want to call a weapon you'll just have to use callweapon.

Well, *TECHNICALLY* none of it's client-side (unless toweapons is cs, which i think it is) I wanted to see if i could do it without callweapon, since you can't use variables... :-/

[edit] (instead of a new post :D )

Could this be done with p2p?
NPC Code:

this.dex=client.dex;
this.pplevel=client.pplevel;
with(players[testplayer(playerx,playery)]) {
dostuff;
}


It would be able to access those this.-vars from inside the with, since it isn't accessing a npc (with it's own this.-vars), right?

[/edit]

Saga2001 04-10-2002 03:48 PM

Quote:

Originally posted by Kaimetsu


Wha...? All clientside commands are clientside. That's why they're called "clientside commands".

I love kai, he is the cheese in my sandwitch.

I believe that if you wrote the code correctly, it would work d00d, maybe just do tests at every stop to see whats happeneing...

Gohan43331 04-11-2002 04:15 AM

Quote:

Originally posted by Kaimetsu


Wha...? All clientside commands are clientside. That's why they're called "clientside commands".


Heheh Mmmkay

Quote:

Players' this.vars are stored clientside, and thus cannot be accessed by the server. So any this.vars within the with structure would refer simply to those of the NPC running the script. [/B]
By players' this.-vars you mean client.-vars? Or are there actually this.-vars for the client?

Deadly_Killer 04-19-2002 05:55 AM

P2P
 
It doesn't matter about p2p or not. Graal is going p2p in about 2 or 3 weeks.

Saga2001 04-19-2002 07:01 AM

Quote:

Originally posted by royce
triggeraction x,y,action,params,.....;
code:--------------------------------------------------------------------------------
if (playertouchsme) toweapons weapon;
if (playerchats) triggeraction playerx+1.5,playery+2,weapon,name,#c,#a;
if (actionname) setplayerprop #c,#p(1): #p(0);
--------------------------------------------------------------------------------

talk about a loop...

Actually that wouldn't loop, only if the player chat is set be the player does playerchats trigger...(I am 90% pausitive)

emortylone 04-26-2002 09:18 PM

I don't use it often, but from what i've read and been told, then triggeraction works on non=p2p and is legal. At first someone told me it wasn't, be EVERYONE else that i talked to says it is allowed and works just fine. So i'd say Hell yes it worx.
---Shifter


All times are GMT +2. The time now is 03:45 PM.

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