{"name":"BIS_fnc_boatRack01ActionAdd","title":"BIS fnc boatRack01ActionAdd","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_boatRack01ActionAdd","revid":379545,"updated":"2026-10-31T13:42:01Z","groups":["Boat Recovery"],"status":"ok","games":{"arma3":"1.84"},"since":"arma3 1.84","arma3_since":"1.84","description":"Part of the boat recovery system: adds the \"Recover Boat\" hold action (see BIS_fnc_holdActionAdd) to the boat that the player is driving near a boat rack.\nThe function is the on-activation statement of the trigger that BIS_fnc_boatRack01Init creates around the boat rack; it is meant for internal use.\n\nThe function:\n\n- gets the boat rack from the trigger's `\"BIS_linkedBoatRack\"` variable and, if a list of objects is given, takes the boat from it: the first object of kind `\"Ship\"` that is cameraOn\n- stores the boat on the trigger in the variable `\"bis_loadedVehicle\"`\n- adds a 5 seconds hold action with priority 1000 to the boat; whether it is shown and can progress is decided once, when it is added, by BIS_fnc_boatRack01CanExetuteAction and BIS_fnc_boatRack01CanProgressAction\n- while the action is held, the boat is slowed down and then held in place\n- when it is completed, the boat is loaded onto the empty rack with setVehicleCargo and BIS_fnc_boatRack01AdjustZOffset is called; the action is then removed\n- appends `[boat, trigger, actionID]` to the boat's `\"bis_attachedActionID\"` variable, which BIS_fnc_boatRack01ActionRemove uses (a boat can have actions from several racks)","syntaxes":[{"syntax":"[trigger, boat] call BIS_fnc_boatRack01ActionAdd","params":[{"name":"trigger","type":"Object","description":"the boat rack's trigger","type_expr":"Object"},{"name":"boat","type":"Array or Object","optional":true,"default":"objNull","description":"the boat, or the trigger's list of objects (`thisList`) to find the boat in","type_expr":"Array | Object","text":"boat: Array or Object - (Optional, default objNull) the boat, or the trigger's list of objects (`thisList`) to find the boat in"}],"returns":{"type":"Nothing","type_expr":"Nothing"}}],"examples":[{"text":"Trigger statements set by BIS_fnc_boatRack01Init:\n\n```sqf\n_triggerLoad setTriggerStatements\n[\n    format [\"%1 call BIS_fnc_boatRack01ActionCondition\", [_triggerAreaSizeX, _triggerAreaSizeY, _triggerAreaSizeZ, _boatRecoveryPointList]],\n    \"[thisTrigger,thisList] call bis_fnc_boatRack01ActionAdd;\",\n    \"[thisTrigger] call bis_fnc_boatRack01ActionRemove;\"\n];\n```","code":["_triggerLoad setTriggerStatements\n[\n\tformat [\"%1 call BIS_fnc_boatRack01ActionCondition\", [_triggerAreaSizeX, _triggerAreaSizeY, _triggerAreaSizeZ, _boatRecoveryPointList]],\n\t\"[thisTrigger,thisList] call bis_fnc_boatRack01ActionAdd;\",\n\t\"[thisTrigger] call bis_fnc_boatRack01ActionRemove;\"\n];"]}],"see_also":["BIS_fnc_boatRack01Init","BIS_fnc_boatRack01ActionRemove","BIS_fnc_boatRack01AdjustZOffset","BIS_fnc_holdActionAdd"]}