HomeLog InSign Up

Actions

Actions are the THEN rules. Select the appropriate action in the Actions list, then drag it into the left side of a rule.

Shows the location of actions in AgentCubes

Broadcast

Sends a message to all agents of the type specified.

Parameters

Target agent

Specifies the type of agents to receive the message.

Message Name

specifies the message to be broadcast.

Broadcast action

Change

Changes a specified agent to the shape specified.

Parameters

Direction

specifies which agent (self or adjacent) to change.

Change to

specifies how to change the target agent.

Change action

Delayed-message

Will trigger a message in this agent after a specified amount of time. Messages will only be triggered in a running simulation.

Parameters

Method

Name of the message.

Time

How long the delay will last, in seconds.

Delayed-message action

Erase

Erases the agent located in the cell indicated.

Parameters

Direction

Specifies which agent, self or adjacent, to erase.

Layer

Relative layer reference: 0 = same layer, > 0 layers above, < 0 layers below.

Time

How long the delay will last, in seconds.

Erase actionErase action expanded

Finish-animations

Subject agent finishes and stops all currently active animations.

Finish-animations action

Hill-climb

Erases the agent located in the cell indicated.

Parameters

Attribute Name

Name of the attribute to set.

Option

You may choose Four Directions which will set the AI to look at the 'AttributeName's property from' left, right, up to down. Or you can set the option to look at the 'AttributeName's property 'from all 8 directions which includes all diagonal directions.

Animation

Accelerated or constant speed.

Time

movement happens instantly (if time is 0) or the slider() option connects the animation time to the slider located above the world.

Example

AgentCubes Hill-climb example

In this example the lady bug moves to the target. If you move the target anywhere in the world the lady bug will track it and move there.

Hill-Climb action

Map

Maps a specified attribute onto a visual indicator, using the gradient colors specified.

Parameters

Attribute Name

Name of the attribute to be mapped by color.

Low Value Color

Select the color for low ranges.

Low Value

A low range limit number or formula.

High Value Color

Select the color for high ranges.

High Value

A high range limit number or formula.

Map action

Message

Sends a message to self or nearby agent.

Parameters

Direction

Where to send the message.

Message

Name of the message.

Layer

Relative layer reference: 0 = same layer, > 0 layers above, < 0 layers below.

Message action

Message-In-Stack

Will send a message in other agents in the stack.

Parameters

Method

Specifies which method to send.

Agents in stack

Which agents in this agent's stack should receive the spcified message.

Message-In-Stack action

Move

Moves an agent one cell in the direction indicated.

Parameters

Direction

Specifies the direction for the agent to move.

Layer

Relative layer reference: 0 = same layer, > 0 layers above, < 0 layers below.

Animation

Move with accelerated or constant speed.

Time

If time is 0, movement happens instantly. The slider() option in the time parameter connects the animation time to the slider located above the world.

Move action

Move-random

When conditions are satisfied, this action moves an agent randomly any number of cells away from the original location as specified by a number or formula in the Formula parameter.

Parameters

Formula

Number or VAT Formula.

Animation

Move with accelerated or constant speed

Time

Movement happens instantly (if time is 0) or the slider() option connects the animation time to the slider located above the world.

Stay on Same Layer

check box constrains the random movement to the current layer; otherwise, layers may change.

Only on Empty Cells

check box only moves the agent on empty spots in the world, not piling it on any other agents in the target location.

Move-random actionMove-random action expanded

Move-random-on

Moves the subject agent randomly onto agents of type specified that are immediately adjacent. If there are no such agents, nothing happens. If there is one specified agent, the subject agent moves onto it. If more than one, the subject agent randomly selects one and moves onto it.

Parameters

Target agent

The class name of the Agent to move onto.

Animation

Move with accelerated or constant speed

Time

Movement happens instantly (if time is 0) or the slider() option connects the animation time to the slider located above the world.

Move-random-on actionMove-random-on action expanded

Move-random-on-a

When conditions are satisfied, this action moves an agent randomly on any agent class name.

Parameters

Agent class name

The type of agent to look for.

Animation

Move with accelerated or constant speed

Time

Movement happens instantly (if time is 0) or the slider() option connects the animation time to the slider located above the world.

Example

AgentCubes move-random-on-a example

In this example the lady bug agent is using move-random-on action and can only move on the red tile. However, the beaver is using the move-random-on-a action which allows the agent to move on all of the tiles shapes.

Move-random-on-a actionMove-random-on-a action expanded

New

Generates a new agent in the cell indicated with the shape selected.

Parameters

Direction

Specifies where to create a new agent.

Shape

Specifies the type of new agent.

Layer

Specifies on which layer to put the new agent.

New actionNew action expanded

Play-sound

plays specified sound.

Parameters

Sound

Selected a sound.

Play-sound action

Play-midi

Choose an instrument and a note to be played.

Parameters

Instrument

Choose an instrument that you want to hear and also choose a note from that instrument.

Pitch

Input a value for the pitch of the note.

Velocity

Is the force with which a note is played. Range from 0 to 255.

Play-midi action

Plot-agents-attribute

Plots the attribute specified for visualization.

Parameters

Attribute

The attribute to plot.

BottomRow

Lower row to start the plot. Number or VAT formula.

TopRow

Upper row to the plot. Number or VAT formula.

LeftCol

Column to start the plot. Number or VAT formula.

RightCol

Column to start the plot. Number or VAT formula Color: color to use for plotting.

Color

Color to use for plotting.

AtEleVATion

How high above the layer floor to start the plot.

Plot

Type of plot function - select linearly or algorithmically.

Agent class - on/off

