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-31-2001, 02:57 PM
Jerom Jerom is offline
Banned
Jerom's Avatar
Join Date: Mar 2001
Location: In a Trash Can
Posts: 3,708
Jerom is on a distinguished road
Send a message via AIM to Jerom
Unhappy NPC Baddies...

Hiyas!
Before I say anything, I'll just say, I SUCK AT SCRIPTING!!!!
ok..
Now I was trying to make a baddie that would move around randomly, and between directional switces, it would pause 1 second, then it would pick a random direction, or it would just stay still for another second again.
All I get out of this script is a bunch of MESSED UP LOOKIN' movement that makes my baddie look like it took some crack cocaine right after running around firepole for at LEAST 7 years straight. I also would like if someone could tell me how to make it so that when the baddie wasn't walking, it would change to idle.gani.
If you are thinking of just re-creating the script(because my work SUCKS), please make it long and drawn out so that us newbie scripters can understand what the script is doing. - thanks
---
//Script made by Jerom
//Isawk@scriptin'
if (created && playerenters) {
dontblock;
drawoverplayer;
timeout = 0.05;
this.speed = 0.09;
setarray move,4;
}

if (timeout && this.stop==0){
this.mmode = random(0,50);
timeout = 0.05;
}
if (this.mmode<=10 && timeout){
move[3] = 1;
this.stop = 1;}
if (move[3]==1 && timeout){
x+=this.speed;
move[4] = random(0,50);
this.stop = 1;}
if (this.mmode>10 && this.mmode<20 && timeout) {
move[2] = 1;}
if (move[2]==1 && timeout){
y+=this.speed;
move[4] = random(0,50);
this.stop = 1;}
if (this.mmode>20 && this.mmode<30 && timeout){
move[1] = 1;}
if (move[1]==1 && timeout){
x-=this.speed;
move[4] = random(0,50);
this.stop = 1;}
if (this.mmode>30 && this.mmode<=40 && timeout) {
move[0] = 1;
}
if (move[0]==1 && timeout){
y-=this.speed;
move[4] = random(0,50);}
if (move[4]<=10) {
move[0] = 0;
move[1] = 0;
move[2] = 0;
move[3] = 0;
this.stop = 0;
this.mmode = random(0,50);}
if (this.mmode>40 && this.mmode<50) {
sleep 1;
timeout = 0.05;}
Reply With Quote
  #2  
Old 07-31-2001, 03:46 PM
Asuka Asuka is offline
Universal Commie Dictator
Asuka's Avatar
Join Date: Mar 2001
Posts: 1,708
Asuka will become famous soon enough
Send a message via ICQ to Asuka
well to make him stop

if (move == 0){setgani idle.gani} i think i'm not sure though and i don't know the new commands and it's been a year since i've scripted something but i'm almost positive thats right but i'm bored and downloading so i'm trying to help out =)
__________________
Y'know sometimes even my lucky rocketship underpants don't even help.
Reply With Quote
  #3  
Old 08-01-2001, 03:28 AM
Guest
Posts: n/a


NPC Code:

