Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-05-2006, 03:19 PM
MegaMasterX90875 MegaMasterX90875 is offline
Retired Graalian (2009)
MegaMasterX90875's Avatar
Join Date: Feb 2006
Location: North Carolina
Posts: 132
MegaMasterX90875 is on a distinguished road
Send a message via AIM to MegaMasterX90875
Changing an NPC's X/Y Coordinates

I'm trying to make a script that tokenizes and sets X/Y coordinates according to tokenized results. This is what I have so far (Note: It's in GS1):
NPC Code:
 if (created) {
set OrigX;
set OrigY;
OrigX=this.x;
OrigY=this.y;
//This is in case it messes up.
set EditMode;
}
if (playerchats&&strequals(#c,/Editmode)) {
EditMode=1;
message EditMode On!;
sleep 2;
message ;
}
if (playerchats&&strequals(#c,/Editmode off)) {
EditMode=0;
message EditMode Off!;
sleep 2;
message ;
}
if (playerchats&&EditMode=1&&strcontains(#c,/move chair1)) {
tokenize #c;
this.x=strtofloat(#t(3));
this.y=strtofloat(#t(4));
}
if (playertouchsme&&EditMode=1) {
blockagain;
canbepushed;
canbepulled;
}
if (playertouchsme&&EditMode=0) {
dontblock;
cannotbepushed;
cannotbepulled;
player.sprite=37;
}


The /move chair1 is supposed to be like /move chair1 <NewX> <NewY>
Also, when the player chats the sprite is changed to sitting (37) even when the player is not touching the chair.
Is there a way to make this serverside and save the position of the objects?
Is this the best way to do this?
And, can I make it check to see if it's on a wall? How do I do that?
__________________
Mess with the best, Die like the rest.




Last edited by MegaMasterX90875; 04-05-2006 at 03:21 PM.. Reason: Forgot to add something
Reply With Quote
 


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:03 PM.


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