Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-23-2001, 04:47 AM
Zayjee Zayjee is offline
Registered User
Join Date: May 2001
Posts: 50
Zayjee is on a distinguished road
Unhappy Desperately needed script!

Ok, I've been on the phone for about an hour and a half trying to figure out how to make a certain script. What we need is a script that, when the player x (or y) is increased or decreased, the NPC's x (or y) is increased or decreased. If anyone is interested, I'll post out current script to see if anyone can fix it.
__________________
-(v)4fu|<13
Reply With Quote
  #2  
Old 06-23-2001, 04:48 AM
Zayjee Zayjee is offline
Registered User
Join Date: May 2001
Posts: 50
Zayjee is on a distinguished road
Forgot to mention a couple of things:
1. I was on the phone with a friend trying to make the script he was helping me)
2. What we have so far is an NPC that takes a step, but keeps going and we can't get it to stop due to timeout.
__________________
-(v)4fu|<13
Reply With Quote
  #3  
Old 06-23-2001, 05:08 AM
General General is offline
Banned
Join Date: Apr 2001
Location: Station Square
Posts: 984
General is on a distinguished road
Send a message via ICQ to General Send a message via AIM to General Send a message via Yahoo to General
erm, if keydown()?
Reply With Quote
  #4  
Old 06-23-2001, 05:42 AM
mystic_pheonix mystic_pheonix is offline
Registered User
Join Date: Mar 2001
Location: Dunno
Posts: 123
mystic_pheonix is on a distinguished road
Send a message via AIM to mystic_pheonix Send a message via Yahoo to mystic_pheonix
easy.

do you want the npc where the player is or...?
__________________
Justin
Reply With Quote
  #5  
Old 06-23-2001, 06:24 AM
AlexH AlexH is offline
Have A Drink On Me
AlexH's Avatar
Join Date: Jun 2001
Location: Somewhere In Time
Posts: 7,442
AlexH is on a distinguished road
Send a message via AIM to AlexH Send a message via MSN to AlexH
ack
not again
n00bs asking for scripts
heres what to do

a) learn to script
b) start with very simple scripts
c) move on to more complicated scripts
d) only ask for help when ppl recognise you as a good scripter
__________________
QUICK LOOK BUSY JESUS IS COMING!
Reply With Quote
  #6  
Old 06-23-2001, 07:32 AM
Zayjee Zayjee is offline
Registered User
Join Date: May 2001
Posts: 50
Zayjee is on a distinguished road
*cracks nuckles*. Alright. I believe this forum is to ask questions. NOT TO BE DISSED BY STUPID N00BS!! You need help with certain things, I need help with certain things. If you think I'm such a n00b, why don't YOU try to script the NPC I'm talking about??
__________________
-(v)4fu|<13
Reply With Quote
  #7  
Old 06-23-2001, 08:36 AM
MoonAngel MoonAngel is offline
Banned
MoonAngel's Avatar
Join Date: Mar 2001
Location: QUÉBEC!
Posts: 1,443
MoonAngel is on a distinguished road
Send a message via ICQ to MoonAngel Send a message via AIM to MoonAngel
Quote:
Originally posted by AlexH
ack
not again
n00bs asking for scripts
heres what to do

a) learn to script
b) start with very simple scripts
c) move on to more complicated scripts
d) only ask for help when ppl recognise you as a good scripter
i am in the middle of c.. well.. im more like at the start of like 25% through c =\
Reply With Quote
  #8  
Old 06-23-2001, 08:43 AM
LordAzeroth LordAzeroth is offline
Registered User
LordAzeroth's Avatar
Join Date: Apr 2001
Location: Canada
Posts: 1,010
LordAzeroth will become famous soon enough
Send a message via ICQ to LordAzeroth Send a message via AIM to LordAzeroth
Quote:
Originally posted by Zayjee
*cracks nuckles*. Alright. I believe this forum is to ask questions. NOT TO BE DISSED BY STUPID N00BS!! You need help with certain things, I need help with certain things. If you think I'm such a n00b, why don't YOU try to script the NPC I'm talking about??
You're a newbie.