timereverywhere;
if (created){
showcharacter;
setcharprop #n,Mace Baddy;
setcharprop #1,blankbow.gif;
setcharprop #2,blankbow.gif;
hearts=3;
hurtdx=0;
hurtdy=0;
}
if (playerenters||wasthrown){
dirgo={0,-1,-1,0,0,1,1,0};
maceangle={5,3.5,2,.5};
this.speed=.4;
this.macespeed=1.5;
this.pow=1;
this.macepow=2;
swordpower=0;
shieldpower=0;
timeout=.05;
}
if (timeout&&isleader){
if (hearts>0&&this.hit!=1&&this.attack!=1){
for (i=0;i<5;i++){
hideimg i;
}
if (sprite<8){
sprite++;
}else{
sprite=1;
}
this.distx=abs(playerx-x);
this.disty=abs(playery-y);
if (this.distx<=this.disty){
if (playery<y)dir=0;
if (playery>y)dir=2;
}else{
if (playerx<x)dir=1;
if (playerx>x)dir=3;
}
this.dist=((this.distx^2)+(this.disty^2))^.5;
if (this.dist<=8){
this.attack=1;
this.step=0;
sprite=6;
this.angle=maceangle[dir];
this.flyx = x+.5;
this.flyy = y+1.25;
if (dir==0||dir==2) this.flyx-=0.5;
if (dir==1) this.flyx+=0.5;
}
if (this.distx==0){
this.addy=this.speed;
}else if (this.disty==0){
this.addx=this.speed;
}else if (this.distx>this.disty){
this.ratio=this.disty/this.distx;
this.addx=this.speed;
this.addy=this.speed*this.ratio;
}else if (this.disty>this.distx){
this.ratio=this.distx/this.disty;
this.addy=this.speed;
this.addx=this.speed*this.ratio;
}
if (y<playery&&!onwall(x+1.5,y+3+this.addy)) y+=this.addy;
if (y>playery&&!onwall(x+1.5,y-this.addy)) y-=this.addy;
if (x<playerx&&!onwall(x+3+this.addx,y+1.5)) x+=this.addx;
if (x>playerx&&!onwall(x-this.addx,y+1.5)) x-=this.addx;
timeout=.05;
}
if (this.hit==1){
i+=.5;
if (x>playerx&&!onwall(x+3+i,y+1.5)) x+=.5;
if (x<playerx&&!onwall(x-i,y+1.5)) x-=.5;
if (y>playery&&!onwall(x+1.5,y+i)) y+=.5;
if (y<playery&&!onwall(x-1.5,y-i)) y-=.5;
if (i>=3.5){
this.hit=0;
i=0;
}
timeout=.05;
}
}
if (playertouchsme&&hearts>0){
hurt this.pow;
}
if (hearts>0&&abs((x+1.5)-(playerx+1.5))<=3 &&abs((playery+1.5)-(y+1.5))<=3) {
hurt this.pow;
}
if (this.hit!=1&&(washit||wasshot||exploded||waspelt) &&hearts>0){
if (washit){
hurtdx=x;
hurtdy=y;
hearts-=playerswordpower;
}
if (wasshot){
hearts--;
}
if (exploded){
hearts--;
}
if (waspelt){
if (peltwithbush) hearts-=.5;
if (peltwithsign || peltwithvase || peltwithstone) hearts-=1;
if (peltwithblackstone) hearts -=1.5;
}
sprite=39;
this.hit=1;
this.attack=0;
for (i=0;i<5;i++){
hideimg i;
}
timeout=.05;
}
if (timeout&&this.attack==1){
p=testplayer(this.flyx+1,this.flyy+1);
if (p>=0){
hitplayer p,this.macepow,this.flyx+1,this.flyy+1;
}
if (this.step<5){
this.flyx-=.5*(dirgo[dir*2]);
this.flyy-=.5*(dirgo[dir*2+1]);
}else if (this.step>=5&&this.step<=10){
sprite=11;
this.flyx+=dirgo[dir*2]*this.macespeed;
this.flyy+=dirgo[dir*2+1]*this.macespeed;
this.radius=(((x+.5)-this.flyx)^2+((y+1)-this.flyy)^2)^.5;
}else if (this.step>10&&this.step<=30){
this.flyx=x+cos(this.angle)*this.radius;
this.flyy=y+sin(this.angle)*this.radius;
this.angle+=.314;
}else if (this.step>30&&this.step<=36){
this.flyx-=dirgo[dir*2];
this.flyy-=dirgo[dir*2+1];
}else if (this.step>36){
this.attack=0;
sprite=0;
}
this.step++;
this.mc1x=x+.5-(.2*(x-this.flyx));
this.mc1y=y+1-(.2*(y-this.flyy));
this.mc2x=x+.5-(.4*(x-this.flyx));
this.mc2y=y+1-(.4*(y-this.flyy));
this.mc3x=x+.5-(.6*(x-this.flyx));
this.mc3y=y+1-(.6*(y-this.flyy));
this.mc4x=x+.5-(.8*(x-this.flyx));
this.mc4y=y+1-(.8*(y-this.flyy));
showimg 0,wmace.gif,this.flyx,this.flyy;
showimg 1,wmace0.gif,this.mc1x,this.mc1y;
showimg 2,wmace0.gif,this.mc2x,this.mc2y;
showimg 3,wmace0.gif,this.mc3x,this.mc3y;
showimg 4,wmace0.gif,this.mc4x,this.mc4y;
timeout=.05;
}
if (hurtdx!=0||hurtdy!=0){
sprite=39;
hurtdx=0;
hurtdy=0;
}
if (timeout&&hearts<=0&&isleader){
for (i=0;i<5;i++){
hideimg i;
}
this.attack=0;
this.step=0;
while(d<=8){
dir=(dir+3)%4;
d++;
sleep.1;
}
i = random(0,100);
if (i<10) lay greenrupee;
else if (i<15) lay bluerupee;
else if (i<30) lay heart;
sprite=40;
}


Reply With Quote
  #4  
Old 08-01-2001, 06:54 AM
Jerom Jerom is offline
Banned
Jerom's Avatar
Join Date: Mar 2001
Location: In a Trash Can
Posts: 3,708
Jerom is on a distinguished road
Send a message via AIM to Jerom
mmmmkay, now IcePick, why in the heCK did you post an entire different baddie script and not say anything about it?
Reply With Quote
  #5  
Old 08-01-2001, 08:11 AM
Guest
Posts: n/a
Quote:
Originally posted by Jerom
mmmmkay, now IcePick, why in the heCK did you post an entire different baddie script and not say anything about it?
because i felt like it....
Reply With Quote
  #6  
Old 08-01-2001, 10:21 AM
DuckyJ DuckyJ is offline
Registered User
Join Date: Jun 2001
Location: Maryland
Posts: 93
DuckyJ is on a distinguished road
Send a message via ICQ to DuckyJ Send a message via AIM to DuckyJ
WAY TO GO ICE PICK!

