You can add an expression to an attribute. Atoms uses C++ as an expression language.
Note |
---|
Only the Windows platform support attribute expressions! |
On a expression, you have three variable as input that you can use to access various data:
...
Create an agent group and add a grid layout and a state machine modulecomponent.
Press on the randomize button net next to the state attribute until you activate the expression mode.
Now press the “open editor” button to open the expression editor.
Add the expression like in the picture below and press save.
...
If you press play, the agent switches its state to 1 when the frame is higher then 20.
...
Code Block | ||
---|---|---|
| ||
if (agent.getIntMetadata("myMeta") == 1 && agentGroup.time() > 20) { output = 1; } else { output = defaultValue; } |
Packaging
When you use expressions and you want to package your project you need to add the AtomsJIT folder to folder copy list inside the project settings.
...