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 07-24-2001, 12:56 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Assisstance with attachplayertoobj...

Hey, I am trying to make a boat thing similar to the mini-ships on graal2001....i have it all setup (setshape2 stuff) but when the player is put on it, he is not fully attached, what is wrong?

NPC Code:

if (playertouchsme&&!playerattached) {
attachplayertoobj 0,0;
set playerattached;
playerx=x+5.5;
playery=y+7;
}

if (playerchats&&playerattached) {
if (strequals(#c,leave)) {
detachplayer;
unset playerattached;
playerx=x;
playery=y;
}



i know that I must be doing something wrong, so I would appreciate it if someone could help me with it, thanks
__________________
Reply With Quote
  #2  
Old 07-24-2001, 01:37 PM
kyle0654 kyle0654 is offline
-. .`
kyle0654's Avatar
Join Date: Mar 2001
Posts: 1,000
kyle0654 will become famous soon enough
attachplayertoobj 0,id;

attaches the player to the current npc (identified by id) (as long as it's in the format playerindex, npcindex)
Reply With Quote
  #3  
Old 07-24-2001, 11:20 PM
Brady2 Brady2 is offline
Registered User
Brady2's Avatar
Join Date: Mar 2001
Location: Phoenix, AZ and Wichita Falls, TX
Posts: 924
Brady2 is on a distinguished road
Jadis:

What does attachtoobj do?

it sets a flag if (playerattached);

But why would that help? Couldn't you just set a flag instead of using attach player?
Or does it move the player along with the npc's movements?
Reply With Quote
  #4  
Old 07-25-2001, 12:43 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally posted by kyle0654
attachplayertoobj 0,id;

attaches the player to the current npc (identified by id) (as long as it's in the format playerindex, npcindex)
I know that, I just want to know why it isn't working :/

it should attach the player, but I am assuming that I gave it the wrong id...but how do i find out the npc's id?
__________________
Reply With Quote
  #5  
Old 07-25-2001, 01:23 AM
kyle0654 kyle0654 is offline
-. .`
kyle0654's Avatar
Join Date: Mar 2001
Posts: 1,000
kyle0654 will become famous soon enough
no, you actually use 'id' as the variable
Reply With Quote
  #6  
Old 07-25-2001, 02:13 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally posted by kyle0654
no, you actually use 'id' as the variable
so you are saying to put 'id' in the final spot?
__________________
Reply With Quote
  #7  
Old 07-25-2001, 02:16 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally posted by G_yoshi


so you are saying to put 'id' in the final spot?
i tried it......yay it worked

thanks for your help kyle
__________________
Reply With Quote
  #8  
Old 07-25-2001, 02:34 AM
kyle0654 kyle0654 is offline
-. .`
kyle0654's Avatar
Join Date: Mar 2001
Posts: 1,000
kyle0654 will become famous soon enough
no problem
Reply With Quote
  #9  
Old 07-25-2001, 10:42 PM
Shard_IceFire Shard_IceFire is offline
Registered User
Shard_IceFire's Avatar
Join Date: Jun 2001
Location: Eastern Harkoonia
Posts: 861
Shard_IceFire is on a distinguished road
Quote:
so you are saying to put 'id' in the final spot?
lol! yes, you literally put "id"
__________________

-=Shard IceFire=-
Reply With Quote
  #10  
Old 07-25-2001, 10:47 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally posted by Shard_IceFire


lol! yes, you literally put "id"
erm, I have already taken care of it thank you
__________________
Reply With Quote
  #11  
Old 07-26-2001, 11:51 PM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Isn't 0 the only current id you can use (0 for npc)?
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #12  
Old 07-27-2001, 12:43 AM
kyle0654 kyle0654 is offline
-. .`
kyle0654's Avatar
Join Date: Mar 2001
Posts: 1,000
kyle0654 will become famous soon enough
naw...try this:
NPC Code:

if (created) message #v(id);


every NPC on the server (or offline for that matter) is given an index, in order of creation I think. When I tried that offline my NPCs had indexes in the thousands...
Reply With Quote
  #13  
Old 07-27-2001, 12:57 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally posted by kyle0654
naw...try this:
NPC Code:

if (created) message #v(id);


every NPC on the server (or offline for that matter) is given an index, in order of creation I think. When I tried that offline my NPCs had indexes in the thousands...
in the thousands
__________________
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 09:54 PM.


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