From d8f0de1a5d3f6f8985d290b8ecf64469d39768b4 Mon Sep 17 00:00:00 2001 From: Cuel Date: Thu, 9 Aug 2018 18:01:35 +0200 Subject: [PATCH] acex fortify deploy handler and event docs (#6282) --- docs/wiki/frameworkx/fortify-framework.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/wiki/frameworkx/fortify-framework.md b/docs/wiki/frameworkx/fortify-framework.md index 547dd180c7..045bc30e1a 100644 --- a/docs/wiki/frameworkx/fortify-framework.md +++ b/docs/wiki/frameworkx/fortify-framework.md @@ -64,6 +64,21 @@ class ACEX_Fortify_Presets { ``` Then you will have to set the mission preset to `myMissionObjects` with `#fortify blufor myMissionObjects` to enable it. + +## 1.3 Adding custom deploy handlers + +A custom deploy handler allows missions makers to decide if an object can be placed or not. + +To verify that an object isn't above a certain terrain height we can check the heigt of the object before it is confirmed as placed. Returning `false` from the code block means that placement is not allowed. + +```sqf +[{ + params ["_unit", "_object", "_cost"]; + private _return = (getPosATL _object) select 2 < 1; + _return +}] call acex_fortify_fnc_addDeployHandler; +``` + ## 2. Events @@ -73,3 +88,4 @@ Event Name | Passed Parameter(s) | Locality | Description ---------- | ----------- | ------------------- | -------- `acex_fortify_objectPlaced` | [player, side, objectPlaced] | Global | Foritfy object placed `acex_fortify_objectDeleted` | [player, side, objectDeleted] | Global | Foritfy object deleted +`acex_fortify_onDeployStart` | [player, object, cost] | Local | Player starts placing object