Lou Montana/Sandbox – User

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "Category:Scripting Commands ArmA2" to "Category:Scripting Commands Arma 2")
m (Update w/ links)
 
(45 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category: Sandbox]]
[[Category: Sandbox]]
{{Feature|informative|To go on [[Initialisation Order]].}}


== Main Page ==
{| class="wikitable sortable align-center align-left-col-1"
|+ Order of Initialisation (use column sorting for respective machine order)
! rowspan="2" class="unsortable" style="text-align: center" | Task
! rowspan="2" | Exec Environment
! rowspan="1" colspan="5" class="unsortable" | Machine
|-
! Single Player
! Dedicated Server
! Hosted Server
! Multiplayer Client
! [[Multiplayer Scripting#Join In Progress|JIP]] MP Client


__NOTOC__
|-
__NOEDITSECTION__
| [[Arma 3: Functions Library|Functions]] with <syntaxhighlight lang="cpp" inline>recompile</syntaxhighlight> {{Link|Arma 3: Functions Library#Attributes 3|attribute}} are recompiled
<!-- Hide page title "Main Page" -->
| {{n/a}}
{{DISPLAYTITLE:<span style="position: absolute; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px)">{{FULLPAGENAME}}</span>}}
| 1 <!-- Single Player -->
| 1 <!-- Dedicated Server -->
| 1 <!-- Hosted Server -->
| 1 <!-- Multiplayer Client -->
| 1 <!-- JIP MP Client -->


{| style="margin: auto; width: 100%; max-width: 75em"
|-
| style="text-align: center |
| [[Arma 3: Functions Library|Functions]] with <syntaxhighlight lang="cpp" inline>preInit</syntaxhighlight> {{Link|Arma 3: Functions Library#Attributes 3|attribute}} are called
<span style="font-size: 1.1em">'''Welcome to the Bohemia Interactive Community Wiki.'''</span><br>
| [[Scheduler#Unscheduled Environment|Unscheduled]]
If you want to start editing the wiki, see [[Getting_Started|Wiki: Getting Started]] and explore the [[#Contribute|Contribute]] section.
| 2 <!-- Single Player -->
| style="width: 200px" | [[Image:Logo_BI_Black.png|center|200px|link=Bohemia Interactive Community:About]]
| 2 <!-- Dedicated Server -->
|}
| 2 <!-- Hosted Server -->
| 2 <!-- Multiplayer Client -->
| 2 <!-- JIP MP Client -->


* [[#Arma Series|Arma Series]]
|-
* [[#DayZ|DayZ]]
| Object Init Event Handlers are called
* [[#Ylands|Ylands]]
| [[Scheduler#Unscheduled Environment|Unscheduled]]
* [[#Take On Series|Take On Series]]
| 3 <!-- Single Player -->
* [[#Carrier Command|Carrier Command]]
| 3 <!-- Dedicated Server -->
| 3 <!-- Hosted Server -->
| 3 <!-- Multiplayer Client -->
| {{Icon|unchecked}} <!-- JIP MP Client -->


|-
| 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 -->


{| class="bikitable"
! colspan="2" |
=== Arma Series ===
|-
|-
| [[Image:Logo A3 black.png|150px|link=ArmA 3|About Arma 3]]
| Object initialisation fields are called
| [[Scheduler#Unscheduled Environment|Unscheduled]]
| 5 <!-- Single Player -->
| 5 <!-- Dedicated Server -->
| 5 <!-- Hosted Server -->
| 4 <!-- Multiplayer Client -->
| 3 <!-- JIP MP Client -->
 
|- style="background-color: #95F0AD"
| [[Event Scripts#init.sqs|init.sqs]] is executed
|
|
==== {{arma3}} ====
| 6 <!-- Single Player -->
:[[:Category:Arma 3: Editing|Editing]]
| <!-- Dedicated Server -->
:[[Introduction to Arma Scripting]]
| <!-- Hosted Server -->
:[[:Category:Scripting Commands Arma 3|Scripting commands]]
| <!-- Multiplayer Client -->
:[[:Category:Arma 3: Functions|Scripting functions]]
| <!-- JIP MP Client -->
:[[Arma 3 Getting Started|Getting started]]
 
:[[Eden Editor]]
|- 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 -->
 
|-
|-
| style="text-align: center" | [[Image:A2_OA_Logo.png|115px|link=:Category:ArmA 2: Operation Arrowhead|About Arma 2: Operation Arrowhead]]
| 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
|
|
==== {{arma2oa}} ====
| <!-- Single Player -->
:[[ArmA 2: Editing|Editing]]
| <!-- Dedicated Server -->
:[[ArmA II Hints and Tips|Hints and tips]]
| <!-- Hosted Server -->
:[[:Category:Scripting Commands Arma 2|Scripting commands]]
| <!-- Multiplayer Client -->
:[[:Category:Arma 2: Multiplayer|Multiplayer]]
| <!-- JIP MP Client -->
|-
 
| [[Image:Logo A2.png|150px|link=ArmA 2|About Arma 2]]
|
==== {{arma2}} ====
:[[ArmA 2: Editing|Editing]]
:[[Arma2: Startup Parameters|Startup parameters]]
:[[:Category:Scripting Commands Arma 2|Scripting commands]]
:[[Mondkalb's Addon Tutorial|Creating Addons]]
|-
| [[Image:Logo A1 black.png|150px|link=ArmA: The Game|About Arma: Armed Assault]]
|
==== {{arma}} ====
:[[ArmA: Editing|Editing]]
:[[:Category:Scripting Commands ArmA|Scripting commands]]
:[[:ArmA: Mission Editing|Mission Editing]]
:[[ArmA: FAQ|FAQ]]
|-
| [[Image:Logo A0.png|150px|link=:Category:Operation_Flashpoint|About Arma: Cold War Assault]]
|
==== {{ofp}} / Arma: Cold War Assault ====
:[[:Category:Operation Flashpoint: Editing|Editing]]
:[[:Category:Operation Flashpoint: Startup Parameters|Startup parameters]]
:[[:Category:Operation Flashpoint: Addons|Addons]]
:[[:Category:Scripting Commands OFP 1.96|Scripting commands]]
|-
! colspan="2" |
=== DayZ ===
|-
| style="text-align: center" | [[File:dayzlogoinv.png|125px|link=DayZ|About DayZ]]
|
==== DayZ ====
:[[:Category:DayZ:Editing|Editing]]
:[[:Category:DayZ: Official Tools|Tools]]
:[[:Category:DayZ:Tutorials|Tutorials]]
:[[:Category:DayZ:Game Mechanics|Game mechanics]]
|-
! colspan="2" |
=== Ylands ===
|-
| [[Image:Ylands_3D_Logo.png|150px|link=Ylands|About Ylands]]
|
==== Ylands ====
:[[Ylands Visual Scripting|Visual Scripting]]
:[[Ylands Editor|Editor]]
:[[Ylands Database|Database]]
:[[Ylands Game Mechanics|Game mechanics]]
|-
! colspan="2" |
=== Take On Series ===
|-
| [[Image:Logo TakOH full.png|150px|link=Take On Helicopters|About Take On Helicopters]]
|
==== {{tkoh}} ====
:[[:Category:Take On Helicopters: Editing| Editing]]
:[[:Category:Scripting Commands Take On Helicopters|Scripting commands]]
:[[:Category:Take On Helicopters: Functions|Scripting functions]]
:[[Functions Library 2.0]]
|-
| [[Image:tkom_logo.png|150px|link=Take On Mars|About Take On Mars]]
|
==== {{tkom}} ====
:[[:Take On Mars: Editor|Editor]]
:[[:Take On Mars: Equipment|Equipment]]
|-
! colspan="2" |
=== Carrier Command ===
|-
|-
| [[Image:CC_Logo.png|150px|link=:Carrier Command: Gaea Mission|About Carrier Command: Gaea Mission]]
| [[Modules]] are initialised
|
|
==== Carrier Command ====
| <!-- Single Player -->
:[[Carrier Command: Gaea Mission: Startup Parameters|Startup Parameters]]
| <!-- Dedicated Server -->
:[[Carrier Command: Gaea Mission: FAQ|FAQ]]
| <!-- Hosted Server -->
:[[:Category:Carrier Command: Official Tools|Official Tools]]
| <!-- Multiplayer Client -->
|}
| {{Icon|unchecked}} <!-- JIP MP Client -->


<div style="display: flex; align-content: flex-start; align-items: flex-start; justify-content: center; flex-wrap: wrap"> <!-- flex container -->
|- style="background-color: #DEF0AD"
<!--- EDITING (GENERAL) --->
| [[Event Scripts#initServer.sqf|initServer.sqf]] is executed
<div class="floating-box">
| [[Scheduler#Scheduled Environment|Scheduled]]
== <div style="text-align: center">Editing (General)</div> ==
| <!-- Single Player -->
:[[Addons]]
| <!-- Dedicated Server -->
:[[Terrain Editing]]
| <!-- Hosted Server -->
:[[Modelling]]
| {{n/a}} <!-- Multiplayer Client -->
:[[:Category:Scripting Topics|Scripting (general)]]
| {{n/a}} <!-- JIP MP Client -->
:[[:Category:Tools|Tools]]
:[[Public Data]]
</div>


<!--- CONTRIBUTE --->
|- style="background-color: #DEF0AD"
<div class="floating-box">
| [[Event Scripts#initPlayerLocal.sqf|initPlayerLocal.sqf]] is executed
== <div style="text-align: center">Contribute</div> ==
| [[Scheduler#Scheduled Environment|Scheduled]]
:[[Getting Started]]
| <!-- Single Player -->
:[[Cheatsheet|Formatting Help & Templates]]
| {{n/a}} <!-- Dedicated Server -->
:[[Bohemia Interactive Community:Guidelines|Guidelines]]
| <!-- Hosted Server -->
:[[Village Pump (todo)|To-do]]
| <!-- Multiplayer Client -->
</div>
| <!-- JIP MP Client -->


<!--- GETTING HELP --->
|- style="background-color: #DEF0AD"
<div class="floating-box">
| [[Event Scripts#initPlayerServer.sqf|initPlayerServer.sqf]] is executed on the server
== <div style="text-align: center">Getting Help</div> ==
| [[Scheduler#Scheduled Environment|Scheduled]]
:[[Troubleshooting|Troubleshooting]]
| <!-- Single Player -->
:[https://forums.bohemia.net/ BIS Forums]
| {{n/a}} <!-- Dedicated Server -->
:[[:Category:Hints & Tips |Hints and Tips]]
| ?? <!-- Hosted Server -->
:[https://discord.gg/Arma Discord]
| <!-- Multiplayer Client -->
</div>
| <!-- JIP MP Client -->


</div><!-- end of flex container -->
|-
| [[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 -->


[[:Category:Community Wiki]]
|- 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 -->


|-
| [[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 -->


|-
| [[Event Scripts#exit.sqf|exit.sqf]]
|
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->


|-
| [[Event Scripts#exit.sqs|exit.sqs]]
|
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->


== Vehicles Speed and Fuel Stats ==
|-
| {{Link|Arma 3: Mission Event Handlers#Ended|"Ended" Mission Event Handler}}
|
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->


{| class="bikitable sortable"
!rowspan="2" | Class !! rowspan="2" | Name !! colspan="4" | Full tank consumption time !! colspan="3" | Speed
|-
|-
! Idle !! slow speed !! medium speed !! max speed !! slow speed !! medium speed !! max speed
| {{Link|Arma 3: Mission Event Handlers#MPEnded|"MPEnded" Mission Event Handler}}
|-
|
| B_Truck_01_mover_F || HEMTT || 05:18:00 || 03:15:00 || 03:38:00 || 03:18:00 || 026,83 km/h || 070,94 km/h || 082,85 km/h
| <!-- Single Player -->
|-
| <!-- Dedicated Server -->
| B_MRAP_01_F || Hunter (unarmed) || 04:33:00 || 02:47:00 || 01:56:00 || 01:44:00 || 037,13 km/h || 099,81 km/h || 116,45 km/h
| <!-- Hosted Server -->
|-
| <!-- Multiplayer Client -->
| B_LSV_01_unarmed_F || Prowler (unarmed) || 04:09:00 || 01:38:00 || 01:50:00 || 01:38:00 || 053,96 km/h || 147,06 km/h || 172,47 km/h
| <!-- JIP MP Client -->
|-
 
| B_Quadbike_01_F || Quad || 01:54:00 || 01:09:00 || 01:12:00 || 01:06:00 || 027,14 km/h || 070,77 km/h || 082,20 km/h
|-
| B_APC_Tracked_01_AA_F || IFV-6a Cheetah || 03:11:00 || 02:07:00 || 02:14:00 || 01:56:00 || 023,31 km/h || 046,31 km/h || 061,07 km/h
|-
| B_APC_Wheeled_01_cannon_F || AMV-7 Marshall || 04:55:00 || 02:58:00 || 02:58:00 || 02:34:00 || 036,20 km/h || 060,41 km/h || 113,00 km/h
|-
| B_APC_Tracked_01_CRV_F || CRV-6e Bobcat || 03:11:00 || 02:05:00 || 02:13:00 || 01:55:00 || 023,31 km/h || 046,31 km/h || 061,07 km/h
|}
|}


Code used:
<spoiler><pre>veh = vehicle player;
wantedDelta = 3;
previousPos = [0,0,0];
currentPos = [0,0,0];
previousFuel = 0;
currentFuel = 0;
t = 0;
onEachFrame {
isNil {
vehSpeed = speed veh;
if (t <= time) then {
previousPos = currentPos;
currentPos = getPosATL veh;
distanceDelta = currentPos distance previousPos;
previousFuel = currentFuel;
currentFuel = fuel veh;
fuelLossPerMinute = (previousFuel - currentFuel) * (60 / (wantedDelta + (time - t)));
remainingTime = if (fuelLossPerMinute > 0) then {
[(currentFuel / fuelLossPerMinute) * 60, "HH:MM:SS"] call BIS_fnc_secondsToString;
} else { -1 };
timeToEmpty = if (fuelLossPerMinute > 0) then {
[(1 / fuelLossPerMinute) * 60, "HH:MM:SS"] call BIS_fnc_secondsToString;
} else { -1 };
t = time + wantedDelta;
};


hintSilent format [
== See Also ==
"Speed: %1\nFuel loss: %2\n\nRemaining time: %3\nTime to empty: %4",
vehSpeed,
fuelLossPerMinute,
remainingTime,
timeToEmpty];


copyToClipboard format ["[%1, %2, %3]", typeOf veh, timeToEmpty, vehSpeed];
* [[Arma 3: Functions Library]]<!--
};
* [[Arma 2: Functions Library]] -->
};
* [[Arma 3: Remote Execution]], [[BIS_fnc_MP]] <!-- keep? -->
</pre></spoiler>
* [[Eden Editor: Configuring Attributes|Eden Editor: Configuring Attributes]]
* [[Event Scripts]]
* [[Scheduler]]

Latest revision as of 00: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.