PDA

View Full Version : Desperately needed script!


Zayjee
06-23-2001, 05:47 AM
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.

Zayjee
06-23-2001, 05:48 AM
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.

General
06-23-2001, 06:08 AM
erm, if keydown()?

mystic_pheonix
06-23-2001, 06:42 AM
easy.

do you want the npc where the player is or...?

AlexH
06-23-2001, 07:24 AM
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

Zayjee
06-23-2001, 08:32 AM
*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??

MoonAngel
06-23-2001, 09:36 AM
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 =\

LordAzeroth
06-23-2001, 09:43 AM
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.

LordAzeroth
06-23-2001, 09:45 AM
or you can make it uglier by doing:

x=playerx;
y=playery;

Just experiment..

grim_squeaker_x
06-23-2001, 06:55 PM
Or if you want the NPC to move on player position dependance and some other things:
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.

Yakuna2001
06-23-2001, 07:29 PM
Originally posted by grim_squeaker_x
Or if you want the NPC to move on player position dependance and some other things:
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 :D

toad1413
06-23-2001, 08:20 PM
Originally posted by Yakuna2001

hmm, it seems you know your stuff lady midnight.
im impressed with your scripting skills :D

So am I. You really taught me how to do the setcoloreffect stuff. :D :D Thanks

Termina_GP7
06-24-2001, 01:38 AM
that is so easey!!!!!!

Zayjee
06-24-2001, 08:37 AM
Gee, thanks to no one, I got it done myself using keydown. Some help! That's about three times now I think...