PDA

View Full Version : Online followplayer


Metal-Slug
06-25-2001, 09:27 AM
how i make a non-showcharacter like npc follow the player ONLINE

LilNiglet
06-25-2001, 09:46 AM
i think you need a npc-server for that, yah u do
and i PMd u my hed #'s here it is again just in case 857 and 534
couldnt u just use

timeout = .05;
if (timeout){
x = playerx - 1;
y = playery;
timeout = .05;
}

but taht may lag a LOT

vergil
06-25-2001, 09:55 AM
Once again this is an opportunity where arguments would be useful, if they were..


function checkd(x,y) {
if (count<51) {
if (onwall(x,y)) {
count++;
if (playerdir == 0) { checkd(x,y+.1); }
if (playerdir == 1) { checkd(x-.1,y); }
if (playerdir == 2) { checkd(x,y-.1); }
if (playerdir == 3) { checkd(x+.1,y); }
}
else {
showimg 1,myimage,x,y;
}
}
}

if (created) {
myimage = "followingthing.gif";
}
if (playertouchesme) {
// Start following
timeout = .1;
this.follow = 1;
}
if (timeout) {
if (this.follow = 1) {
if (playerdir == 0) { checkd(x+1.5,y+4)) }
if (playerdir == 1) { checkd(x+4,y-1.5)) }
if (playerdir == 2) { checkd(x+1.5,y-4)) }
if (playerdir == 3) { checkd(x-4,y-1.5)) }
}
timeout=.1;
}


Presumably this will check to see if theres a wall in its way 50 times before stopping (which probably doesn't work because I'm a bad coder) and it'll make the image follow you within 4 spaces, but it's useless because i cant define arguements with functions.

It probably wouldnt work anyway (as you can see i have 0 self esteem) if I could

Metal-Slug
06-25-2001, 09:58 AM
lol, still more suggestions!!

Komieko
06-25-2001, 10:03 AM
Do it with #F I think =/

Metal-Slug
06-25-2001, 10:59 AM
??????? how
if (created) {
#F;
}

Komieko
06-25-2001, 12:19 PM
if (playerleaves){
warpto #F,playerx,playery;
}

Metal-Slug
06-25-2001, 12:30 PM
i dont want it to follow to every level, i want it to be jsut like followplayer

General
06-25-2001, 01:00 PM
make a voodoo shroomy

Tyhm
06-26-2001, 04:05 AM
make a system NPC that creates an array of the last 8 playerx and playerys. Either write to it with a moving pointer or continually move every value down a notch. Showimg the npc at the last values of the array

LiquidIce00
06-26-2001, 08:11 AM
Originally posted by Tyhm
make a system NPC that creates an array of the last 8 playerx and playerys. Either write to it with a moving pointer or continually move every value down a notch. Showimg the npc at the last values of the array

basically what a bomy pet does.

ownerofbabylon
07-27-2001, 07:55 AM
So did anyone ever figure out how to do this right??

Silver Knight
07-27-2001, 10:32 AM
Did anyone figure out how to get you to stop spamming...

Oh, btw, Nothar owns cheeze its!