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 06-27-2001, 11:10 PM
Keyan Keyan is offline
Registered User
Join Date: Mar 2001
Location: Sparta, NJ
Posts: 261
Keyan is on a distinguished road
Send a message via ICQ to Keyan Send a message via AIM to Keyan Send a message via Yahoo to Keyan
Help: attachplayertoobj objecttype,id

K, my friend is the one havin the problems with this, not me (i dont script o_o; ) Anyone have any ideas what it does?

BigMcStrongmuscl: attachplayertoobj objecttype,id
BigMcStrongmuscl: i dun get what it means by "attach"
BigMcStrongmuscl: cuz the player dont move with the object

__________________
AIM: Keyan2002
Email: [email protected] / [email protected]
I want more posts to use my avatar! >=O >=O
The Death Star was destroyed, and the Empire routed. For now. But the fight would go on. I knew I had much to make up for. Marskan still hated me, and for a good reason. Raider still wouldn't talk to me, and a lot of young pilots had died because I had made them feel invincible. I doubted that I would ever be able to atone for my mistakes.
At least Lynia didn't hate me. Now that the immediate threat was over, she'd promised to spend more time with me. So I had hope. And I had a mission. Like Luke, I would one day learn to master the Jedi way and once and for all banish the taint of the Dark Side within me.
Reply With Quote
  #2  
Old 06-28-2001, 01:20 AM
Er1c Er1c is offline
Registered User
Er1c's Avatar
Join Date: Mar 2001
Location: Chicago, IL
Posts: 791
Er1c is on a distinguished road
When I was trying out the new commands, this is what I made to check out attachplayertoobj... I'll add some comments for you.

NPC Code:

if (created) {
setimg lift_platform.png;
this.speed = .1;
drawunderplayer;//looked funny when the player was getting on without this
setshape2 8,7,{
20,20,20,20,20,20,20,20,
20, 0, 0, 0, 0, 0, 0,20,
20, 0, 0, 0, 0, 0, 0,20,
20, 0, 0, 0, 0, 0, 0,20,
20, 0, 0, 0, 0, 0, 0,20,
20,20, 0, 0, 0, 0,20,20,
20,20, 0, 0, 0, 0,20,20,
};//sets the images blocking properties
timeout = .05;
}
if (timeout) {
if (this.mode=0) {//left movement
if (x<12) {
this.mode = 1;
} else {
x -= this.speed;
}
} else {
if (x>42) {//right movement
this.mode = 0;
} else {
x += this.speed;
}
}
if (playerattached) {
this.check = false;//checks if the player can get off without getting stuck on a wall
for (i = 0;i<4;i++) {
if (onwall(x+2+i,y+7)) {
this.check = true;
break;
}
}
if (playery>=y+4 && playerx+.5 in |x+1,x+4| && this.check==false)//this will take the player off the object if theres no wall in the way
detachplayer;
} else {
if (playerx+.5 in |x,x+5| && playery in |y-2,y+4|)//this attaches the player to the object
attachplayertoobj 0,id;
}
timeout = .05;
}

__________________
Eric Kraft
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 04:46 PM.


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