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 05-26-2001, 12:21 PM
Bravo_NPC-Admin1 Bravo_NPC-Admin1 is offline
Registered User
Join Date: May 2001
Location: Olympia, Washington USA
Posts: 25
Bravo_NPC-Admin1 is on a distinguished road
Send a message via AIM to Bravo_NPC-Admin1 Send a message via Yahoo to Bravo_NPC-Admin1
: and ?

Can someone tell me what the commands : and ? do? I have seen them in codes and they aren't documented (pretty sure).
Here is an example from a code I have:

this.speed = (this.size==1? 1 : this.size==2? 1.2: 1.5);

Thanks a bunch
__________________
-Boco
Reply With Quote
  #2  
Old 05-26-2001, 01:25 PM
WhoopA WhoopA is offline
Registered User
Join Date: May 2001
Location: Wherever I may roam
Posts: 86
WhoopA is on a distinguished road
?: is a C construct similar to the if statement. Graal doesn't support it as far as I know. Syntax is thus:

(condition) ? (true-statement) : (false-statement)

The ?: construct is more compact than the if statements. That code snippet you have there? I'll expand it into if's.

if (this.size == 1) {
this.speed = 1;
} else if (this.size == 2) {
this.speed = 1.2;
} else {
this.speed = 1.5;
}

__________________
WhoopA, the Official Kicker of Butts

--- No images. No clutter. Just pure, simple text.
"Thank you, thank you. Please, ladies, put your clothes back on... Not you Samus..." - Link from the BOTVGH
Everywhere I look, I see rabbits. Maybe I should take down all my Sailor Moon stuff.
Reply With Quote
  #3  
Old 05-27-2001, 03:48 AM
Bravo_NPC-Admin1 Bravo_NPC-Admin1 is offline
Registered User
Join Date: May 2001
Location: Olympia, Washington USA
Posts: 25
Bravo_NPC-Admin1 is on a distinguished road
Send a message via AIM to Bravo_NPC-Admin1 Send a message via Yahoo to Bravo_NPC-Admin1
Thanks! ^_^
__________________
-Boco
Reply With Quote
  #4  
Old 05-27-2001, 04:24 AM
Er1c Er1c is offline
Registered User
Er1c's Avatar
Join Date: Mar 2001
Location: Chicago, IL
Posts: 791
Er1c is on a distinguished road
? and : are supported by graal.
__________________
Eric Kraft
Reply With Quote
  #5  
Old 05-27-2001, 08:39 AM
WhoopA WhoopA is offline
Registered User
Join Date: May 2001
Location: Wherever I may roam
Posts: 86
WhoopA is on a distinguished road
Well, I'll be [danned].
__________________
WhoopA, the Official Kicker of Butts

--- No images. No clutter. Just pure, simple text.
"Thank you, thank you. Please, ladies, put your clothes back on... Not you Samus..." - Link from the BOTVGH
Everywhere I look, I see rabbits. Maybe I should take down all my Sailor Moon stuff.
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:17 PM.


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