Eden Editor Event Handlers – Arma 3
Eden Editor event handlers. When added, they will remain until Eden Editor is closed. Playing preview will not erase them.
Editor Event Handlers
Editor handlers are added to the editor instance and will remain active for the duration of a session. Launching a preview won't erase them, but leaving to main menu will close the editor and erase all handlers with it.
Scripting
Commands:
Example:
add3DENEventHandler ["onUndo",{hint "Undo";}]
Config
Alternatively, you can define event handlers directly in the config. Use your custom section (mySection in the example) to prevent overriding handlers from other sources. Handlers defined here will be added automatically when Eden Editor is opened.
class Cfg3DEN { class EventHandlers { class mySection { onUndo = "hint 'Undo';"; // <handlerName> = <handlerExpression> }; }; };
List
Most handlers don't receive any arguments. That is intended, because in most cases, required data can be obtained either using get3DENActionState, or by specialized 'get' commands.
Class | Description | Arguments |
---|---|---|
OnConnectingStart |
When Connecting operation is initiated. |
[<class>,<from>]
|
OnConnectingEnd |
When Connecting operation is terminated, no matter if it was confirmed or canceled. |
[<class>,<from>,<to>]
|
OnCopy |
When entities are copied. |
None |
OnCut |
When entities are cut. |
None |
OnDeleteUnits |
When entities are deleted. |
None |
OnEntityMenu |
When Entity Context Menu is opened. |
[position, entity, listPath]
|
OnGridChange |
When grid changes, either using Toolbar option, ot by scripting command set3DENGrid. |
[gridType, gridValue] |
OnHistoryChange |
When history changes. |
None |
OnMapClosed |
When map is closed. |
None |
OnMapOpened |
When map is opened. |
None |
OnMessage |
Handler used for showing on-screen notifications, triggered by various range of events. Message IDs:
|
[messageID]
|
OnMissionAutosave |
When scenario is autosaved. |
None |
OnMissionLoad |
When scenario is loaded. |
None |
OnMissionNew |
When new scenario is started. Executed also when Eden is opened with an empty scenario. |
None |
OnMissionPreview |
When scenario preview is started. Executed when the scenario is already loaded, so entities in it can be accessed. |
[objects, groups, waypoints, markers]
Each array is in format: [entity1, id1, entity2, id2, ..., entityN, idN] |
OnMissionListChange |
When the current list of missions in the open/save mission dialog changes, i.e when first opened or a different folder is selected. |
None |
OnMissionPreviewEnd |
When preview ends and user returns back to Eden Editor. |
None |
OnMissionSave |
When scenario is saved. |
None |
OnMissionSaveAs |
When Save As action is triggered (i.e., Save window is opened, but the mission is not necessarily saved yet). |
None |
OnModeChange |
When editing mode is changed (i.e., from Objects to Triggers). |
None |
OnMoveGridToggle |
When translation grid is toggled on or off. |
None |
OnPaste |
When entities are pasted. |
None |
OnPasteUnitOrig |
When entities are pasted on their original positions. |
None |
OnRedo |
When undo operation is redone. |
None |
OnRotateGridToggle |
When rotation grid is toggled on or off. |
None |
OnSelectionChange |
When entity selection changes. Use get3DENSelected to return currently selected entities. |
None |
OnScaleGridToggle |
When area scaling grid is toggled on or off. |
None |
OnSearchCreate |
When "SearchCreate" action is triggered (e.g., when pressing Ctrl+Shift+F). |
None |
OnSearchEdit |
When "SearchEdit" action is triggered (e.g., when pressing Ctrl+F). |
None |
OnServerToggle |
When server is created or destroyed from the preview. |
None |
OnSubmodeChange |
When submode (e.g., BLUFOR or OFPOR for Objects, or Modules for Systems) changes. |
None |
OnSurfaceSnapToggle |
When surface snap settings are changed. |
None |
OnTerrainNew |
When new terrain is loaded. Executed also when Eden is opened. |
None |
OnToggleMapTextures |
When map textures are toggled on or off. |
None |
OnTogglePlaceEmptyVehicle |
When the Place vehicles with crew is toggled on/off in Objects mode. |
None |
OnUndo |
When an operation is undone. |
None |
OnVerticalToggle |
When vertical mode settings are changed. |
None |
OnWidgetArea |
When area widget is selected. |
None |
OnWidgetNone |
When no widget is selected. |
None |
OnWidgetRotation |
When rotation widget is selected. |
None |
OnWidgetScale |
When scaling widget is selected. |
None |
OnWidgetToggle |
When widget is toggled (i.e., browsing through all widget types) |
None |
OnWidgetTranslation |
When translation widget is selected. |
None |
OnWorkspacePartSwitch |
When scenario phase is selected. |
None |
Object Event Handlers
Editor specific event handlers can be also added directly to objects, using addEventHandler command.
These handlers exist only for the duration of active workspace. Running a preview or loading the same scenario again will erase all object event handlers, because objects themselves are despawned from the world and then created again.
List
Most handlers don't receive any arguments. That is intended, because in most cases, required data can be obtained either using get3DENActionState, or by specialized 'get' commands.
Class | Description | Arguments |
---|---|---|
AttributesChanged3DEN |
When object's attributes are changed. Can happen when moving or rotating the object, when changing its attributes in attributes window, or when some scripts change attributes using set3DENAttributes command. |
[object]
|
ConnectionChanged3DEN |
When a connection is added or removed from an object. |
[object]
|
RegisteredToWorld3DEN |
When object is added to the scenario. That happens when you place it, but also when you paste it after copying, or when redoing placement operation after it was undone. |
[object]
|
UnregisteredFromWorld3DEN |
When object is removed from the scenario. That happens when you delete it, but also when you undo placement operation. |
[object]
|
Dragged3DEN |
When object is dragged. |
[object]
|