now I don't script baddies much I more script NPC weapons and such, so I won't help for I fear I might steer you wrong, I read every manual I can find on NPC scripting, so if you know of any than please tell me I enjoy it.
__________________
"Death is like being locked in a closet - locked away from life." - Me

"Sympathy is a Virtue, but only if your on the receiver side, otherwise, it's just another hole in your wallet." - Me

Ducky Vs The Devil
Devil:Give me your soul and I will give you anything.
Ducky:What happens when I give you my soul?
Devil:When you die you go straight to hell, no if ands or buts, but while your alive you get anything you want!
Ducky:Okay*signs soul certificate entitling the Devil to his soul*
Devil:Now whats the first thing you want?
Ducky:Too live forever.



Bill Clinton VS the Big Dubya
Bill:I get alot of *****.
Bush:I try to lower the eco-projects to keep gas in your car.
Bill:Im Democrat and I hate Doctors.
Bush:Im Republican and my daughter drinks alcohol and Im Proud of it!
Bill:Atleast I get some.
Bush:Look who won the election, then look at who almost got Impeached!
Bill:Whats Impeached? A Peach that was Imed?
Bush: Democraps...oops, did I just say that?
Bush:Monicas a fat pig.
Bill:SHES ONLY 200 POUNDS!
visit my LiveJournal
Reply With Quote
  #7  
Old 08-01-2001, 03:44 PM
Slaktmaster Slaktmaster is offline
man with the mastahplan
Slaktmaster's Avatar
Join Date: Apr 2001
Location: Half-way over the river styx
Posts: 4,422
Slaktmaster is an unknown quantity at this point
Send a message via ICQ to Slaktmaster Send a message via AIM to Slaktmaster
Way to go Ice Pick?
That is the Mace Baddy made my Ace long ago, it could be found on his NPC baddy programming page. I really hope Ice Pickle din't try to take the credit for it...
Reply With Quote
  #8  
Old 08-02-2001, 10:33 AM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
I think XDaKreepX made that.
Hmmm... It it just me or is Ice Pick the new Antago?
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
Reply With Quote
  #9  
Old 08-02-2001, 10:35 AM
Knightoffrost Knightoffrost is offline
and Delph Inc.
Knightoffrost's Avatar
Join Date: Jul 2001
Location: Canada
Posts: 1,162
Knightoffrost is on a distinguished road
Send a message via ICQ to Knightoffrost Send a message via AIM to Knightoffrost Send a message via Yahoo to Knightoffrost
Quote:
Originally posted by Jerom
mmmmkay, now IcePick, why in the heCK did you post an entire different baddie script and not say anything about it?
Because he didnt know how to make it becuase he didnt make it. He just took out credits that belong to other people. He has no comment on it because he doesnt know how anything works.
__________________
Xerphier Dintch
Featuring
Reply With Quote
  #10  
Old 08-02-2001, 12:56 PM
Jerom Jerom is offline
Banned
Jerom's Avatar
Join Date: Mar 2001
Location: In a Trash Can
Posts: 3,708
Jerom is on a distinguished road
Send a message via AIM to Jerom
Quote:
Originally posted by Knightoffrost


Because he didnt know how to make it becuase he didnt make it. He just took out credits that belong to other people. He has no comment on it because he doesnt know how anything works.
Word Knightoffrost.

IcePick made a post which meant nothing other than he was posting a script...no explanation, no words other than just the script...which meant no HELP, nor guidance toward helping newbie scripters.
I would also like to add that IcePick was so stupid, that he forgot to change the image coords for the NW bunny when he took credit for it and nammed it something else...He didn't change the name of the variables or anything, just changed the image names.
In this situation, NewWorld should locate IcePick's home, travel to his home, slaughter all of whats left of his so called family, then hang IcePick in the town square for everyone to see what a stupid person he is for stealing a NewWorld script. Oh, and it would be cool if we could burn his house down on Delteria right before we send 5 teams of nukers onto Delteria to get rid of that POSER of a server, once and for all.

"When the hare and the turtle met after the race, the rabbit was kidnapped by IcePick and placed in a swimming event, which later the rabbit drowned because rabbits do not belong in water. Meanwhile the turtle left to go cash in his first place prize winnings on two hookers from Classic."
Reply With Quote
  #11  
Old 08-02-2001, 01:22 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
IcePick has lately been trying to show off his super npc scripting skills by copying other ppl's npc scripts. soon he will start posting bomy script and say he made it but hes gonna use his l337 find and replace skills to change all words in the script that say "bomy" to "gomy"
__________________
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 08-02-2001, 02:45 PM
Guest
Posts: n/a
Quote:
Originally posted by Slaktmaster
Way to go Ice Pick?
That is the Mace Baddy made my Ace long ago, it could be found on his NPC baddy programming page. I really hope Ice Pickle din't try to take the credit for it...
Ace did make that, I didnt... If i cloud make something like that, that will be awesome!
Reply With Quote
  #13  
Old 08-02-2001, 11:13 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 IcePick_2001

Ace did make that, I didnt... If i cloud make something like that, that will be awesome!
that will be the day hell freezes over
__________________
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 07:55 PM.


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