Eden Editor Event Handlers – Arma 3

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 35: Line 35:
==== OnConnectingStart ====
==== OnConnectingStart ====
| <!-- Description -->
| <!-- Description -->
When [[Eden_Editor:_Connecting|Connecting]] operation is initiated.
| <!-- Arguments -->
| <!-- Arguments -->
  [<class>,<from>]
  [<class>,<from>]
* class: [[Config]] - connection config class
* class: [[Config]] - connection config class
* from: [[Array]] of Eden entities
* from: [[Array]] of [[Eden Entity|Eden Entities]]
|-
|-
| <!-- Title -->
| <!-- Title -->
==== OnConnectingEnd ====
==== OnConnectingEnd ====
| <!-- Description -->
| <!-- Description -->
When [[Eden_Editor:_Connecting|Connecting]] operation is terminated, no matter if it was confirmed or canceled.
| <!-- Arguments -->
| <!-- Arguments -->
  [<class>,<from>,<to>]
  [<class>,<from>,<to>]
* class: Config - connection config class
* class: Config - connection config class
* from: Array of 3DEN entities
* from: Array of 3DEN entities
* to: 3DEN Entity (when connecting was successful) or nil (when connecting was terminated)
* to: [[Eden Entity]] (when connecting was successful) or nil (when connecting was terminated)
This handler is called every time connecting mode ends, even when user cancelled it
|-
|-
| <!-- Title -->
| <!-- Title -->
==== OnCopy ====
==== OnCopy ====
| <!-- Description -->
| <!-- Description -->
When entities are copied.
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 59: Line 61:
==== OnCut ====
==== OnCut ====
| <!-- Description -->
| <!-- Description -->
When entities are cut.
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 65: Line 68:
==== OnDeleteUnits ====
==== OnDeleteUnits ====
| <!-- Description -->
| <!-- Description -->
When entities are deleted.
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
|-
| <!-- Title -->
==== OnEntityMenu ====
| <!-- Description -->
When [[Eden_Editor:_Entity_Context_Menu|Entity Context Menu]] is opened.
| <!-- Arguments -->
[position, entity, listPath]
* position: [[Array]] - [[Position]] where user clicked to open the menu.
** Entity position when clicked on an entity.
** Empty array when clicked on something that doesn't have position (i.e., abstract folder in Edit list like BLUFOR, Trigger, etc.)
* entity: [[Eden Entity]]
** Nil when clicked on empty space
* listPath: [[Array]] - UI tree path when clicked on entity in the [[Eden Editor: Entity List|Entity List]].
** Nil when clicked in the scene (we cannot use empty array, because that's a path to root item)
|-
|-
| <!-- Title -->
| <!-- Title -->
==== OnGridChange ====
==== OnGridChange ====
| <!-- Description -->
| <!-- Description -->
When grid changes, either using [[Eden Editor: Toolbar|Toolbar]] option, ot by scripting command [[set3DENGrid]].
| <!-- Arguments -->
| <!-- Arguments -->
  [gridType, gridValue]
  [gridType, gridValue]
Line 107: Line 126:
==== OnMissionLoad ====
==== OnMissionLoad ====
| <!-- Description -->
| <!-- Description -->
When a scenario is loaded.
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 113: Line 133:
==== OnMissionNew ====
==== OnMissionNew ====
| <!-- Description -->
| <!-- Description -->
When new scenario is started. Executed also when Eden is opened with an empty scenario.
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 119: Line 140:
==== OnMissionPreview ====
==== OnMissionPreview ====
| <!-- Description -->
| <!-- Description -->
When scenario preview is started. Executed when the scenario is already loaded, so entities in it can be accessed.
| <!-- Arguments -->
| <!-- Arguments -->
  [objects, groups, waypoints, markers]
  [objects, groups, waypoints, markers]
Line 133: Line 155:
==== OnMissionPreviewEnd ====
==== OnMissionPreviewEnd ====
| <!-- Description -->
| <!-- Description -->
When preview ends and user returns back to Eden Editor.
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 139: Line 162:
==== OnMissionSave ====
==== OnMissionSave ====
| <!-- Description -->
| <!-- Description -->
When a scenario is saved.
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 151: Line 175:
==== OnModeChange ====
==== OnModeChange ====
| <!-- Description -->
| <!-- Description -->
| <!-- Arguments -->
When _Save As_ action is triggered (i.e., Save window is opened, but the mission is not necessarily saved yet)
''None''
|-
| <!-- Title -->
==== OnMoveGridDecrease ====
| <!-- Description -->
| <!-- Arguments -->
''None''
|-
| <!-- Title -->
==== OnMoveGridIncrease ====
| <!-- Description -->
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 169: Line 182:
==== OnMoveGridToggle ====
==== OnMoveGridToggle ====
| <!-- Description -->
| <!-- Description -->
When '''translation''' grid is toggled on or off
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 175: Line 189:
==== OnPaste ====
==== OnPaste ====
| <!-- Description -->
| <!-- Description -->
When entities are pasted
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 181: Line 196:
==== OnPasteUnitOrig ====
==== OnPasteUnitOrig ====
| <!-- Description -->
| <!-- Description -->
When entities are pasted on their original positions
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 187: Line 203:
==== OnRedo ====
==== OnRedo ====
| <!-- Description -->
| <!-- Description -->
| <!-- Arguments -->
When undo operation is redone
''None''
|-
| <!-- Title -->
==== OnRotateGridDecrease ====
| <!-- Description -->
| <!-- Arguments -->
''None''
|-
| <!-- Title -->
==== OnRotateGridIncrease ====
| <!-- Description -->
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 205: Line 210:
==== OnRotateGridToggle ====
==== OnRotateGridToggle ====
| <!-- Description -->
| <!-- Description -->
When '''rotation''' grid is toggled on or off
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 211: Line 217:
==== OnScaleGridToggle ====
==== OnScaleGridToggle ====
| <!-- Description -->
| <!-- Description -->
When '''area scaling''' grid is toggled on or off
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 217: Line 224:
==== OnSearchCreate ====
==== OnSearchCreate ====
| <!-- Description -->
| <!-- Description -->
When "SearchCreate" action is triggered (e.g., when pressing Ctrl+Shift+F)
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 223: Line 231:
==== OnSearchEdit ====
==== OnSearchEdit ====
| <!-- Description -->
| <!-- Description -->
When "SearchEdit" action is triggered (e.g., when pressing Ctrl+F)
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 229: Line 238:
==== OnServerToggle ====
==== OnServerToggle ====
| <!-- Description -->
| <!-- Description -->
When server is created or destroyed fro the preview.
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 235: Line 245:
==== OnSubmodeChange ====
==== OnSubmodeChange ====
| <!-- Description -->
| <!-- Description -->
When submode (e.g., BLUFOR or OFPOR for Objects, or Modules for Systems) changes.
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 241: Line 252:
==== OnSurfaceSnapToggle ====
==== OnSurfaceSnapToggle ====
| <!-- Description -->
| <!-- Description -->
When surface snap settings are changed.
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 247: Line 259:
==== OnTerrainNew ====
==== OnTerrainNew ====
| <!-- Description -->
| <!-- Description -->
| <!-- Arguments -->
When new terrain is loaded. Executed also when Eden is opened.
''None''
|-
| <!-- Title -->
==== OnToggleMapIDs ====
| <!-- Description -->
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 259: Line 266:
==== OnToggleMapTextures ====
==== OnToggleMapTextures ====
| <!-- Description -->
| <!-- Description -->
When map textures are toggled on or off.
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 265: Line 273:
==== OnUndo ====
==== OnUndo ====
| <!-- Description -->
| <!-- Description -->
When an operation is undone.
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 271: Line 280:
==== OnVerticalToggle ====
==== OnVerticalToggle ====
| <!-- Description -->
| <!-- Description -->
When vertical mode settings are changed.
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 277: Line 287:
==== OnWidgetNone ====
==== OnWidgetNone ====
| <!-- Description -->
| <!-- Description -->
When no [[Eden_Editor:_Transformation_Widget|widget]] is selected.
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 283: Line 294:
==== OnWidgetRotation ====
==== OnWidgetRotation ====
| <!-- Description -->
| <!-- Description -->
When '''rotation''' [[Eden_Editor:_Transformation_Widget|widget]] is selected.
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 289: Line 301:
==== OnWidgetScale ====
==== OnWidgetScale ====
| <!-- Description -->
| <!-- Description -->
When '''area scaling''' [[Eden_Editor:_Transformation_Widget|widget]] is selected.
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 295: Line 308:
==== OnWidgetToggle ====
==== OnWidgetToggle ====
| <!-- Description -->
| <!-- Description -->
When [[Eden_Editor:_Transformation_Widget|widget]] is toggled (i.e., browsing through all widget types)
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 301: Line 315:
==== OnWidgetTranslation ====
==== OnWidgetTranslation ====
| <!-- Description -->
| <!-- Description -->
When '''translation''' [[Eden_Editor:_Transformation_Widget|widget]] is selected.
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''
Line 307: Line 322:
==== OnWorkspacePartSwitch ====
==== OnWorkspacePartSwitch ====
| <!-- Description -->
| <!-- Description -->
When [[Eden_Editor:_Scenario_Phases|scenario phase]] is selected.
| <!-- Arguments -->
| <!-- Arguments -->
''None''
''None''

Revision as of 17:23, 2 November 2015

Eden Editor event handlers. When added, they will remain until Eden Editor is closed. Playing preview will not erase them.

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

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>]
  • class: Config - connection config class
  • from: Array of 3DEN entities
  • to: Eden Entity (when connecting was successful) or nil (when connecting was terminated)

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]
  • position: Array - Position where user clicked to open the menu.
    • Entity position when clicked on an entity.
    • Empty array when clicked on something that doesn't have position (i.e., abstract folder in Edit list like BLUFOR, Trigger, etc.)
  • entity: Eden Entity
    • Nil when clicked on empty space
  • listPath: Array - UI tree path when clicked on entity in the Entity List.
    • Nil when clicked in the scene (we cannot use empty array, because that's a path to root item)

OnGridChange

When grid changes, either using Toolbar option, ot by scripting command set3DENGrid.

[gridType, gridValue]
  • gridType: String - can be "translation", "rotation" or "scaling"
  • gridValue: Number

OnMapClosed

None

OnMapOpened

None

OnMessage

Message IDs:

  • 0 - Mission saved
  • 1 - Mission autosaved
  • 2 - Trying to move a character into full vehicle
  • 3 - Moved character into enemy vehicle
  • 4 - Trying to run mission without any player
  • 5 - Mission exported to SP
  • 6 - Mission exported to MP
  • 7 - Attempting to delete a default layer
[messageID]

OnMissionLoad

When a 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]
  • objects: Array
  • groups: Array
  • waypoints: Array
  • markers: Array

Each array is in format:

[entity1, id1, entity2, id2, ..., entityN, idN]

OnMissionPreviewEnd

When preview ends and user returns back to Eden Editor.

None

OnMissionSave

When a scenario is saved.

None

OnMissionSaveAs

None

OnModeChange

When _Save As_ action is triggered (i.e., Save window is opened, but the mission is not necessarily saved yet)

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

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 fro 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

OnUndo

When an operation is undone.

None

OnVerticalToggle

When vertical mode settings are changed.

None

OnWidgetNone

When no widget is selected.

None

OnWidgetRotation

When rotation widget is selected.

None

OnWidgetScale

When area 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