BIS fnc setHeight: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= Game name" to "|Game name=")
m (Some wiki formatting)
(39 intermediate revisions by 2 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
____________________________________________________________________________________________


| Set an object height. |DESCRIPTION=
|descr= Set an object's altitude.
____________________________________________________________________________________________


| [target, height, position, mode] call [[BIS_fnc_setHeight]] |SYNTAX=
|s1= [target, height, position, mode] call [[BIS_fnc_setHeight]]


|p1= target: [[Object]] - affected object |PARAMETER1=
|p1= target: [[Object]] - affected object


|p2= height: [[Number]] - (Optional, default 0) height to set |PARAMETER2=
|p2= height: [[Number]] - (Optional, default 0) height to set


|p3= position: [[Position]] - (Optional, default [[position]] ''target'') position to place the target with calculated height |PARAMETER3=
|p3= position: [[Position]] - (Optional, default <sqf inline>position target</sqf>) position to place the target with calculated height


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


| [[Boolean]] - [[true]] when done |RETURNVALUE=
|r1= [[Boolean]] - [[true]] when done
____________________________________________________________________________________________


|s2= [height, mode] call [[BIS_fnc_setHeight]]
|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
{{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.}}


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


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


|r2= [[Boolean]] - [[true]] when done |RETURNVALUE=
|r2= [[Boolean]] - [[true]] when done
____________________________________________________________________________________________


|x1= <code>{{codecomment|// will place player's vehicle on "myHeightMarker", 50m above terrain}}
|x1= <sqf>
<nowiki>[</nowiki>[[vehicle]] [[player]], 50, [[getMarkerPos]] "myHeightMarker", "ATL"]]] [[call]] [[BIS_fnc_setHeight]];</code> |EXAMPLE1=
// will place player's vehicle on "myHeightMarker", 50m above terrain
[vehicle player, 50, getMarkerPos "myHeightMarker", "ATL"]]] call BIS_fnc_setHeight;
</sqf>


|x2= <code>{{codecomment|// will set the ''this'' object 50m above sea level at its position
|x2= <sqf>
// use where '''this''' has a value like in an init field}}
// will set the "this" object 50m above sea level at its position
[50, "ASL"] [[call]] [[BIS_fnc_setHeight]];</code> |EXAMPLE2=
// use where "this" has a value like in an init field
____________________________________________________________________________________________
[50, "ASL"] call BIS_fnc_setHeight;
</sqf>


| [[setPos]], [[setPosASL]], [[setPosATL]] |SEEALSO=
|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}}]]

Revision as of 14:33, 25 July 2022

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