BIS fnc setHeight: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
m (Example syntax fix)
 
(47 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= tkoh
____________________________________________________________________________________________
|version1= 1.00


| tkoh |= Game name
|game2= arma3
|version2= 0.50


|1.00|= Game version
|gr1= Object Manipulation
____________________________________________________________________________________________


| <pre>/*
|descr= Set an object's altitude.


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


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


... if 1st parameter is an object:
|p2= height: [[Number]] - (Optional, default 0) height to set
----------------------------------
_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 <sqf inline>position target</sqf>) position to place the target with calculated height
---------------------------------
_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]] - (Optional, default "ROADWAY") can be:
Bool
* "ROADWAY": uses [[setPos]]
*/
* "ASL": uses [[setPosASL]]
* "ATL": uses [[setPosATL]]


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|r1= [[Boolean]] - [[true]] when done
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_setHeight]]; --> |= Syntax
|s2= [height, mode] call [[BIS_fnc_setHeight]]
{{Feature|important|This syntax uses <sqf inline>this</sqf> and is therefore meant to be used in init fields. Not to be used in MP.}}


|p1= |= Parameter 1
|p21= height: [[Number]] - (Optional, default 0) height to set


| |= Return value
|p22= mode: [[String]] - (Optional, default "ROADWAY") can be:
____________________________________________________________________________________________
* "ROADWAY": uses [[setPos]]
* "ASL": uses [[setPosASL]]
* "ATL": uses [[setPosATL]]


|x1= <code></code> |=
|r2= [[Boolean]] - [[true]] when done
____________________________________________________________________________________________


| |= See also
|x1= <sqf>
// will place player's vehicle on "myHeightMarker", 50m above terrain
[vehicle player, 50, getMarkerPos "myHeightMarker", "ATL"] call BIS_fnc_setHeight;
</sqf>


|x2= <sqf>
// 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;
</sqf>
|seealso= [[setPos]] [[setPosASL]] [[setPosATL]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Misc|{{uc:setHeight}}]]
[[Category:Functions|{{uc:setHeight}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:setHeight}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:setHeight}}]]

Latest revision as of 23:41, 13 November 2023

Hover & click on the images for description

Description

Description:
Set an object's altitude.
Execution:
call
Groups:
Object Manipulation

Syntax

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

Alternative Syntax

Syntax:
[height, mode] call BIS_fnc_setHeight
This syntax uses this and is therefore meant to be used in init fields. Not to be used in MP.
Parameters:
height: Number - (Optional, default 0) height to set
mode: String - (Optional, default "ROADWAY") can be:
Return Value:
Boolean - true when done

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:
setPos setPosASL setPosATL

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