Skip to content

Function documentation

TheTimidShade edited this page Mar 14, 2022 · 4 revisions

tts_beam_fnc_beam

Calls down a beam laser strike on the target position. Needs to be executed on all connected clients and the server to work correctly.

Parameters:  
  0: OBJECT - Object to use as beam laser target. The beam is created above this object.
  1: ARRAY (OPTIONAL) - Colour of the beam in format [R,G,B]. Default: [1,0.6,0.2]
  2: ARRAY (OPTIONAL) - Colour of dust created on impact in format [R,G,B]. Default: [0.3,0.27,0.15]
  3: BOOL (OPTIONAL) - If false, the beam will not destroy objects/kill units. Default: true
  4: NUMBER (OPTIONAL) - Lethal radius of the explosion in metres. Default: 200
  5: NUMBER (OPTIONAL) - Damage radius of the explosion in metres. Default: 400

Returns:  
  Nothing

Example:

// trigger example
if (isServer) then {
    [_beamTarget, [1,0.6,0.2], [0.3,0.27,0.15], true, 200, 400] remoteExec ["tts_beam_fnc_beam", 0, false];
};

tts_beam_fnc_orbitalBombardment

Calls down a barrage of beam strikes centred around the target position. Should only be executed on the server. To reduce performance issues the minimum delay between beam strikes is 0.1 seconds. Either way, anything less than a few seconds is likely to cause framerate issues/lag if lots of beam strikes are landing in the same area.

To cancel an ongoing orbital bombardment, you can set the tts_beam_stopOrbitalBombardment variable to true. The script will exit and the variable will be reset back to false.

Parameters:  
  0: ARRAY - Centre position of bombardment
  1: ARRAY (OPTIONAL) - Colour of the beam in format [R,G,B]. Default: [1,0.6,0.2]
  2: ARRAY (OPTIONAL) - Colour of dust created on impact in format [R,G,B]. Default: [0.3,0.27,0.15]
  3: BOOL (OPTIONAL) - If false, the beam will not destroy objects/kill units.
  4: NUMBER (OPTIONAL) - Lethal radius of the explosion in metres. Default: 200
  5: NUMBER (OPTIONAL) - Damage radius of the explosion in metres. Default: 400
  6: NUMBER (OPTIONAL) - Maximum distance in metres an orbital strike can land from the target position. Default: 200m
  7: NUMBER (OPTIONAL) - Number of laser strikes in the barrage. Default: 5
  8: NUMBER (OPTIONAL) - Delay in seconds between beam strikes. Default: 5s
  9: BOOL (OPTIONAL) - Rainbow mode, if enabled, the beam colour will change for each beam strike. Default: false

Returns:  
  Nothing

Example:

// trigger example
if (isServer) then {
    [getPos beamTarget, [1,0.6,0.2], [0.3,0.27,0.15], true, 200, 400, 200, 5, 1, false] spawn tts_beam_fnc_orbitalBombardment;
};

// to stop ongoing orbital bombardment
tts_beam_stopOrbitalBombardment = true;
publicVariable "tts_beam_stopOrbitalBombardment";
Clone this wiki locally