Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-12-2003, 04:57 AM
ShadowDarkstar ShadowDarkstar is offline
Registered User
ShadowDarkstar's Avatar
Join Date: Feb 2003
Location: Montreal
Posts: 42
ShadowDarkstar is on a distinguished road
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
Reply With Quote
  #2  
Old 03-12-2003, 05:25 AM
HoudiniMan HoudiniMan is offline
Playerworld Administrator
HoudiniMan's Avatar
Join Date: Dec 2001
Location: Calfiornia - USA
Posts: 3,512
HoudiniMan is on a distinguished road
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;

__________________
-HoudiniMan (Chief Playerworld Administrator)
Compulsive Support Center Checker - 5 Years and Change
Graal Support Center

Reply With Quote
  #3  
Old 03-12-2003, 05:39 AM
ShadowDarkstar ShadowDarkstar is offline
Registered User
ShadowDarkstar's Avatar
Join Date: Feb 2003
Location: Montreal
Posts: 42
ShadowDarkstar is on a distinguished road
ok but see its a level npc not a weapon
and i tried serverside, didnt work
Reply With Quote
  #4  
Old 03-12-2003, 06:26 AM
Knuckles Knuckles is offline
Registered User
Join Date: Sep 2002
Location: New York
Posts: 580
Knuckles is on a distinguished road
Send a message via AIM to Knuckles
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
__________________
Knuckles
"They say 60% of the time, it works everytime!"
Reply With Quote
  #5  
Old 03-13-2003, 01:23 AM
ShadowDarkstar ShadowDarkstar is offline
Registered User
ShadowDarkstar's Avatar
Join Date: Feb 2003
Location: Montreal
Posts: 42
ShadowDarkstar is on a distinguished road
of course it works offline
everything works offline =X
not online though >.<
Reply With Quote
  #6  
Old 03-13-2003, 04:11 AM
PastAustin PastAustin is offline
Registered User
Join Date: Mar 2003
Location: Littleton, Colorado, US
Posts: 91
PastAustin is on a distinguished road
Send a message via ICQ to PastAustin Send a message via AIM to PastAustin
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?
__________________
"...I'm going to burn this place down..."
-Milton
Reply With Quote
  #7  
Old 03-13-2003, 05:59 AM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
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.
__________________
new account: Trevor
Reply With Quote
  #8  
Old 03-13-2003, 06:11 AM
ShadowDarkstar ShadowDarkstar is offline
Registered User
ShadowDarkstar's Avatar
Join Date: Feb 2003
Location: Montreal
Posts: 42
ShadowDarkstar is on a distinguished road
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:40 PM.


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