![]() |
on-off defnpc for the ****s
Heres one for you newbie scripters who want to make
an npc that you can press D once for "on" mode, and fire again to set in "off" mode. IMPORTANT close graal Save as: graal/levels/npcs/defnpcOnOffWeapon.txt then open graal and go to Predefined npcs. Try putting for npc-action, shootarrow playerdir NPC Code: and its OK that this is on this forum becasue the script provided there does not do anything practical as it its .. its a form, a mold, for your imagination to pour into! |
its ok proz, you can post whole scripts if people didnt ask for it.
|
inefficent, just do
if(weaponfired){ this.on=abs(this.on-1); if(this.on == 1){ stuff; }else stuff; } |
thx!!!!!!
|
I'd just do simple flags
if (weaponfired&&!on) { set on; }else unset on; if (on) { whatever; } |
Quote:
|
Is that script even needed?
i made a good one b4 :D here NPC Code: Put this in your graal folder levels/npcs name it as defnpcClothes.txt |
I usually do a this.var, or if I'm in the mood, I'll use like a specific flag, not on and !on, but like qmenu and other related items.
---Shifter |
would be nice if we could do bitwise operators like this.on = ~this.on or something. we could just toggle it on and off. But then we'd probably need special binary variables or something. *shrugs*
|
Quote:
|
this.on = vecx(this.on+1)*(-1);
|
Quote:
this.on = abs(this.on-.5-.3-.2); |
i do the following for a clothes changing npc or something
this.clotheson=1; this.on=1; set clotheson; unset clotheson; etc... |
why do people use flags =/ I can honestly say I havent use a flag in at least a year, I find them 'outdated' and inefficent, strings are so much better
|
| All times are GMT +2. The time now is 03:53 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.