Skip to reading
PCA Script Programming

emit_event()

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page
On this page
Code example
emit_event(name, data = {})

Broadcast an exact script event name with additional context.

Returns: Null.

Code example
emit_event("signal_powered", {"source": "lever"})

Use when event signal_powered to listen. A non-dictionary data value is stored under value. Guard against recursive broadcasts.

end_visual_script()#

Code example
end_visual_script(end_parent = false)

Request termination of a running visual graph, optionally its calling graph.

Returns: Runtime result / null.

Code example
end_visual_script(false)

This is not PCA’s return statement and does not break a normal action array.

end()#

Code example
end()

Compatibility helper recognized by the VM.

Returns: Null.

Code example
end()

It is not a quit command. In ordinary source, end is the block terminator; use return to leave a function and end_game for the gameplay end route. Do not use end() as a source-level termination statement.

Page 70 of 357Permalink
Go to page