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
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#30
RE: From Noob to Pro: Amnesia Custom Story Creation Series

(01-18-2012, 03:33 PM)Your Computer Wrote:
(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

I apologize for asking... I really do like to learn on my own and study other scripts and such... I understand SOME, but things such as the symbols were confusing me. I do appreciate you taking time to help, I know it must be frustrating having people ask stupid questions like that...

If it helps to know, I DID do some research in my digital imaging class (whoops) and lead myself to the original angelscript website, but I could only understand so much..

Anyway, Thank you, I'll try to experiment and compare other scripts, such as Palistov's, as doing so has lead me to what I know so far.
(This post was last modified: 01-19-2012, 03:03 AM by Statyk.)
01-19-2012, 03:03 AM
Find


Messages In This Thread
RE: From Noob to Pro: Amnesia Custom Story Creation Series - by Statyk - 01-19-2012, 03:03 AM



Users browsing this thread: 1 Guest(s)