Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Desperately needed script! (https://forums.graalonline.com/forums/showthread.php?t=5486)

Zayjee 06-23-2001 04:47 AM

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.

Zayjee 06-23-2001 04: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 05:08 AM

erm, if keydown()?

mystic_pheonix 06-23-2001 05:42 AM

easy.

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

AlexH 06-23-2001 06: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 07: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 08:36 AM

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 =\

LordAzeroth 06-23-2001 08:43 AM

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.

LordAzeroth 06-23-2001 08:45 AM

or you can make it uglier by doing:

x=playerx;
y=playery;

Just experiment..

grim_squeaker_x 06-23-2001 05:55 PM

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.

Yakuna2001 06-23-2001 06:29 PM

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 :D

toad1413 06-23-2001 07:20 PM

Quote:

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 12:38 AM

lol
 
that is so easey!!!!!!

Zayjee 06-24-2001 07:37 AM

Gee, thanks to no one, I got it done myself using keydown. Some help! That's about three times now I think...


All times are GMT +2. The time now is 06:45 AM.

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