Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update modifying-agent-variables.rst #166

Merged
merged 1 commit into from
Oct 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>`