Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

image-20241014-121607.pngImage Removedimage-20241018-144839.pngImage Added

Press on the randomize button net next to the state attribute until you activate the expression mode.

image-20241014-121709.pngImage Removedimage-20241018-144906.pngImage Added

Now press the “open editor” image-20241018-144927.pngImage Added button to open the expression editor.

Add the expression like in the picture below and press save.

...

image-20241018-145036.pngImage Added

If you press play, the agent switches its state to 1 when the frame is higher then 20.

...

Code Block
languagecpp
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.

...