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-10-2002, 12:42 PM
monkeymon monkeymon is offline
Registered User
Join Date: Jun 2002
Location: Florida
Posts: 11
monkeymon is on a distinguished road
Send a message via AIM to monkeymon
Bridge

Is it possible to script a bridge client side? One where a player can go under, at the same time another player is walking over it? (The way a real bridge works)
__________________
<3
Fishbulb
Reply With Quote
  #2  
Old 06-10-2002, 01:02 PM
user13-xo user13-xo is offline
Registered User
Join Date: Nov 2001
Location: California
Posts: 297
user13-xo is on a distinguished road
Send a message via AIM to user13-xo
Re: Bridge

Quote:
Originally posted by monkeymon
Is it possible to script a bridge client side? One where a player can go under, at the same time another player is walking over it? (The way a real bridge works)
Its possible. I done it on Babylon.
Reply With Quote
  #3  
Old 06-10-2002, 06:20 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
yeah thats totally possible =D
__________________
[signature]insert here[/signature]
Reply With Quote
  #4  
Old 06-10-2002, 06:59 PM
kevy kevy is offline
Registered User
Join Date: May 2002
Location: USA
Posts: 192
kevy is on a distinguished road
confusing but yet yes
Reply With Quote
  #5  
Old 06-10-2002, 07:18 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
attachplayertoobj is used there, no? Or is it serverside?
Reply With Quote
  #6  
Old 06-10-2002, 08:18 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
clientside
NPC Code:

//#CLIENTSIDE
if (playerenters){
this.sw=imgwidth(#f)/16;
this.sh=imgheight(#f)/16;
}

if (playerenters||timeout){
if (playerx in {x,x+this.sw-2}&&playery in {y,y+this.sw-2}){
attachplayertoobj 0,id;
drawunderplayer;
}elseif (playerattached){
playerx+=vecx(playerdir)*.5;
playery+=vecy(playerdir)*.5;
detachplayer;
drawoverplayer;
}
timeout=.05;
}


may not work, because im typing it on my laptop at school lol
im 95% sure #f is the npcs image hehe but ive not used it alot so i dont know lol

i hope it works, let me know okay?
remeber to set the image or it wont work lol
Reply With Quote
  #7  
Old 06-10-2002, 11:19 PM
azuretek23 azuretek23 is offline
Registered User
azuretek23's Avatar
Join Date: May 2002
Location: Phoenix, AZ
Posts: 516
azuretek23 is on a distinguished road
Send a message via ICQ to azuretek23 Send a message via AIM to azuretek23
you mind explainin how it works?
Reply With Quote
  #8  
Old 06-11-2002, 12:28 AM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
NPC Code:

//Easy Bridge By Warcaptain
//#CLIENTSIDE
if (playerenters){
dontblock;
this.sw=int(imgwidth(#f)/16); //converts the width to tile
this.sh=int(imgheight(#f)/16); //converts the heightto tile
}

if (playerenters||timeout){
//checks if player is in range to be on the bridge
if (playerx in |x,x+this.sw-2.75|&&playery in |y-2,y+this.sw-2|){
attachplayertoobj 0,id;
drawunderplayer;
}elseif (playerattached){
playerx+=vecx(playerdir)*.5; //makes sure player gets off
playery+=vecy(playerdir)*.5; //makes sure player gets off
detachplayer;
drawoverplayer;
}
timeout=.05;
}


there, easy bridge by warcaptain :-)
all you need to do, is add setshape2 blah

and this isnt really a bridge, you can work the special walk under script from here
its more a walk on script
Reply With Quote
  #9  
Old 06-11-2002, 01:08 AM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
LOL. Shouldn't this be an NPC Server question? I'd say make 3 images. One of both of the sides, and one of the middle. For the sides:
NPC Code:

//#CLIENTSIDE
if (playertouchsme)
timeout=0.1;
if (timeout)
{ set underbridge;
sleep 0.11;
unset underbridge;}



for the bridge itself:
NPC Code:

//#CLIENTSIDE
if (playertouchsme&&underbridge)
{ drawoverplayer;
dontblock;}
if (playertouchsme&&!underbridge)
{ drawoverplayer;
dontblock;}



Seems slightly simpler and not as much of a hassle, but your call, he he.
---Shifter
__________________
Who has time for life these days?
Reply With Quote
  #10  
Old 06-11-2002, 02:18 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
You don't need an NPCs server =_=
Any I REALLY wish you guys wouldn't post entire scripts!!
I hope kaimetsu deletes your posts or atleast edits out the scripts. =-=

Also shifter, I have no clue what passed your mind, Bridges are done with attachplayertoobj and setshape2. Although you can do it other ways, its just a lot more practical to do it RIGHT way, your confusing him.

As for you others. try to HELP THE PERSON. Not hand it to them on a silver plater and say "Here! Ask me fore some more scripts so you never have to learn yourself!"

"You're asking me to take my time and resources to give you something in exchange for nothing. Further, this would be a slippery slope that would undoubtedly lead to yourself and others asking for the same in the future." - Thus sayith the Gord
__________________

subliminal message: 1+1=3
Reply With Quote
  #11  
Old 06-13-2002, 11:36 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally posted by Projectshifter
LOL. Shouldn't this be an NPC Server question? I'd say make 3 images. One of both of the sides, and one of the middle. For the sides:
NPC Code:

//#CLIENTSIDE
if (playertouchsme)
timeout=0.1;
if (timeout)
{ set underbridge;
sleep 0.11;
unset underbridge;}



for the bridge itself:
NPC Code:

//#CLIENTSIDE
if (playertouchsme&&underbridge)
{ drawoverplayer;
dontblock;}
if (playertouchsme&&!underbridge)
{ drawoverplayer;
dontblock;}



Seems slightly simpler and not as much of a hassle, but your call, he he.
---Shifter
1.) Notice he said CLIENTSIDED
2.) eww, flags, use a string
Reply With Quote
  #12  
Old 06-13-2002, 12:47 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by azuretek23
you mind explainin how it works?
YAY! If more people asked this question, or were at all interested in learning rather than getting things scripted for them I wouldn't bash my head into walls in my sleep.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #13  
Old 06-16-2002, 05:24 AM
haunter haunter is offline
Registered User
haunter's Avatar
Join Date: Mar 2001
Posts: 7,989
haunter is on a distinguished road
Quote:
Originally posted by Saga2001


YAY! If more people asked this question, or were at all interested in learning rather than getting things scripted for them I wouldn't bash my head into walls in my sleep.
Would you please explain how to use setshape2 and attcplayertobj and how to combine those two commands to make a bridge? (and no, i am not asking you to make it for me) But please explain in plain english.
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 07:05 AM.


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