Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 7 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
From Noob to Pro: Amnesia Custom Story Creation Series
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#29
RE: From Noob to Pro: Amnesia Custom Story Creation Series

(01-18-2012, 02:58 AM)Statyk Wrote: And I kinda got lost a bit when you were explaining the "for" loop... I'm not sure what symbols like: ?, ::, ++, and . represent. They weren't really explained. Is there somewhere that explains simple things like such?

I was hoping the person watching would catch on to the keywords and do independent research. Researching PHP or C++ would provide you with practical information that you can take into AngelScript. Here's a quick run-through.

Ternary operator:
PHP Code: (Select All)
(condition) ? if_condition_is_true_value if_condition_is_false_value ;

// Example:
int x = (true) ? 1;
// x is now 0
= (false) ? 1;
// x is now 1 

Increment operator:
PHP Code: (Select All)
int i 0;
++
i// i is now 1

int x i++;
// x is now 1
// i is now 2

= ++i;
// x is now 3
// i is now 3 


For (loop) statement:
PHP Code: (Select All)
/**
 *   First expression can be any kind of expression,
 *     but it is practically used for variable declarations.
 *
 *   Second expression is used to check if the loop should continue,
 *     therefore an expression that would return true or false is required.
 *
 *   Third expression can be any kind of expression,
 *     but it is practically used for incrementing.
 */
for (first expression second expression third expression)
// note each expression is delimited by a semi-colon
{
    
// for statement body
    // Gets executed if second expression evaluates to true


Tutorials: From Noob to Pro
(This post was last modified: 01-18-2012, 03:34 PM by Your Computer.)
01-18-2012, 03:33 PM
Website Find


Messages In This Thread
RE: From Noob to Pro: Amnesia Custom Story Creation Series - by Your Computer - 01-18-2012, 03:33 PM



Users browsing this thread: 1 Guest(s)