User Tools

Site Tools


macros:control_structures

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
macros:control_structures [2017/11/24 10:33] icke_siegenmacros:control_structures [2019/02/06 21:07] (current) – external edit 127.0.0.1
Line 24: Line 24:
 This simply negates a variable, effectively turning it into its reciprocal value: if the variable 'Timecode.Enabled' is true it will be set to false, and vice versa. This simply negates a variable, effectively turning it into its reciprocal value: if the variable 'Timecode.Enabled' is true it will be set to false, and vice versa.
  
 +There are also some other syntax versions:
 +
 +<code xml>
 +<step>
 +  {
 +    if(Math.IsNotEqual(Playbacks.Editor.Times.ChaseSpeed, 0.0)) {
 +      ** Do Something **
 +    } else {
 +      ActionScript.SetProperty.Float("Playbacks.Editor.Times.ChaseSpeed", 1.0);
 +    }
 +  }
 +</step>
 +</code>
 +
 +and as of version 10, it is possible to write conditions in a more modern way:
 +
 +<code xml>
 +<step>
 +  {
 +    if(Playbacks.Editor.Times.ChaseSpeed == 0.0) {
 +       ActionScript.SetProperty.Float("Playbacks.Editor.Times.ChaseSpeed", 1.0);
 +    }
 +  }
 +</step>
 +
 +</code>
 +
 +**It appears that the else hive must not be empty. If it is empty then Titan doesn't start, and the Log Viewer complains "Compliation of action script failed:... Unexpected token '' found." ** (The typo is courtesy of the Log Viewer :-) )
 +
 +If you only need the if hive, then omit the else altogether.
 +
 +Also see an example here: [[macros:example:dummyspeedascondition|]]
  
 ~~NOCACHE~~ ~~NOCACHE~~
macros/control_structures.1511519582.txt.gz · Last modified: 2017/11/24 10:33 by icke_siegen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki