Skip to content

Commit

Permalink
Update modifying-agent-variables.rst
Browse files Browse the repository at this point in the history
C++ -> agent python statement
  • Loading branch information
LangLEvoI authored and Robadob committed Oct 7, 2023
1 parent 931fc79 commit 9ef8afb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/guide/agent-functions/modifying-agent-variables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ Within Python agent functions array lengths can be be specified by appending ``A
def ExampleFn(message_in: pyflamegpu.MessageNone, message_out: pyflamegpu.MessageNone):
# Return agent variable 'location[1]' and store it in local variable 'y'
# The length of the array must be appended to the name of the type instantiated getVariable function, in this example the array has a length of 3
y = pyflamegpu.getVariableIntArray3("location", 1);
y = pyflamegpu.getVariableIntArray3("location", 1)

# Update the local copy
y+=1;
y+=1

# Store the updated local copy in the agent's 'location[1]' variable
FLAMEGPU->setVariableIntArray3("location", 1, y);
pyflamegpu.setVariableIntArray3("location", 1, y)

# Other behaviour code
...
Expand Down Expand Up @@ -126,4 +126,4 @@ Related Links
-------------

* User Guide Page: :ref:`Defining Agents<defining agents>`
* Full API documentation for :class:`AgentFunctionDescription<flamegpu::AgentFunctionDescription>`
* Full API documentation for :class:`AgentFunctionDescription<flamegpu::AgentFunctionDescription>`

0 comments on commit 9ef8afb

Please sign in to comment.