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 03-28-2006, 08:42 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally Posted by napo_p2p
But this.active = 1 - this.active; is, like, more sekc.

BUT this.active = !this.active; is the sekciest of them all! <3 GS2.
But modulus allows you to have more than 2 switch modes.
i.e.
NPC Code:

this.switch = (this.active + 1) % 3; // <-- 3 switches!
this.switch = (this.active + 1) % 4; // <-- or 4!



Quote:
Originally Posted by Projectshifter
Wow, maybe I am getting old :O I'm going to stop getting on my computer for the first 10 minutes after I wake up. Somehow the use of % totally slipped my mind. Good call though. I'm going to spend this week brushing up on gscript again.
You better! :O It's about time we started on N-Pulse: Improved!
__________________
Reply With Quote
  #2  
Old 03-30-2006, 04:05 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by ZeLpH_MyStiK
But modulus allows you to have more than 2 switch modes.
i.e.
NPC Code:

this.switch = (this.active + 1) % 3; // <-- 3 switches!
this.switch = (this.active + 1) % 4; // <-- or 4!

But negating the value of a boolean only allows you to have two modes, so I don't know why you're preaching modulus!
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
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 AM.


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