-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Laser - Public getter and setter for laser codes (#9772)
* Getter and setter for laser codes * Documentation * Sanitising input
- Loading branch information
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: johnb43 | ||
* Gets the laser code of a laser source. | ||
* | ||
* Argument: | ||
* 0: Laser source <OBJECT> | ||
* | ||
* Return Value: | ||
* Laser code <NUMBER> | ||
* | ||
* Example: | ||
* player call ace_laser_fnc_getLaserCode; | ||
* | ||
* Public: Yes | ||
*/ | ||
|
||
params [["_laserSource", objNull, [objNull]]]; | ||
|
||
if (isNull _laserSource) exitWith { | ||
-1 | ||
}; | ||
|
||
_laserSource getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: johnb43 | ||
* Sets the laser code on a laser source. | ||
* | ||
* Argument: | ||
* 0: Laser source <OBJECT> | ||
* 1: Laser code <NUMBER> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* [player, 1111] call ace_laser_fnc_setLaserCode; | ||
* | ||
* Public: Yes | ||
*/ | ||
|
||
params [["_laserSource", objNull, [objNull]], ["_laserCode", ACE_DEFAULT_LASER_CODE, [0]]]; | ||
|
||
_laserSource setVariable [QGVAR(code), _laserCode, true]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
layout: wiki | ||
title: Laser | ||
description: Explains the functions available for laser designators. | ||
group: framework | ||
order: 5 | ||
parent: wiki | ||
mod: ace | ||
version: | ||
major: 3 | ||
minor: 16 | ||
patch: 4 | ||
--- | ||
|
||
## 1. Scripting | ||
|
||
### 1.1. Get object's laser code | ||
|
||
`ace_laser_fnc_getLaserCode` | ||
|
||
| | Arguments | Type | Optional (default value) | ||
---| --------- | ---- | ------------------------ | ||
0 | Unit/Vehicle | Object | Required | ||
**R** | Laser code | Number | Return value | ||
|
||
### 1.2. Set object's laser code | ||
|
||
`ace_laser_fnc_setLaserCode` | ||
|
||
| | Arguments | Type | Optional (default value) | ||
---| --------- | ---- | ------------------------ | ||
0 | Unit/Vehicle | Object | Required | ||
1 | Laser code | Number | Required | ||
**R** | None | None | Return value |