Lou Montana/Sandbox – User

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Test [edit] links)
m (Update w/ links)
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category: Sandbox]]
[[Category: Sandbox]]
<includeonly>
{{Feature|informative|To go on [[Initialisation Order]].}}
{{#switch: {{lc:{{{1}}}}}


|intro = {{#ifeq:{{uc:{{FULLPAGENAME}}}}|TEMPLATE:CT||{{DISPLAYTITLE:{{{macro}}}}}}}{{Navbox/CT}}
{| class="wikitable sortable align-center align-left-col-1"
{{ConfigPage|start}}
|+ Order of Initialisation (use column sorting for respective machine order)
== Introduction ==
! rowspan="2" class="unsortable" style="text-align: center" | Task
{{{description}}}
! rowspan="2" | Exec Environment
{{#if: {{{gallery|}}}|
! rowspan="1" colspan="5" class="unsortable" | Machine
{{#tag:gallery|{{{gallery}}}|mode="slideshow"|heights=240px|widths=240px}}
|-
}}
! Single Player
! Dedicated Server
! Hosted Server
! Multiplayer Client
! [[Multiplayer Scripting#Join In Progress|JIP]] MP Client


=== Related commands & functions ===
|-
* [[:Category:Command_Group:_GUI_Control|Commands: General]]
| [[Arma 3: Functions Library|Functions]] with <syntaxhighlight lang="cpp" inline>recompile</syntaxhighlight> {{Link|Arma 3: Functions Library#Attributes 3|attribute}} are recompiled
* [[:Category:Command_Group:_GUI_Control_-_Event_Handlers|Commands: UI Eventhandlers]]<!--
| {{n/a}}
-->{{#if: {{{commands|}}} |  
| 1 <!-- Single Player -->
{{{commands}}}
| 1 <!-- Dedicated Server -->
}}
| 1 <!-- Hosted Server -->
| 1 <!-- Multiplayer Client -->
| 1 <!-- JIP MP Client -->


=== Related User Interface Eventhandlers ===
|-
* [[User_Interface_Event_Handlers#Generic_events|Events: General]]<!--
| [[Arma 3: Functions Library|Functions]] with <syntaxhighlight lang="cpp" inline>preInit</syntaxhighlight> {{Link|Arma 3: Functions Library#Attributes 3|attribute}} are called
-->{{#if: {{{events|}}} |  
| [[Scheduler#Unscheduled Environment|Unscheduled]]
{{{events}}}
| 2 <!-- Single Player -->
}}
| 2 <!-- Dedicated Server -->
| 2 <!-- Hosted Server -->
| 2 <!-- Multiplayer Client -->
| 2 <!-- JIP MP Client -->


== Alphabetical Order ==
|-
{{Feature|Informative|TokenNames common to most controls, such as x, y, w, h, text, idc... can be found [[Arma:_GUI_Configuration#Common_Properties|'''here''']].}}
| Object Init Event Handlers are called
{{Feature|Warning|Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with [https://github.com/7erra/BIKI.VR/blob/master/fnc/generateCTPage.sqf this] config crawler.}}
| [[Scheduler#Unscheduled Environment|Unscheduled]]
{{#tag:syntaxhighlight|#define {{{macro}}} {{{value}}}|lang=cpp}}
| 3 <!-- Single Player -->
| 3 <!-- Dedicated Server -->
| 3 <!-- Hosted Server -->
| 3 <!-- Multiplayer Client -->
| {{Icon|unchecked}} <!-- JIP MP Client -->


|abc start = {{ConfigPage|abc}}
|-
| Expressions of [[Eden Editor: Configuring Attributes|Eden Editor entity attributes]] are called<ref name="isPlayer"><sqf inline>isPlayer _entity</sqf> does not return [[true]] immediately. Once the entity has become a [[player]], it is transferred to the client.</ref>
| [[Scheduler#Unscheduled Environment|Unscheduled]]
| 4 <!-- Single Player -->
| 4 <!-- Dedicated Server -->
| 4 <!-- Hosted Server -->
| {{Icon|unchecked}} <!-- Multiplayer Client -->
| {{Icon|unchecked}} <!-- JIP MP Client -->


|attribute =<nowiki/>
|-
==== {{{name}}} ====
| Object initialisation fields are called
{{#if: {{{mandatory|}}} |{{Feature|important|This attribute is mandatory for the control to work!}}}}
| [[Scheduler#Unscheduled Environment|Unscheduled]]
; Type: [[TokenNameValueTypes|{{{type1}}}]]{{#if: {{{type2|}}} | , [[TokenNameValueTypes|{{{type2}}}]]}}{{#if: {{{type3|}}} | , [[TokenNameValueTypes|{{{type3}}}]]}}{{#if: {{{type4|}}} | , [[TokenNameValueTypes|{{{type4}}}]]}}
| 5 <!-- Single Player -->
; Description: {{#if: {{{description|}}}|{{{description}}}|n/a}}
| 5 <!-- Dedicated Server -->
{{#if: {{{type2|}}}|{{{type1}}} example:}}
| 5 <!-- Hosted Server -->
{{#tag:syntaxhighlight|{{#switch: {{{type1}}}
| 4 <!-- Multiplayer Client -->
| Array = {{{name}}}[] = {{{value1}}};
| 3 <!-- JIP MP Client -->
| Class = {{{value1}}}
 
| {{{name}}} {{=}} {{{value1}}};
|- style="background-color: #95F0AD"
}}|lang="cpp"}}
| [[Event Scripts#init.sqs|init.sqs]] is executed
{{#if: {{{type2|}}}|{{{type2}}} example:
|
{{#tag:syntaxhighlight|{{#switch: {{{type2}}}
| 6 <!-- Single Player -->
| Array = {{{name}}}[] = {{{value2}}};
| <!-- Dedicated Server -->
| Class = {{{value2}}}
| <!-- Hosted Server -->
| {{{name}}} {{=}} {{{value2}}};
| <!-- Multiplayer Client -->
}}|lang=cpp}}}}
| <!-- JIP MP Client -->
{{#if: {{{type3|}}}|{{{type3}}} example:
{{#tag:syntaxhighlight|----
{{#switch: {{{type3}}}
| Array = {{{name}}}[] = {{{value3}}};
| Class = {{{value3}}}
| {{{name}}} {{=}} {{{value3}}};
}}|lang=cpp}}}}
{{#if: {{{type4|}}}|{{{type4}}} example:
{{#tag:syntaxhighlight|----
{{#switch: {{{type4}}}
| Array = {{{name}}}[] = {{{value4}}};
| Class = {{{value4}}}
| {{{name}}} {{=}} {{{value4}}};
}}|lang=cpp}}}}


|abc end = {{ConfigPage|end}}
|- style="background-color: #95F0AD"
| [[Event Scripts#init.sqf|init.sqf]] is executed
| [[Scheduler#Scheduled Environment|Scheduled]]<ref name="enginewaits">Note '''in single player''' that while the environment is [[Scheduler#Scheduled Environment|Scheduled]] ([[canSuspend]] returns true), the engine seems to wait until the script is done executing, essentially behaving similarly to an [[Scheduler#Unscheduled Environment|Unscheduled environment]] - infinite loops will freeze the game, [[uiSleep]] may pause the game for up to ~20s (postInit), [[waitUntil]] can cause catastrophic issues, etc.</ref>
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->


|examples = == Default Classes ==
{{Feature|arma3|'''AddOns:''' Classes need to be initialised first with {{ic|class SomeClass;}}
----
'''Missions:''' Since {{arma3}} v2.02 one can use {{ic|[[import]] SomeClass;}} to initialise a class. In older versions, use {{ic|"Default" [[call]] [[BIS_fnc_exportGUIBaseClasses]];}} and paste the result into the [[Description.ext|description.ext]].}}}}
</includeonly><noinclude>
== Usage ==
<pre>{{User:Lou Montana/Sandbox|mode|arg1=value|arg2=value2|...}}</pre>
{| class="wikitable"
! Mode !! Arguments !! Description !! Example
|-
|-
| rowspan="6" | '''intro''' || macro || Control type macro from [[BIS_fnc_exportGUIBaseClasses]]. || <pre>CT_STATIC</pre>
| Expressions of [[Eden Editor: Configuring Attributes|Eden Editor scenario attributes]] are called<ref name="playerCommandNotAvailable">[[player]] is not available immediately.</ref>
| [[Scheduler#Unscheduled Environment|Unscheduled]]
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->
 
|- style="background-color: #95DEF0"
| Persistent functions are called
|
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->
 
|-
|-
| value || Value of the macro. || <pre>0</pre>
| [[Modules]] are initialised
|
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| {{Icon|unchecked}} <!-- JIP MP Client -->
 
|- style="background-color: #DEF0AD"
| [[Event Scripts#initServer.sqf|initServer.sqf]] is executed
| [[Scheduler#Scheduled Environment|Scheduled]]
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| {{n/a}} <!-- Multiplayer Client -->
| {{n/a}} <!-- JIP MP Client -->
 
|- style="background-color: #DEF0AD"
| [[Event Scripts#initPlayerLocal.sqf|initPlayerLocal.sqf]] is executed
| [[Scheduler#Scheduled Environment|Scheduled]]
| <!-- Single Player -->
| {{n/a}} <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->
 
|- style="background-color: #DEF0AD"
| [[Event Scripts#initPlayerServer.sqf|initPlayerServer.sqf]] is executed on the server
| [[Scheduler#Scheduled Environment|Scheduled]]
| <!-- Single Player -->
| {{n/a}} <!-- Dedicated Server -->
| ?? <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->
 
|-
|-
| description || Some text to give info about the CT. || <pre>This is CT_MAP. It is a map.</pre>
| [[Arma 3: Functions Library|Functions]] with <syntaxhighlight lang="cpp" inline>postInit</syntaxhighlight> {{Link|Arma 3: Functions Library#Attributes 3|attribute}} are called
| [[Scheduler#Scheduled Environment|Scheduled]]<ref name="enginewaits"/>
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->
 
|- style="background-color: #95DEF0"
| [[Event Scripts#init.sqs|init.sqs]] is executed
| [[Scheduler#Scheduled Environment|Scheduled]]
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->
 
|- style="background-color: #95DEF0"
| [[Event Scripts#init.sqf|init.sqf]] is executed
| [[Scheduler#Scheduled Environment|Scheduled]]
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->
 
|-
|-
| gallery || List of images to display in a gallery below the description. || <pre>File:Image.jpg{{!}}This is an image of the control.</pre>
| [[remoteExec]]'s [[Multiplayer Scripting#Join In Progress|JIP]] queue
| {{n/a}}
| {{n/a}} <!-- Single Player -->
| {{n/a}} <!-- Dedicated Server -->
| {{n/a}} <!-- Hosted Server -->
| {{n/a}} <!-- Multiplayer Client -->
| 42 <!-- JIP MP Client -->
 
|- style="background-color: #EEE"
| ''Scenario going''
| {{n/a}}
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->
 
|-
|-
| commands || List of commands associated with the control. ||<pre>* [[:Category:Command_Group:_GUI_Control_-_Controls_Table|Commands: Controls Table]]</pre>
| [[Event Scripts#exit.sqf|exit.sqf]]
|
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->
 
|-
|-
| events || List of UIEH that work on the control. || <pre>* [[User_Interface_Event_Handlers|Events: All]]</pre>
| [[Event Scripts#exit.sqs|exit.sqs]]
|
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->
 
|-
|-
| colspan="4" |
| {{Link|Arma 3: Mission Event Handlers#Ended|"Ended" Mission Event Handler}}
|
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->
 
|-
|-
| '''abc start''' || no arguments || Marks the beggining of the config reference part with the use of the '''attribute''' mode. ||
| {{Link|Arma 3: Mission Event Handlers#MPEnded|"MPEnded" Mission Event Handler}}
|-
|
| colspan="4" |
| <!-- Single Player -->
|-
| <!-- Dedicated Server -->
| rowspan="5" | '''attribute''' || name || Name of the attribute. || <pre>text</pre>
| <!-- Hosted Server -->
|-
| <!-- Multiplayer Client -->
| value1-4 || Possible values of the config entry. Has to match the type given by type1-4. || <pre>"This is a string"</pre>
| <!-- JIP MP Client -->
|-
 
| type1-4 || Type of the respective value. Possible values: Number, String, Array, Class. Each type/value pair gets an example.|| <pre>String</pre>
|-
| description || What does the attribute do? || <pre>This string displays text.</pre>
|-
| mandatory || If defined a yellow warning box will be displayed at the attributes position. Mandatory attributes throw an error in RPT when omitted. || <pre>1</pre>
|-
| colspan="4" |
|-
| '''abc end''' || no arguments || Marks the end of the config reference. ||
|-
| colspan="4" |
|-
| '''examples''' || no arguments || Inserts the header and a disclaimer at this position. ||
|}
|}


You can inspect the generator code for this page by clicking EDIT on the top right. The code starts below this line:<br>
------------------------------------------------------------------------------------------------------------------------
{{User:Lou Montana/Sandbox|intro
|macro = CT_TREE
|value = 1234
|description = Informative text about this control type.
|gallery = File:CT COMBO.jpg {{!}}Example image 1.
File:BIS fnc 3DENDiagFonts example.jpg{{!}}Image 2.
|commands = * command group CT
|events =
* event1
* event2
}}
{{User:Lou Montana/Sandbox|abc start}}
=== T ===
{{User:Lou Montana/Sandbox|attribute
| name=testArray
| value1={1,0,0,1}
| type1=Array
| description=This is a test array to test arrays. {{Feature|important|Notice Me!}}
}}
{{User:Lou Montana/Sandbox|attribute
| name=testAttribute
| value1="test"
| type1=String
| mandatory=1
}}
{{User:Lou Montana/Sandbox|attribute
| name=testClass
| type1=Class
| value1=class ComboScrollBar
{
color[] = {1,1,1,1};
colorActive[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.3};
thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
shadow = 0;
scrollSpeed = 0.06;
width = 0;
height = 0;
autoScrollEnabled = 0;
autoScrollSpeed = -1;
autoScrollDelay = 5;
autoScrollRewind = 0;
};
| type2=Number
| value2=9876
| description=This is a test class to test classes.
}}
{{User:Lou Montana/Sandbox|abc end}}


{{User:Lou Montana/Sandbox|examples}}
== See Also ==
=== RscExample ===
<syntaxhighlight lang="cpp">
class RscExample
{
deletable = 0;
fade = 0;
access = 0;
type = CT_TYPEMACRO;
style = SL_HORZ;
color[] = {1,1,1,0.8};
colorActive[] = {1,1,1,1};
shadow = 0;
x = 0;
y = 0;
w = 0.3;
h = 0.025;
};
</syntaxhighlight>


[[Category:Templates|{{uc:{{PAGENAME}}}}]]
* [[Arma 3: Functions Library]]<!--
</noinclude>
* [[Arma 2: Functions Library]] -->
* [[Arma 3: Remote Execution]], [[BIS_fnc_MP]] <!-- keep? -->
* [[Eden Editor: Configuring Attributes|Eden Editor: Configuring Attributes]]
* [[Event Scripts]]
* [[Scheduler]]

Latest revision as of 01:29, 18 March 2024

Order of Initialisation (use column sorting for respective machine order)
Task Exec Environment Machine
Single Player Dedicated Server Hosted Server Multiplayer Client JIP MP Client
Functions with recompile attribute are recompiled N/A 1 1 1 1 1
Functions with preInit attribute are called Unscheduled 2 2 2 2 2
Object Init Event Handlers are called Unscheduled 3 3 3 3 Unchecked
Expressions of Eden Editor entity attributes are called[1] Unscheduled 4 4 4 Unchecked Unchecked
Object initialisation fields are called Unscheduled 5 5 5 4 3
init.sqs is executed 6
init.sqf is executed Scheduled[2]
Expressions of Eden Editor scenario attributes are called[3] Unscheduled
Persistent functions are called
Modules are initialised Unchecked
initServer.sqf is executed Scheduled N/A N/A
initPlayerLocal.sqf is executed Scheduled N/A
initPlayerServer.sqf is executed on the server Scheduled N/A ??
Functions with postInit attribute are called Scheduled[2]
init.sqs is executed Scheduled
init.sqf is executed Scheduled
remoteExec's JIP queue N/A N/A N/A N/A N/A 42
Scenario going N/A
exit.sqf
exit.sqs
"Ended" Mission Event Handler
"MPEnded" Mission Event Handler


See Also

  1. isPlayer _entity does not return true immediately. Once the entity has become a player, it is transferred to the client.
  2. 2.0 2.1 Note in single player that while the environment is Scheduled (canSuspend returns true), the engine seems to wait until the script is done executing, essentially behaving similarly to an Unscheduled environment - infinite loops will freeze the game, uiSleep may pause the game for up to ~20s (postInit), waitUntil can cause catastrophic issues, etc.
  3. player is not available immediately.