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
  #61  
Old 04-06-2007, 10:38 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by Skyld View Post
Ugh, that makes my eyes bleed. Your brackets should be inline with the block, not with the contents. You've missed out a load of brackets anyway, and you've mixed all sorts of conditional checks which are totally unrelated to each other in one line. :/ Bleugh.
I thought that was directed to me x.x
Reply With Quote
  #62  
Old 04-06-2007, 10:40 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Rapidwolve View Post
I thought that was directed to me x.x
Thread revival xD
__________________
Reply With Quote
  #63  
Old 04-07-2007, 03:55 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Chompy View Post
return NULL; is just to clear out that it is not returning to a function nor returning a value.
Null IS a value, zero actually. You could just do return; anyways.

And I think Stefan should make the compiler optimize if (var == true) since that looks nicer than if (var) which makes me think of the horrors of GS1.
__________________
Reply With Quote
  #64  
Old 04-07-2007, 04:13 AM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Except Gscipt isn't compiled it's interpreted. If it were compiled then the compiler could optimise the statement (by turning it into if (var) ) but since it's interpreted I don't think theres any way to do it.

Anyway, the difference in speed is negligible. Just use if (var == true) if it makes it easier to read.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #65  
Old 04-07-2007, 04:17 AM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Everyone has their own style of coding, and they can read it. It doesn't matter if other people can't. I style similar to Skyld's styling, mainly because I find his scripts readable and he kinda pushed me to it :P
__________________
What signature? I see no signature?
Reply With Quote
  #66  
Old 04-07-2007, 04:35 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
GScript is not interpreted, its Compiled when you save the script. Thats how scripts are sent to the client Pre-Compiled like Stefan said. Unless Stefan has a different definition of Compiled.
__________________
Reply With Quote
  #67  
Old 04-07-2007, 05:49 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
I think they are optimised a bit and compiled into byte code.
Reply With Quote
  #68  
Old 04-07-2007, 02:14 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Its compiled into byte code, because they're all stored on your computer if you look closely enough.

Every time you add yourself a weapon, that compiled code goes directly into your computer, probably to lessen the load on the server.
__________________
What signature? I see no signature?
Reply With Quote
  #69  
Old 04-07-2007, 04:32 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
if (var) always reminded me of GS1 ... I still have nightmares about that.
__________________
Reply With Quote
  #70  
Old 04-07-2007, 09:27 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
PHP Code:
if (playerchats) {
  
tokenize #c;
  
if (strequals(#t(0),kill:)) {
    
with (getplayer(#t(1))) {
      
playerhearts 0;
    }
  }

__________________
Reply With Quote
  #71  
Old 04-07-2007, 10:09 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Quote:
Originally Posted by Inverness View Post
GScript is not interpreted, its Compiled when you save the script. Thats how scripts are sent to the client Pre-Compiled like Stefan said. Unless Stefan has a different definition of Compiled.
I stand corrected. I always thought it was just interpreted.

The compiler could potentially optimise the code then.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #72  
Old 04-07-2007, 10:42 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by JkWhoSaysNi View Post
I stand corrected. I always thought it was just interpreted.

The compiler could potentially optimise the code then.
Scripts are folded when they are compiled so that they are more efficient.
__________________
Skyld
Reply With Quote
  #73  
Old 04-08-2007, 04:42 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
I would find it annoying if I wrote

PHP Code:
if ( var == 
and it changed it to
PHP Code:
if ( var == true 
__________________
Reply With Quote
  #74  
Old 04-08-2007, 04:48 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Usually the ammount of styling and the importance of a scripter's styling to himself usually reflects his skill with Graal coding.

Pretty hard to do complex scripts if you have horrible spacing
__________________
Do it with a DON!
Reply With Quote
  #75  
Old 04-08-2007, 05:02 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by zokemon View Post
Usually the ammount of styling and the importance of a scripter's styling to himself usually reflects his skill with Graal coding.

Pretty hard to do complex scripts if you have horrible spacing
Irrelevant if your typing speed is excellent.
__________________
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 02:25 AM.


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