BIS fnc setHeight: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
(Page filling)
Line 8: Line 8:
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>/*
| Set an object height. |= Description
____________________________________________________________________________________________


Description:
| [target, height, position, mode] call [[BIS_fnc_setHeight]] |= Syntax
Set a unit's height.


Parameter(s):
|p1= target: [[Object]] - affected object |= Parameter 1


... if 1st parameter is an object:
|p2= height: [[Number]] - height to set |= Parameter 2
----------------------------------
_this select 0: OBJECT   - affected object
_this select 1: NUMBER   - height in meters
_this select 2 (Optional): ARRAY  - position (default: object's position)
_this select 3 (Optional): STRING - relative to (default: "ROADWAY", accepted: "ROADWAY","ASL","ATL")


... if 1st parameter is a number:
|p3= position: [[Position]] - (Optional, default [[position]] ''target'') position to place the target with calculated height |= Parameter 3
---------------------------------
_this select 0: NUMBER   - heigth applied to 'this' (for use in init fields).
_this select 1 (Optional): STRING - relative to (default: "ROADWAY", accepted: "ROADWAY","ASL","ATL")


Returns:
|p4= mode: [[String]] - can be:
Bool
* "ROADWAY": default, uses [[setPos]]
*/
* "ASL": uses [[setPosASL]]
* "ATL": uses [[setPosATL]] |= Parameter 4
____________________________________________________________________________________________


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|s2= [height, mode] call [[BIS_fnc_setHeight]]
____________________________________________________________________________________________
{{note|Alternative Syntax uses {{Inline code|[[this]]}} and {{Inline code|[[position]] [[this]]}}; this shortened syntax is to be used in init fields.}} |= Alternative Syntax


| <!-- [] call [[BIS_fnc_setHeight]]; --> |= Syntax
|p21= height: [[Number]] - height to set |= Parameter 1


|p1= |= Parameter 1
|p22= mode: [[String]] - can be:
* "ROADWAY": default, uses [[setPos]]
* "ASL": uses [[setPosASL]]
* "ATL": uses [[setPosATL]] |= Parameter 2


| |= Return value
| [[Boolean]] - [[true]] when done |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code></code> |=  
|x1= <code>{{codecomment|// will place player's vehicle on "myHeightMarker", 50m above terrain}}
<nowiki>[</nowiki>[[vehicle]] [[player]], 50, [[getMarkerPos]] "myHeightMarker", "ATL"]]] [[call]] [[BIS_fnc_setHeight]];</code> |= Example 1
 
|x2= <code>{{codecomment|// will set the ''this'' object 50m above sea level at its position
// use where '''this''' has a value like in an init field}}
[50, "ASL"] [[call]] [[BIS_fnc_setHeight]];</code> |= Example 2
____________________________________________________________________________________________
____________________________________________________________________________________________


| |= See also
| [[setPos]], [[setPosASL]], [[setPosATL]] |= See also
 
}}
}}



Revision as of 12:03, 22 April 2018


Hover & click on the images for description

Description

Description:
Set an object height.
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[target, height, position, mode] call BIS_fnc_setHeight
Parameters:
target: Object - affected object
height: Number - height to set
position: Position - (Optional, default position target) position to place the target with calculated height
mode: String - can be:
Return Value:
Boolean - true when done

Alternative Syntax

Syntax:
[height, mode] call BIS_fnc_setHeight Template:note
Parameters:
height: Number - height to set
mode: String - can be:
Return Value:
Nothing

Examples

Example 1:
// will place player's vehicle on "myHeightMarker", 50m above terrain [vehicle player, 50, getMarkerPos "myHeightMarker", "ATL"]]] call BIS_fnc_setHeight;
Example 2:
// will set the this object 50m above sea level at its position // use where this has a value like in an init field [50, "ASL"] call BIS_fnc_setHeight;

Additional Information

See also:
setPossetPosASLsetPosATL

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

Notes

Bottom Section