setCompassOscillation: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
No edit summary
 
(36 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma3 |= Game name
|game1= arma3
|version1= 0.50


|0.50|= Game version
|eff= local
____________________________________________________________________________________________


| This command sets random heading on the player's compass (both, in map and in 3D view) with given frequency, which is also randomised. To reset the compass back to defaults, execute: <code>[[setCompassOscillation]] [-1, 0, 0];</code>. |= Description
|gr1= Interaction
____________________________________________________________________________________________


| '''setCompassOscillation''' [angle, frequencyMin, frequencyMax] |= Syntax
|descr= This command sets random heading on the player's compass (both in map and in 3D view) with given frequency, which is also randomised.


|p1= [angle, frequencyMin, frequencyMax]: [[Array]]  |PARAMETER1=
|s1= [[setCompassOscillation]] [angle, frequencyMin, frequencyMax]


|p2= angle: [[Number]] - heading deviation angle in [[rad|radians]]; the random angle will be picked up from <tt>[-angle...+angle]</tt> range.  |PARAMETER2=
|p1= angle: [[Number]] - heading deviation angle in [[rad]]ians; the random angle will be picked up from {{hl|[-angle...+angle]}} range


|p3= frequencyMin: [[Number]] - lower bound of heading change in seconds |PARAMETER3=
|p2= frequencyMin: [[Number]] - lower bound of heading change in seconds


|p4= frequencyMax: [[Number]] - higher bound of heading change in seconds. The actual frequency is calculated similar to: <code>_frequencyMin + [[random]](_frequencyMax - _frequencyMin);</code>  |PARAMETER4=
|p3= frequencyMax: [[Number]] - higher bound of heading change in seconds


| [[Nothing]] |RETURNVALUE=
|r1= [[Nothing]]


|x1= Set compass to oscillate every second within -90/+90 degrees:
<sqf>setCompassOscillation [rad 90, 1, 1];</sqf>


|x1= Set compass to oscillate every second within -90/+90 degrees: <code>[[setCompassOscillation]] <nowiki>[</nowiki>[[rad]] 90, 1, 1];
|x2= Change heading every 60 to 90 seconds:
</code>|EXAMPLE1=
<sqf>setCompassOscillation [rad 180, 60, 90];</sqf>
|x2= Change heading every 60 to 90 seconds: <code>[[setCompassOscillation]] <nowiki>[</nowiki>[[rad]] 180, 60, 90];
</code>|EXAMPLE2=
|x3= Make compass go crazy: <code>[[setCompassOscillation]] <nowiki>[</nowiki>[[rad]] 360, 0.1, 0.2];
</code>|EXAMPLE3=
____________________________________________________________________________________________


| [[visibleCompass]], [[shownCompass]], [[shownCuratorCompass]], [[showCompass]], [[showCuratorCompass]] |SEEALSO=
|x3= Make compass go crazy:
<sqf>setCompassOscillation [rad 360, 0.1, 0.2];</sqf>


| |MPBEHAVIOUR=  
|x4= Reset to default behaviour:
____________________________________________________________________________________________
<sqf>setCompassOscillation [-1, 0, 0];</sqf>
 
|seealso= [[visibleCompass]] [[shownCompass]] [[shownCuratorCompass]] [[showCompass]] [[showCuratorCompass]] [[setCompassDeclination]]
}}
}}
<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:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 10:37, 25 January 2024

Hover & click on the images for description

Description

Description:
This command sets random heading on the player's compass (both in map and in 3D view) with given frequency, which is also randomised.
Groups:
Interaction

Syntax

Syntax:
setCompassOscillation [angle, frequencyMin, frequencyMax]
Parameters:
angle: Number - heading deviation angle in radians; the random angle will be picked up from [-angle...+angle] range
frequencyMin: Number - lower bound of heading change in seconds
frequencyMax: Number - higher bound of heading change in seconds
Return Value:
Nothing

Examples

Example 1:
Set compass to oscillate every second within -90/+90 degrees:
setCompassOscillation [rad 90, 1, 1];
Example 2:
Change heading every 60 to 90 seconds:
setCompassOscillation [rad 180, 60, 90];
Example 3:
Make compass go crazy:
setCompassOscillation [rad 360, 0.1, 0.2];
Example 4:
Reset to default behaviour:
setCompassOscillation [-1, 0, 0];

Additional Information

See also:
visibleCompass shownCompass shownCuratorCompass showCompass showCuratorCompass setCompassDeclination

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