Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   script help..=X (https://forums.graalonline.com/forums/showthread.php?t=43392)

ShadowDarkstar 03-12-2003 04:57 AM

script help..=X
 
NPC Code:

// NPC made by Ajira
if (actionmove){
x=strtofloat(#p(0));
y=strtofloat(#p(1));
}
//#CLIENTSIDE
if (mousedown && mousex in |x,x+2| && mousey in |y,y+3|){
timeout=.05;
this.click=1;
}
if (mouseup && this.click==1){
triggeraction x,y,move,#v(mousex),#v(mousey);
hideimg 201;
this.click=0;
timeout=0;
}
if (timeout && this.click==1){
showimg 201,#f,mousex,mousey;
changeimgcolors 201,1,1,1,0.99;
timeout=.05;
}



well, this is a script im making so you can move stuff with mouse, but, I can only move it once, then it won't move again
maybe some help =/
oh and, the actionmove is serverside because the x and y of the npc changes for all players
plz help =X

HoudiniMan 03-12-2003 05:25 AM

Re: script help..=X
 
Quote:

Originally posted by ShadowDarkstar
NPC Code:

triggeraction x,y,move,#v(mousex),#v(mousey);



NPC Code:

triggeraction x,y,move,<npcname>,#v(mousex),#v(mousey);


should work

a better more common way to do it would be to replace move with serverside, i'm not sure if the name matters for the server, but it doesn't for your npc... so it can't hurt

most people do it this way and you can do other things too if you used param 0 for the indicator like this:
NPC Code:

if (actionserverside) {
if (streqauls(#p(0),move) {
x=#p(1);
y=#p(2);
}
if (strequals(#p(0),shoot or something) {
do shooty things or whatever;
}
}



the trigger would look like:
NPC Code:
triggeraction 0,0,serverside,dbnpcname,move/shoot/etc,p1,p2,p3;


ShadowDarkstar 03-12-2003 05:39 AM

ok but see its a level npc not a weapon
and i tried serverside, didnt work

Knuckles 03-12-2003 06:26 AM

Re: script help..=X
 
Quote:

Originally posted by ShadowDarkstar
well, this is a script im making so you can move stuff with mouse, but, I can only move it once, then it won't move again
maybe some help =/
oh and, the actionmove is serverside because the x and y of the npc changes for all players
plz help =X [/B]
It works for me.. ;o

ShadowDarkstar 03-13-2003 01:23 AM

of course it works offline
everything works offline =X
not online though >.<

PastAustin 03-13-2003 04:11 AM

Well I have been missing from the graal world for a while. But as I remember it you need to setshape on it, then:
NPC Code:

triggeraction x+1.5, y+2, serverside, params, ..., ..., ...;


Has this changed?

tlf288 03-13-2003 05:59 AM

Just use:

setshape 1,1,1;

Then the triggeraction will work. I wouldn't suggest this though.
I suggest to make a class and use

join classname;

and use some kind of this. var to pass a variable to the class to proccess it as the width and height of the image.

ShadowDarkstar 03-13-2003 06:11 AM

well i got it working
i did a setshape2 on the serverside and did
triggeraction x+1,y+1,move,#v(mousex),#v(mousey);
thx all for your help


All times are GMT +2. The time now is 02:39 AM.

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