BIS fnc moduleLightning: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<code>([^<]*)\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^<]*) *<\/code>" to "<code>$1$2$3</code>")
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *W([a-z ])" to "$1 - w$2")
 
(14 intermediate revisions by the same user not shown)
Line 11: Line 11:
|s1= [target, nil, activate] call [[BIS_fnc_moduleLightning]]
|s1= [target, nil, activate] call [[BIS_fnc_moduleLightning]]


|p1= target: [[Object]] - Where the lightning bolt hits - '''will''' be deleted by the function!
|p1= target: [[Object]] - where the lightning bolt hits - '''will''' be deleted by the function!


|p2= nil: [[Nothing]] - Not used
|p2= nil: [[Nothing]] - not used


|p3= activate: [[Boolean]] - [[true]] to activate, [[false]] does nothing
|p3= activate: [[Boolean]] - [[true]] to activate, [[false]] does nothing
Line 19: Line 19:
|r1= [[Nothing]]
|r1= [[Nothing]]


|x1= <code>player addAction  
|x1= <sqf>player addAction  
[
[
"Eat that!",  
"Eat that!",  
{
{
private _tempTarget = createSimpleObject ["Land_HelipadEmpty_F", getPosASL [[cursorTarget]]];
private _tempTarget = createSimpleObject ["Land_HelipadEmpty_F", getPosASL cursorTarget];
[_tempTarget, [[nil]], [[true]]] [[spawn]] [[BIS_fnc_moduleLightning]];
[_tempTarget, nil, true] spawn BIS_fnc_moduleLightning;
[[cursorTarget]] [[setDamage]] 1;
cursorTarget setDamage 1;
},
},
[],
[],
1.5,  
1.5,  
[[true]],  
true,  
[[true]],  
true,  
"",
"",
"![[isNull]] [[cursorTarget]]"
"!isNull cursorTarget"
];</code>
];</sqf>


|x2= <code>[] spawn {{cc|Who gets hit first? ;-)}}
|x2= <sqf>[] spawn // Who gets hit first? ;-)
{
{
{
{
private _tempTarget = createSimpleObject ["Land_HelipadEmpty_F", getPosASL _x];
private _tempTarget = createSimpleObject ["Land_HelipadEmpty_F", getPosASL _x];
[_tempTarget, nil, [[true]]] [[spawn]] [[BIS_fnc_moduleLightning]];
[_tempTarget, nil, true] spawn BIS_fnc_moduleLightning;
[[sleep]] (1 + [[random]] 4);
sleep (1 + random 4);
} [[forEach]] ([[allPlayers]] [[call]] [[BIS_fnc_arrayShuffle]]);
} forEach (allPlayers call BIS_fnc_arrayShuffle);
};</code>
};</sqf>


|seealso= [[Arma 3 Zeus]]
|seealso= [[Arma 3 Zeus]]
}}
}}

Latest revision as of 16:35, 8 November 2023

Hover & click on the images for description

Description

Description:
Zeus lightning strike.
Note that target will be deleted by the function (part of how Zeus modules work).
Execution:
call
Groups:
Modules

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