# Custom Code

For more complex logic than the [property-trigger](https://docs.miltechsimulations.com/miltech-mission-hub/detailed-documentation/map-objects/property-trigger "mention"), you can use custom RPN code. The **Custom Code** object can both execute RPN code and also use its result as a trigger.

Learn more about RPN code here: [MSFS SDK Documentation - Reverse Polish Notation](https://docs.flightsimulator.com/html/Additional_Information/Reverse_Polish_Notation.htm)

### Attributes

<table data-header-hidden data-full-width="false"><thead><tr><th width="109.99993896484375">Attribute</th><th>Description</th></tr></thead><tbody><tr><td><strong>Active On Start</strong></td><td><strong>Enabled:</strong> the code will start executing as soon as the missions starts<br><strong>Disabled:</strong> you need to activate this object during the mission, or use the <em>Execute Once</em> action.</td></tr><tr><td><strong>Fire Once</strong></td><td><strong>Enabled:</strong> the object will deactivate (stop executing the code) when it fires a connection for the first time<br><strong>Disabled:</strong> the object will keep firing the connected events until it is deactivated</td></tr><tr><td><strong>RPN Code</strong></td><td>Custom RPN code to execute</td></tr></tbody></table>

### Actions

<table data-header-hidden><thead><tr><th width="110">Action</th><th>Description</th></tr></thead><tbody><tr><td><strong>Activate</strong></td><td>Start executing the code every frame</td></tr><tr><td><strong>Deactivate</strong></td><td>Stop executing the code</td></tr><tr><td><strong>Execute Once</strong></td><td>Execute the code once</td></tr></tbody></table>

### Events

<table data-header-hidden><thead><tr><th width="109.99993896484375">Event</th><th>Description</th></tr></thead><tbody><tr><td><strong>True</strong></td><td>Fires when the result of executing the RPN code is true (larger than or equal to 1)</td></tr></tbody></table>

## See also

* For simple logic, use [property-trigger](https://docs.miltechsimulations.com/miltech-mission-hub/detailed-documentation/map-objects/property-trigger "mention")