Choose a pole line to show on an agent class.

Turn on or off pole line for this agent class. Default off.

Agent class - on/off

Choose a pole line to show on an agent class.

Turn on or off pole line for this agent class. Default off.

Agent class - on/off

Choose a pole line to show on an agent class.

Turn on or off pole line for this agent class. Default off.

Plot-agents-attribute actionPlot-agents-attribute action expanded

Plot-to-window

Plot an attribute to a new window in 2D.

Parameters

Attribute name

Name of the agent's attribute to plot or a VAT formula.

In window

Name of the new window.

Representing

Name of the particular line in the window for this plot (i.e. when plotting 2 values to the same window, give each line a name).

Color

Color to use for plotting.

Example

This video example shows how to use Plot-to-window by plotting healthy people, sick people and recovered people in a science simulation. Note this video uses a VAT method.

Plot-to-window action

Minimizing the graphing window will slightly increase performance.

Print

Prints text to the status line - can be used to give a message to the player.

Parameters

Text

What to print; may include agent attribute values when the name is preceded by ~ (for example: ~value) AgentCubes Desktop only (not AgentCubes online): May also include the special values: ~self.row (agent's current row), ~self.column (agent's current column), and ~self.layer (agent's current layer).

Print action

Reload-world

Reloads the world, resetting to the original state.

Parameters

Reload simulation properties check box.

Defaults to yes.

Reload-world actionReload-world action expanded

Repeat-n-times

Use a repeat loop by dragging it into the THEN part of a rule. Add actions to the repeat loop by dragging any kind of action, including repeat actions, into the inside part of the repeat loop.

For in depth information refer to the wiki.

Repeat-n-times action

Rotate-by

The Rotate by action rotates an agent by roll, pitch, and heading angles, along the x, y, and z axis respectively.

Parameters

Roll angle

Number or VAT formula.

Pitch angle

Number or VAT formula.

Heading angle

Number or VAT formula.

Time

If time is 0, movement happens instantly. The slider() option in the time parameter connects the animation time to the slider located above the world.

Rotate-by actionRotate-by action expanded

Rotate-to

The Rotate-to action rotates an agent by roll, pitch, and heading angles, along the x, y, and z axis respectively.

Parameters

Roll angle

Number or VAT formula.

Pitch angle

Number or VAT formula.

Heading angle

Number or VAT formula.

Time

If time is 0, movement happens instantly. The slider() option in the time parameter connects the animation time to the slider located above the world.

Rotate-to actionRotate-to action expanded

Run-simulation

Starts the simulation when conditions are satisfied or upon a trigger.

Run-simulation action

Say

Speaks the text that is given in the specified (or a default) voice.

Parameters

Text

what to say; may include agent attribute values when the name is preceeded by ~ (for example: ~value) may also include the special values ~self.row (agent's current row), ~self.column (agent's current column).

Voice

May specify the language voice to use when speaking.

Say action

Set

Sets the value of a specified attribute or simulation property.

Parameters

Attribute name

Name of the attribute to set.

Value

Number or VAT formula.

Set actionSet action expanded

Set-color-to

Sets the color of an agent to specified color. Can not set the color of an inflatable agent.

Parameters

Color

Color selection.

Set-color-to action

Set-rgba-color

Directly sets the RGBA values of an agent.

Parameters

Red

Number or VAT Formula for Red: 0.0 - 1.0.

Green

Number or VAT Formula for Green: 0.0 - 1.0.

Blue:

Number or VAT Formula for Blue: 0.0 - 1.0.

Alpha

Number or VAT Formula for Alpha:: 0.0 - 1.0.

Set-rgba-color action

Show-message

Shows specified message in a pop-up dialog window.

Parameters

Main text*

Main text of the dialog window, shown in bold.

Sub text*

Additonal text, shown normally.

* Both text boxes may include: agent attribute values when the name is preceeded by ~ (for example: ~value) May also include the special values: ~self.row (agent's current row), ~self.column (agent's current column), and ~self.layer (agent's current layer)

Show-message actionShow-message action expanded

Step-simulation

Steps the simulation forward a single step.

Step-simulation action

Stop-all-sounds

Silences any/all sounds playing in the simulation.

Stop-all-sounds action

Stop-simulation

Stops the simulation when conditions are satisfied or upon a trigger.

Stop-simulation action

Switch-to-birds-eye-camera

Will switch to the bird's eye camera.

Switch-to-birds-eye-camera action

Switch-to-first-person-camera

Will switch to the first person camera of the agent who triggered this action.

Switch-to-first-person-camera action

Switch-to-world

Stops the current world and loads and runs the world specified.

Parameters

World name

Name of the world to load and run.

Switch-to-world action

Teleport-to

Moves the agent to the specified row, column and layer in the world specified at the specified time.

Parameters

Row

The row where the agent will be placed.

Column

The column where the agent will be placed.

Layer

Layer to place the agent.

World

World in which to place the agent.

Animation

Constant or accelerated speed of animation.

Time

The slider() option in the time parameter connects the animation time to the slider located above the world.

Example

Click here to check out a video tutorial on the Teleport-to Action.

Teleport-to actionTeleport-to action expanded

Transport

Moves an agent one cell in the direction indicated and everything that is piled on top along with it.

Parameters

Direction

Which direction to move.

Layer

Layer to place the agent.

World

World in which to place the agent.

Animation

Constant or accelerated speed of animation.

Time

The slider() option in the time parameter connects the animation time to the slider located above the world.

Transport actionTransport action expanded

Wait

Pauses the simulation for the specified amount of time.

Parameters

Time

How long the delay will last, in seconds.

Wait action