BIS fnc helicopterDamage: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Some wiki formatting) |
Lou Montana (talk | contribs) m (Text replacement - "<code>([^<]*)\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^<]*) *<\/code>" to "<code>$1$2$3</code>") |
||
Line 12: | Line 12: | ||
<syntaxhighlight lang="cpp">params ["_helicopter", "_selection", "_damage"];</syntaxhighlight> | <syntaxhighlight lang="cpp">params ["_helicopter", "_selection", "_damage"];</syntaxhighlight> | ||
Executed script is: | Executed script is: | ||
<code>helicopter | <code>helicopter execVM '''"hsim\air_h\data\scripts\main_rotor_destruction.sqf"''';</code> | ||
helicopter rotor status can be found ''via'' variable '''HSim_mainRotorDestroyed''': | helicopter rotor status can be found ''via'' variable '''HSim_mainRotorDestroyed''': | ||
<code>_isRotorDestroyed {{=}} helicopter | <code>_isRotorDestroyed {{=}} helicopter getVariable ["HSim_mainRotorDestroyed", [[false]]];</code> | ||
|s1= [helicopter, selection, damage] call [[BIS_fnc_helicopterDamage]] | |s1= [helicopter, selection, damage] call [[BIS_fnc_helicopterDamage]] | ||
Line 26: | Line 26: | ||
|r1= [[Boolean]] - [[true]] when done | |r1= [[Boolean]] - [[true]] when done | ||
|x1= <code>myHelicopter | |x1= <code>myHelicopter addEventHandler ["Dammaged", { [[Magic Variables#this|_this]] [[call]] [[BIS_fnc_helicopterDamage]]; }];</code> | ||
|seealso= | |seealso= | ||
}} | }} |
Revision as of 21:36, 12 July 2022
Description
- Description:
- Handling EH-based helicopter damage, event handler in question being Dammagedsic.
params ["_helicopter", "_selection", "_damage"];
Executed script is:
helicopter execVM "hsim\air_h\data\scripts\main_rotor_destruction.sqf";
helicopter rotor status can be found via variable HSim_mainRotorDestroyed:_isRotorDestroyed = helicopter getVariable ["HSim_mainRotorDestroyed", false];
- Execution:
- call
- Groups:
- Helicopters
Syntax
- Syntax:
- [helicopter, selection, damage] call BIS_fnc_helicopterDamage
- Parameters:
- helicopter: Object
- selection: String - name of the helicopter selection receiving damage. Must be "main rotor"
- damage: Number - selection's damage. Will only trigger effects if damage > 0.999
- Return Value:
- Boolean - true when done
Examples
- Example 1:
myHelicopter addEventHandler ["Dammaged", { _this call BIS_fnc_helicopterDamage; }];
Additional Information
- See also:
- See also needed
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note