![]() |
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 |
Re: npc script
|
make some keydowns and set the ganis to idle (by southpark do you mean not walking, just like moving w/o moving your feet?)
|
hmmm something like:
NPC Code: could work, not tested ^_^ |
Take a look at the bomy script that should help you learn
|
~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* |
[Kaimetsu]
Or... you could just use replaceani... [/Kaimetsu] |
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 =/ |
Quote:
So... horribly... inefficient... You could drop that to maybe 8 lines. [/Kaimetsu] |
Quote:
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 |
Quote:
Why not go for both? You'll learn a lot more in the process. [/Kaimetsu] |
| All times are GMT +2. The time now is 01:01 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.