Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Setshape2 and attachplayertoobj ARGH (https://forums.graalonline.com/forums/showthread.php?t=63721)

fowlplay4 01-26-2006 06:54 AM

Setshape2 and attachplayertoobj ARGH
 
3 Attachment(s)
Oh boy two problems in one day. OK so im trying to make a passenger boat script. So a group of people can jump on and have a jolly good time exploring the ocean. Problem is everytime I get on the boat I get warped down a level except I can see still all the npcs and players in that same level.

PHP Code:

if (created) {
setstring this.level,#L,#v(x),#v(y);
setimg ship1.gif;
setshape 1,32,32;
this.isadummynpc true;
}
if (
playerchats) {
 if (
strequals(#c,destroy)) {
  
detachplayer;
  
sendtonc boat destroyed;
  
destroy;
  }
}

//#CLIENTSIDE
if (created) {
setshape2 1425, {
    
1111111111111111111111111111,
    
1111112222222222222222111111,
    
11111122222233222222111111,
    
1111222233333322221111,
    
11112203300330221111,
    
11112200000000221111,
    
1111220002222000221111,
    
1111220022332200221111,
    
1111220022332200221111,
    
11112200033000221111,
    
11112200033000221111,
    
11110002233220001111,
    
11110002233220001111,
    
1111220002222000221111,
    
11112200000000221111,
    
11112200000000221111,
    
1111222200000022221111,
    
1111222222222222222222221111,
    
1111222222222222222222221111,
    
1111112222222222222222111111,
    
1111111122222222222211111111,
    
1111111111222222221111111111,
    
1111111111112222111111111111,
    
1111111111111111111111111111,
    
1111111111111111111111111111, };
   }
   

if (
playertouchsme) {
  
setplayerprop #c,Jump in the water and Press A to leave!;
  
attachplayertoobj 0,id;
}

if (
timeout && playerattached){
  if (
keydown(6)){
    
detachplayer;
    
enabledefmovement;
    
setplayerprop #c,You disembark the boat.;
  
}
 if (!
playerx in |x,x+14|) {
  if (!
playery in |y,y+25|) {
    
playerx=x+6;
    
playery=y+14;
   }
  }
 }
timeout=.05

Edit:Another Update in script!
The Graphic im using is also attached.
My Problems Before and After pictures also included!
Help would be much appreciated! :)

Lance 01-26-2006 07:19 AM

-set a flag serverside so the NPC isn't treated like a dummy NPC
-setshape2 is clientside

fowlplay4 01-26-2006 03:45 PM

Hmm im still having that warping problem...
I'll post some screens after school

Lance 01-26-2006 10:11 PM

You still need some image/shape serverside.

fowlplay4 01-27-2006 12:47 AM

Hmmm.. It appears that this is one of those gmap problems.

Inverness 07-13-2007 06:25 AM

Sorry to revive old threads but I'm having this exact same problem, anyone know how to fix it?

Inverness 07-13-2007 07:07 AM

Fixed now, apparently it only works for gmaps if you trigger the attach function serverside, however the delay needed to make the attachment causes a small jerking motion when your player attaches to the ship :(

Angel_Light 07-13-2007 09:41 AM

adjust the player x y so it doesn't seem to be a jerking motion?

zokemon 07-13-2007 10:18 AM

Quote:

Originally Posted by Angel_Light (Post 1328924)
adjust the player x y so it doesn't seem to be a jerking motion?

Oh, my immature humor made me laugh...

Inverness 07-13-2007 12:52 PM

Hmm, making the player warp about a tile might reduce the effect, but I'm too lazy to do it now.

Angel_Light 07-13-2007 01:38 PM

Quote:

Originally Posted by zokemon (Post 1328932)
Oh, my immature humor made me laugh...

Least someone got it. :D and Invern, GET OFF YOUR LAZY ASS!!! Much Love!

Inverness 07-13-2007 01:41 PM

Quote:

Originally Posted by Angel_Light (Post 1328954)
Least someone got it. :D and Invern, GET OFF YOUR LAZY ASS!!! Much Love!

I think he meant other actions that involve jerking motion, WINK WINK.


All times are GMT +2. The time now is 04:12 PM.

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