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 01-26-2002, 09:10 AM
Sir Kwang Sir Kwang is offline
splave
Join Date: Jan 2002
Location: splave
Posts: 156
Sir Kwang is on a distinguished road
Send a message via ICQ to Sir Kwang Send a message via AIM to Sir Kwang
npc script

Im tryin to make a walkin npc script, where you walk like a character in southpark so far i got
NPC Code:
 if (weaponfired) 


lol
Reply With Quote
  #2  
Old 01-26-2002, 09:14 AM
Gohan43331 Gohan43331 is offline
Registered User
Join Date: Jan 2002
Posts: 87
Gohan43331 is on a distinguished road
Send a message via AIM to Gohan43331
Re: npc script

Graal2001.com -> click library -> click npc scripting

Find the script of your choice
Reply With Quote
  #3  
Old 01-26-2002, 09:38 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
make some keydowns and set the ganis to idle (by southpark do you mean not walking, just like moving w/o moving your feet?)
Reply With Quote
  #4  
Old 01-26-2002, 08:18 PM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
hmmm something like:

NPC Code:

if(playertouchsme){
toweapons Soutparkwalking;
}

if(weaponfired){
if(this.active=1){
this.active=0;
enabledefmovement;
}
else {
disabledefmovement;
this.speed = .5; //Can be changed
this.active=1;
timeout=.05;
}
}

if(timeout){
setani sp_walk,;
for(this.i=0;this.i<4;this.i++){
if(keydown(this.i)){
playerdir=this.i;
for(this.m=0;this.m < this.speed;this.m+=.05){
if(!onwall(playerx+1.5+vecx(playerdir)*1.05,player y+2+vecy(playerdir)*1.05)){
playerx+=vecx(playerdir)*.05;
playery+=vecy(playerdir)*.05;
}
}
}
}
if(this.active==1){timeout=.05;}
}




could work, not tested ^_^
__________________
No Webhost at the moment
Reply With Quote
  #5  
Old 01-27-2002, 03:02 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
Take a look at the bomy script that should help you learn
Reply With Quote
  #6  
Old 01-27-2002, 09:51 AM
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
~AlphaFlame~

I thought disabledefmovement nixed all the keys... including S... so TDO, only problem I see with yours (just looking) is the weaponfired part :-p.

Probably

if (weaponfired || timeout && keydown(4))

Would work... if 4 is D like I think it is... *pokes at it*
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #7  
Old 01-27-2002, 10:48 AM
Echos Echos is offline
Banned
Join Date: Jan 2002
Location: Somewhere in Georgia for l33t schoolings
Posts: 1,286
Echos is on a distinguished road
Send a message via ICQ to Echos Send a message via AIM to Echos Send a message via Yahoo to Echos
[Kaimetsu]

Or... you could just use replaceani...

[/Kaimetsu]
Reply With Quote
  #8  
Old 01-27-2002, 11:49 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
you could use disabledefmovement for the moving part, I'm working on something like that:
if (created)
{toweapons *Jagen Control System 1.0;
speed=.9;
setstring speed,.9;
timeout=.05;}
if (timeout)
{disabledefmovement;
timeout=.05;}
//Controling movements
if (keydown(0))
{setani walk,;
playerdir=0;
playery=playery-strtofloat(#s(speed))/10;}
if (keydown(1))
{setani walk,;
playerdir=1;
playerx=playerx-strtofloat(#s(speed))/10;}
if (keydown(2))
{setani walk,;
playerdir=2;
playery=playery+strtofloat(#s(speed))/10;}
if (keydown(3))
{setani walk,;
playerdir=3;
playerx=playerx+strtofloat(#s(speed))/10;}
I have two vars up there so when I get into NPCs that upgrade speed I could just do:
speed=strtofloat(#s(speed))+.1;

setstring speed,#v(speed);
I divided the thing by 10 because graal was reading the .9 as 9 so I had to divide =/
Reply With Quote
  #9  
Old 01-27-2002, 12:13 PM
Echos Echos is offline
Banned
Join Date: Jan 2002
Location: Somewhere in Georgia for l33t schoolings
Posts: 1,286
Echos is on a distinguished road
Send a message via ICQ to Echos Send a message via AIM to Echos Send a message via Yahoo to Echos
Quote:
Originally posted by Python523
you could use disabledefmovement for the moving part, I'm working on something like that:
if (created)
{toweapons *Jagen Control System 1.0;
speed=.9;
setstring speed,.9;
timeout=.05;}
if (timeout)
{disabledefmovement;
timeout=.05;}
//Controling movements
if (keydown(0))
{setani walk,;
playerdir=0;
playery=playery-strtofloat(#s(speed))/10;}
if (keydown(1))
{setani walk,;
playerdir=1;
playerx=playerx-strtofloat(#s(speed))/10;}
if (keydown(2))
{setani walk,;
playerdir=2;
playery=playery+strtofloat(#s(speed))/10;}
if (keydown(3))
{setani walk,;
playerdir=3;
playerx=playerx+strtofloat(#s(speed))/10;}
I have two vars up there so when I get into NPCs that upgrade speed I could just do:
speed=strtofloat(#s(speed))+.1;

setstring speed,#v(speed);
I divided the thing by 10 because graal was reading the .9 as 9 so I had to divide =/
[Kaimetsu]

So... horribly... inefficient... You could drop that to maybe 8 lines.

[/Kaimetsu]
Reply With Quote
  #10  
Old 01-27-2002, 12:59 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally posted by Echos


[Kaimetsu]

So... horribly... inefficient... You could drop that to maybe 8 lines.

[/Kaimetsu]
I knew someone was going to say that x.x
I mostly go for what works, not how short it is, I wait till I add more features till I shorten it, I'll probably work on it soon
Reply With Quote
  #11  
Old 01-27-2002, 01:06 PM
Echos Echos is offline
Banned
Join Date: Jan 2002
Location: Somewhere in Georgia for l33t schoolings
Posts: 1,286
Echos is on a distinguished road
Send a message via ICQ to Echos Send a message via AIM to Echos Send a message via Yahoo to Echos
Quote:
Originally posted by Python523

I knew someone was going to say that x.x
I mostly go for what works, not how short it is, I wait till I add more features till I shorten it, I'll probably work on it soon
[Kaimetsu]

Why not go for both? You'll learn a lot more in the process.

[/Kaimetsu]
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 06:04 AM.


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