Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-21-2008, 07:37 AM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
Ship/Attachtoobj Problem...

For some reason this script attaches the player but it warps them around and weirds up the positions on other peoples clients... what am I doing wrong?
PHP Code:
if(playertouchsme&&!playerattached){
  
playerx=x+7.5;
  
playery=y+9;
  
attachplayertoobj 0,id;
  
timeout=0.05;
}

//#CLIENTSIDE
function onCreated(){
  
drawunderplayer();
  
setshape2(1838, {
    
00,00,00,22,22,22,22,22,22,22,22,22,22,22,22,00,00,00,
    
00,00,00,22,22,00,00,00,00,00,00,00,00,22,22,00,00,00,
    
00,00,00,22,22,00,00,00,00,00,00,00,00,22,22,00,00,00,
    
00,00,22,22,22,00,00,00,00,00,00,00,00,22,22,22,00,00,
    
00,22,22,22,22,00,00,22,22,22,22,00,00,22,22,22,22,00,
    
22,22,00,22,22,22,22,22,22,22,22,00,00,22,22,00,22,22,
    
22,22,00,22,22,22,22,22,22,22,22,00,00,22,22,00,22,22,
    
22,22,00,22,22,22,22,22,22,22,22,00,00,22,22,00,22,22,
    
22,22,00,22,22,22,22,22,22,22,22,00,00,22,22,00,22,22,
    
22,22,00,22,22,22,22,22,22,22,22,00,00,22,22,00,22,22,
    
22,22,00,00,00,00,00,00,00,00,00,00,00,00,00,00,22,22,
    
22,22,00,00,00,00,00,00,00,00,00,00,00,00,00,00,22,22,
    
22,22,00,00,00,00,00,22,22,22,22,00,00,00,00,00,22,22,
    
00,00,00,00,00,00,00,22,22,22,22,00,00,00,00,00,00,00,
    
00,00,00,00,00,00,00,22,22,22,22,00,00,00,00,00,00,00,
    
22,22,00,00,00,00,00,22,22,22,22,00,00,00,00,00,22,22,
    
22,22,00,00,00,00,00,00,00,00,00,00,00,00,00,00,22,22,
    
22,22,00,00,00,00,00,00,00,00,00,00,00,00,00,00,22,22,
    
22,22,00,00,00,00,00,00,00,00,00,00,00,00,00,00,22,22,
    
22,22,00,00,00,00,00,00,00,00,00,00,00,00,00,00,22,22,
    
22,22,00,00,00,00,00,00,00,00,00,00,00,00,00,00,22,22,
    
22,22,00,00,00,00,00,00,00,00,00,00,00,00,00,00,22,22,
    
22,22,00,00,00,00,00,22,22,22,22,00,00,00,00,00,22,22,
    
22,22,00,00,00,00,00,22,22,22,22,00,00,00,00,00,22,22,
    
22,22,00,00,00,00,00,22,22,22,22,00,00,00,00,00,22,22,
    
22,22,00,00,00,00,00,22,22,22,22,00,00,00,00,00,22,22,
    
22,22,00,00,00,00,00,22,00,00,22,00,00,00,00,00,22,22,
    
22,22,22,00,00,00,00,22,00,00,22,00,00,00,00,22,22,22,
    
22,22,22,22,00,00,00,22,00,00,22,00,00,00,22,22,22,22,
    
22,22,22,22,22,00,00,00,00,00,00,00,00,22,22,22,22,22,
    
00,22,22,22,22,22,00,00,00,00,00,00,22,22,22,22,22,00,
    
00,00,22,22,22,22,22,00,00,00,00,22,00,22,22,22,00,00,
    
00,00,00,22,22,22,22,22,00,00,22,00,00,22,22,00,00,00,
    
00,00,00,00,22,22,22,22,22,22,22,22,22,22,00,00,00,00,
    
00,00,00,00,00,22,22,22,22,22,22,22,22,00,00,00,00,00,
    
00,00,00,00,00,00,22,22,22,22,22,22,00,00,00,00,00,00,
    
00,00,00,00,00,00,00,22,22,22,22,00,00,00,00,00,00,00,
    
00,00,00,00,00,00,00,00,22,22,00,00,00,00,00,00,00,00,
      });
}
function 
onTimeout(){
  if (
keydown(6)){
    
detachplayer;
    
player.x=x-4;
    
player.y=y-4;
    
setplayerprop #c,You left the boat.;
  
}
  
setTimer(0.05);

Reply With Quote
  #2  
Old 05-21-2008, 07:39 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
You're mixing GS1 with GS2!
setplayerprop #c,You left the boat.;
player.chat = "You left the boat.";

detachplayer;
detachplayer();

but in all honesty, I'm going to need some other details, does it only happens when it changes levels or what?
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #3  
Old 05-21-2008, 07:45 AM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
When I touch the boat it warps the player a few times then centers at the point I tell it to but for some reason other players don't see the updated position or something. I think it fixes if you update level but Im not sure.
Reply With Quote
  #4  
Old 05-21-2008, 07:58 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
I think that's just one of the bugs with attachplayer, it's a bit buggy like that. Try putting attachplayertoobj before player.x/player.y changes in the serverside part of the script.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #5  
Old 05-21-2008, 08:15 AM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
Seems to work but when I reconnect or someone else does it acts the same way...
Reply With Quote
  #6  
Old 05-21-2008, 08:17 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
You might need to detach the player upon reconnection.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #7  
Old 05-21-2008, 07:58 PM
Ziro_of_the_Turks Ziro_of_the_Turks is offline
Registered User
Join Date: Mar 2005
Posts: 887
Ziro_of_the_Turks will become famous soon enough
I wanna ride some boats that aren't on GK

Or hell, I wanna ride anything on any non-GK server that attaches more than 1 player to the object (that means no 1-player vehicles)

Here's the fun part- Graal is now big enough that I have to ask... Does anyone know where I can find something like this availible to play with? Any open-server with something like that?
Reply With Quote
  #8  
Old 05-21-2008, 08:04 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
I have a floating island on N-Pulse that sometimes has up to 20 people on it.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #9  
Old 05-21-2008, 08:56 PM
Ziro_of_the_Turks Ziro_of_the_Turks is offline
Registered User
Join Date: Mar 2005
Posts: 887
Ziro_of_the_Turks will become famous soon enough
Show me. plox.
Reply With Quote
  #10  
Old 05-21-2008, 10:08 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
I made a floating elevator for Utopia ...

But yes, attach before changing x/y and deattach at login.
__________________
Reply With Quote
  #11  
Old 05-22-2008, 07:43 AM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
Do both functions have to be clientsided or serversided? It still doesnt work...
At first it looks like it works but when you reconnect it messes up the positions of others on your screen...
Reply With Quote
  #12  
Old 05-22-2008, 10:35 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
I would use serverside attach. But, does this even exist? I've only used attach one time.
__________________
Reply With Quote
  #13  
Old 05-23-2008, 05:18 AM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
It is serversided... but what about detach?
Reply With Quote
  #14  
Old 05-23-2008, 05:30 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Definitely serverside or it won't update on the server.
__________________
Reply With Quote
  #15  
Old 05-23-2008, 09:47 AM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
both are serversided...
Reply With Quote
Reply


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 01:38 AM.


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