Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 12-15-2011, 10:20 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Quote:
Originally Posted by BlueMelon View Post
Yea it was a little rude, but when people comment on my programming I get iffy.

I've programming in C++ and python for over 3 years, I know what I'm talking about.

I am also well capable of "styling" my code and finding errors on my own its just that there is no GScript doc excepting Graal Bible and Wiki, but even those don't have every single function you can use.

I appreciate the help I got, no further replys should be made.
Python and C++ aren't the same as GS2 and different programming languages have different coding methods. If you've been coding for "3 years" you should know that.
__________________
Reply With Quote
  #17  
Old 12-15-2011, 11:09 PM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Quote:
Originally Posted by Emera View Post
Python and C++ aren't the same as GS2 and different programming languages have different coding methods. If you've been coding for "3 years" you should know that.
GScript is like a fusion of Java and C++. Event based with OOP.

There is no "correct" method, its all in the logic you use. If you can read it clearly, and it makes sense to others, there is no need to say "YOUR MISSING A SPACE HERE, OH AND HERE TO.".
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #18  
Old 12-15-2011, 11:22 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
Quote:
Originally Posted by BlueMelon View Post
If you can read it clearly, and it makes sense to others, there is no need to say "YOUR MISSING A SPACE HERE, OH AND HERE TO.".
Yes, there is. Consistency is important.
__________________
Reply With Quote
  #19  
Old 12-15-2011, 11:22 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by BlueMelon View Post
There is no "correct" method, its all in the logic you use. If you can read it clearly, and it makes sense to others, there is no need to say "YOUR MISSING A SPACE HERE, OH AND HERE TO.".
If you ever work in industry or contribute to an open source project, you'll quickly learn that this is generally not true.

e: by seconds!!!
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #20  
Old 12-15-2011, 11:33 PM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Quote:
Originally Posted by cbk1994 View Post
Yes, there is. Consistency is important.

if(bool){
and
if ( bool ) {

So your saying one is better then the other?

Both are the same and are easily readable.
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #21  
Old 12-15-2011, 11:54 PM
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
I just said it twice and made it bold because your post (before you edited it) wasn't styled all the way through.
__________________
Quote:
Reply With Quote
  #22  
Old 12-16-2011, 02:10 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
Quote:
Originally Posted by BlueMelon View Post
if(bool){
and
if ( bool ) {

So your saying one is better then the other?

Both are the same and are easily readable.
The first is better because it's consistent with the vast majority of the GScript community (if there was a space after 'if' and ')'). The second is acceptable, however, as long as every other script on the server follows the same formatting rules for consistency. The only thing worse than bad styling is bad and good styling in the same script.
__________________
Reply With Quote
  #23  
Old 12-16-2011, 02:44 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by BlueMelon View Post
The confirmation box does popup and it does hide when I click yes or no, but it wont return a value, If I take off the hide() then it does return the value...
You can do:

PHP Code:
  // snip
  
while (!waitfor(this.name"AnsweredDialog"));
  return 
params[0];
}

function 
onReplied(obj) {
  
ConfirmationBox.hide();
  
this.trigger("AnsweredDialog"obj.text == "Yes"true false);

__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #24  
Old 12-16-2011, 06:58 AM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Quote:
Originally Posted by Tolnaftate2004 View Post
You can do:

PHP Code:
  // snip
  
while (!waitfor(this.name"AnsweredDialog"));
  return 
params[0];
}

function 
onReplied(obj) {
  
ConfirmationBox.hide();
  
this.trigger("AnsweredDialog"obj.text == "Yes"true false);

This has already been said, but thank you.

Questions are answered, thanks everyone.
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #25  
Old 12-16-2011, 09:42 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by BlueMelon View Post
This has already been said, but thank you.

Questions are answered, thanks everyone.
Actually, to add to that, the use of ternary operator in your code is redundant.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #26  
Old 12-16-2011, 09:02 PM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Quote:
Originally Posted by Tolnaftate2004 View Post
Actually, to add to that, the use of ternary operator in your code is redundant.
Please tell me where they are redundant so I can try and improve on that.
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #27  
Old 12-16-2011, 09:05 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by BlueMelon View Post
Please tell me where they are redundant so I can try and improve on that.
PHP Code:
 x == true false 
is better expressed as simply
PHP Code:
 x == 
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
Reply

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 01:04 AM.


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