BIS fnc moduleLightning: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\|game([0-9])= *([^ ]+) * +\|version([0-9])= *([^ ]+) * " to "|game$1=$2 |version$3=$4 ") |
Lou Montana (talk | contribs) (Add target deletion info) |
||
Line 7: | Line 7: | ||
|descr= Zeus lightning strike. | |descr= Zeus lightning strike. | ||
{{Feature|important|Note that ''target'' will be deleted by the function (part of how Zeus modules work).}} | |||
|s1= [target, nil, activate] call [[BIS_fnc_moduleLightning]] | |s1= [target, nil, activate] call [[BIS_fnc_moduleLightning]] | ||
|p1= target: [[Object]] - Where the lightning bolt hits | |p1= target: [[Object]] - Where the lightning bolt hits - '''will''' be deleted by the function! | ||
|p2= nil: [[Nothing]] - Not used | |p2= nil: [[Nothing]] - Not used | ||
Line 22: | Line 23: | ||
"Eat that!", | "Eat that!", | ||
{ | { | ||
[ | [[private]] _tempTarget = [[createSimpleObject]] ["Land_HelipadEmpty_F", [[getPosASL]] [[cursorTarget]]]; | ||
[_tempTarget, [[nil]], [[true]]] [[spawn]] [[BIS_fnc_moduleLightning]]; | |||
[[cursorTarget]] [[setDamage]] 1; | [[cursorTarget]] [[setDamage]] 1; | ||
}, | }, | ||
Line 34: | Line 36: | ||
|x2= <code>[] [[spawn]] {{cc|Who gets hit first? ;-)}} | |x2= <code>[] [[spawn]] {{cc|Who gets hit first? ;-)}} | ||
{ | { | ||
{ | { | ||
[_x,[[nil]],[[true]] | [[private]] _tempTarget = [[createSimpleObject]] ["Land_HelipadEmpty_F", [[getPosASL]] _x]; | ||
[[sleep]] [[random]] | [_tempTarget, [[nil]], [[true]]] [[spawn]] [[BIS_fnc_moduleLightning]]; | ||
} [[forEach]] ([[ | [[sleep]] (1 + [[random]] 4); | ||
} [[forEach]] ([[allPlayers]] [[call]] [[BIS_fnc_arrayShuffle]]); | |||
};</code> | };</code> | ||
|seealso= [[Arma 3 Zeus]] | |seealso= [[Arma 3 Zeus]] | ||
}} | }} |
Revision as of 23:17, 21 June 2021
Description
Syntax
- Syntax:
- [target, nil, activate] call BIS_fnc_moduleLightning
- Parameters:
- target: Object - Where the lightning bolt hits - will be deleted by the function!
- nil: Nothing - Not used
- activate: Boolean - true to activate, false does nothing
- Return Value:
- Nothing
Examples
- Example 1:
player addAction [ "Eat that!", { private _tempTarget = createSimpleObject ["Land_HelipadEmpty_F", getPosASL cursorTarget]; [_tempTarget, nil, true] spawn BIS_fnc_moduleLightning; cursorTarget setDamage 1; }, [], 1.5, true, true, "", "!isNull cursorTarget" ];
- Example 2:
[] spawn // Who gets hit first? ;-) { { private _tempTarget = createSimpleObject ["Land_HelipadEmpty_F", getPosASL _x]; [_tempTarget, nil, true] spawn BIS_fnc_moduleLightning; sleep (1 + random 4); } forEach (allPlayers call BIS_fnc_arrayShuffle); };
Additional Information
- See also:
- Arma 3 Zeus
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