Thread: npc script
View Single Post
  #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