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 07-27-2001, 09:08 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
here is a follow code

Not the best, but something I just made quickly for the people who have been asking how to make an online follow player.

I still like the way that bomies follow (always stay behind the player)
this one just moves up/down/left/right according to the player.

Also , why is it that when I set array it doesnt work ? Am I doing something wrong or is Graal array just weird?
NPC Code:

// NPC made by LiquidIce - Buzy liek always
//Following Orb

//this sets how fast the timeout goes
this.speed=.15;

if (playertouchsme) {
toweapons Pet Orb;
}

if (weaponfired) {
//setarray orbx,7;
//setarray orby,7;
this.a=0;
while (this.a<7) {
this.a++;
orbx[this.a]=playerx+1.5-(vecx(playerdir)*2);
orby[this.a]=playery+2-(vecy(playerdir)*2);
}
timeout=this.speed;
}

if (timeout) {
follow();
movearray();
setarray();

timeout=this.speed;
}

function setarray() {
if (playerx>orbx[6]&&playerx-orbx[6]>2) {
orbx[7]=orbx[6]+.5;
}
if (playerx<orbx[6]&&orbx[6]-playerx>2) {
orbx[7]=orbx[6]-.5;
}
if (playery<orby[6]&&orby[6]-playery>2) {
orby[7]=orby[6]-.5;
}
if (playery>orby[6]&&playery-orby[6]>2) {
orby[7]=orby[6]+.5;
}
}

function follow() {
showimg 100,shadoworb.gif,orbx[1],orby[1];
}

function movearray() {
this.i=0;
while (this.i<6) {
this.i++;
this.test=this.i+1;
orbx[this.i]=orbx[this.test];
orby[this.i]=orby[this.test];
}
}

__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #2  
Old 07-27-2001, 09:25 AM
Brady2 Brady2 is offline
Registered User
Brady2's Avatar
Join Date: Mar 2001
Location: Phoenix, AZ and Wichita Falls, TX
Posts: 924
Brady2 is on a distinguished road
Jadis:

Ok why don't you use the very good one Stefan made?
Reply With Quote
  #3  
Old 07-27-2001, 09:36 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by Brady2
Jadis:

Ok why don't you use the very good one Stefan made?
Because people were asking and I think that his had some npc server only stuff in it.
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #4  
Old 07-27-2001, 09:55 AM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
Wow man thank you sooo much. I have been working over 4 hours trying to make just that and I cannot do it =\ This is vital to the script im making and I couldnt do it without it. Thanks again

BTW, does the one Stefan made work on free servers??
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #5  
Old 07-27-2001, 09:56 AM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
hmm where in that script would I add in the code so if the player faces left it shows left.png and right is right.png and so on???
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #6  
Old 07-27-2001, 11:06 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by ownerofbabylon
hmm where in that script would I add in the code so if the player faces left it shows left.png and right is right.png and so on???
showimg part.
but if you are doing it with ganis then you will not do showimg. You will change x=orbx[1] and y=orby[1]
but it doesnt have onwall and also it has a few bugs. I just make it quick like I said
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #7  
Old 07-27-2001, 12:03 PM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
yea im doing setimgpart but i meant where would i put it in that script???
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #8  
Old 07-27-2001, 02:34 PM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by ownerofbabylon
yea im doing setimgpart but i meant where would i put it in that script???
in that function..
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #9  
Old 07-27-2001, 02:46 PM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Btw, I might actually turn this into something, and since I am a nice person and I always like to post code I'll post that.
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #10  
Old 07-27-2001, 02:54 PM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
the onwall and non-p2p canwarp equivalent will be the hardest part
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #11  
Old 07-27-2001, 03:00 PM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by entravial
the onwall and non-p2p canwarp equivalent will be the hardest part
nonp2p warp doesnt really work. it will just be a player weapon that keeps showing img . it will be easy tho because all I have to do is do like a weapon fired when playerenters.

onwall is complicated yeah. I like making birdies cuz then no onwall =)
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #12  
Old 07-27-2001, 03:15 PM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
why would stefan put followplayer online and not offline?
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #13  
Old 07-27-2001, 03:16 PM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
i mean offline not online hehe
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #14  
Old 07-28-2001, 01:41 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
maybe he was going to make an online version but never did..
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #15  
Old 07-28-2001, 12:46 PM
Poogle Poogle is offline
Registered User
Poogle's Avatar
Join Date: Jun 2001
Posts: 2,471
Poogle is on a distinguished road
You always want to make worthless threds dont you?
Reply With Quote
  #16  
Old 07-28-2001, 01:44 PM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by Poogle
You always want to make worthless threds dont you?
okay dont talk
you havent said 1 smart thing yet ... and it was so worthless it actually helped someone..
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #17  
Old 07-28-2001, 01:46 PM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
I heard because A) It's tricky in multiplayer (which player does it follow? Only the leader? What happens to the second guy, is he SOL?) and B) Lamp of Salvation
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #18  
Old 07-28-2001, 01:48 PM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by Tyhm
I heard because A) It's tricky in multiplayer (which player does it follow? Only the leader? What happens to the second guy, is he SOL?) and B) Lamp of Salvation
well i just gave a buggy base.. just to get started x.x but i would make it follow by account name .. and B?!?!?!?!
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
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 01:00 PM.


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