Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 09-22-2011, 06:07 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by oralgnome View Post
How so, it does the same thing - right?
It uses a single event to detect change in text rather than a hack to detect it which simplifies the code significantly and is much easier to read and understand.

Quote:
Originally Posted by gaben View Post
Regardless, this.bool = !this.bool is a unique way of performing toggling and I can see how one would perceive it as somewhat 'better'. Though, in the end, the one that ends up playing second fiddle is the one that attempts to distinguish oneself' in the face of others.
That is irrelevant in my reasoning as to why I think it's 'better'. I would have considered writing the "toggle" like this since it's easier for new scripters to understand:

PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
  if (
this.on) {
    
this.on false;
    
player.chat "Typewriter off!";
  } else {
    
this.on true;
    
player.chat "Typewriter on!";
  }

__________________
Quote:
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:58 PM.


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