timeout=.05;

if (timeout)
{
if (y > playery)
y-=.3;
if (y < playery)
y+=.3;
if (x > playerx)
x-=.3;
if (x < playerx)
x+=.3;
}


There it follows the player, just paste that in an npc.
__________________

F U, join now.
Reply With Quote
  #9  
Old 06-23-2001, 08:45 AM
LordAzeroth LordAzeroth is offline
Registered User
LordAzeroth's Avatar
Join Date: Apr 2001
Location: Canada
Posts: 1,010
LordAzeroth will become famous soon enough
Send a message via ICQ to LordAzeroth Send a message via AIM to LordAzeroth
or you can make it uglier by doing:

x=playerx;
y=playery;

Just experiment..
__________________

F U, join now.
Reply With Quote
  #10  
Old 06-23-2001, 05:55 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x is on a distinguished road
Or if you want the NPC to move on player position dependance and some other things:
NPC Code:
if (created) {
this.x=x;
this.y=y;
this.enterx=32;
this.entery=32;
}
if (playerenters||timeout) {
if (isleader) {
this.xdif=(playerx-this.enterx)+playerx;
this.ydif=(playery-this.entery)+playery;
}
x=this.x+this.xdif;
y=this.y+this.ydif;
timeout=0.05;
timereverywhere;
}


And I probably made some really stupid mistakes in the above script.
__________________

Reply With Quote
  #11  
Old 06-23-2001, 06:29 PM
Yakuna2001 Yakuna2001 is offline
Registered User
Yakuna2001's Avatar
Join Date: Jun 2001
Location: England U.K
Posts: 940
Yakuna2001 is on a distinguished road
Send a message via AIM to Yakuna2001
Quote:
Originally posted by grim_squeaker_x
Or if you want the NPC to move on player position dependance and some other things:
NPC Code:
if (created) {
this.x=x;
this.y=y;
this.enterx=32;
this.entery=32;
}
if (playerenters||timeout) {
if (isleader) {
this.xdif=(playerx-this.enterx)+playerx;
this.ydif=(playery-this.entery)+playery;
}
x=this.x+this.xdif;
y=this.y+this.ydif;
timeout=0.05;
timereverywhere;
}


And I probably made some really stupid mistakes in the above script.
hmm, it seems you know your stuff lady midnight.
im impressed with your scripting skills
__________________

-Manager of the UnholyNation PlayerWorld-
UnholyNation Forums
Reply With Quote
  #12  
Old 06-23-2001, 07:20 PM
toad1413 toad1413 is offline
[email protected]:~$ ./Oldbie
Join Date: May 2001
Location: Aust.
Posts: 3,819
toad1413 is on a distinguished road
Send a message via ICQ to toad1413
Quote:
Originally posted by Yakuna2001

hmm, it seems you know your stuff lady midnight.
im impressed with your scripting skills
So am I. You really taught me how to do the setcoloreffect stuff. Thanks
__________________
Creator of the original 'spam' icon. Worst mistake I ever made on these forums.
Reply With Quote
  #13  
Old 06-24-2001, 12:38 AM
Termina_GP7 Termina_GP7 is offline
Registered User
Join Date: May 2001
Posts: 155
Termina_GP7 is on a distinguished road
Cool lol

that is so easey!!!!!!
__________________

-= Rice Was Here -=
Reply With Quote
  #14  
Old 06-24-2001, 07:37 AM
Zayjee Zayjee is offline
Registered User
Join Date: May 2001
Posts: 50
Zayjee is on a distinguished road
Angry

Gee, thanks to no one, I got it done myself using keydown. Some help! That's about three times now I think...
__________________
-(v)4fu|<13
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 01:33 PM.


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