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
  #16  
Old 05-23-2008, 01:45 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Here's an example on how to use attachplayer, I use it on Mythic and it works flawless. I've cut out some parts though - but should contain the information you need.

PHP Code:
function onPlayerTouchsMe()
{
  if (
player.x in |x3| && player.y in |37|) {
    if (!
player.attached && player.dir == 3player.attachPlayerToObj(0id);
    else if (
player.attached && (player.dir == || player.attached && player.dir == 2) && player.x in |x+1|) detachPlayer();
  }

  else if (
player.x in |2021| && player.y in |37|) {
    if (!
player.attached && player.dir == 1attachPlayerToObj(0id);
    else if (
player.attached && player.dir == 3detachPlayer();
  }
}

//#CLIENTSIDE
function onCreated()
{
  
// SET SHAPE HERE

__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #17  
Old 05-23-2008, 03:34 PM
Robin Robin is offline
The secret of NIMH
Robin's Avatar
Join Date: Apr 2005
Location: Wales, UK
Posts: 515
Robin will become famous soon enough
Send a message via AIM to Robin
Thought setshape2 was for serverside?
__________________

Reply With Quote
  #18  
Old 05-23-2008, 04:30 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by Robin View Post
Thought setshape2 was for serverside?
It work's either way. In this case, I have to have it clientside since I change the shape of the NPC depending on where the player is - and it refuses to update properly on serverside.

And since this guy is making a ship, he'll most likely want to change shape depending on the direction of the ship, thus he should do it clientsided in a timeout.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #19  
Old 05-27-2008, 03:09 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
Hmm... I tried your script with my setshapes and all... at first it looked like it was working right but the same problem appeared when I reconnected.
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 02:22 AM.


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