playScriptedMission: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Fix formatting)
Line 9: Line 9:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Load the given world, launch an empty mission and execute the given, expression. Config (optional) can reference to the config entry, replacing description.ext for this mission. |DESCRIPTION=
| Load the given world, launch an empty mission and execute the given, expression.
Config (optional) can reference to the config entry, replacing [[Description.ext]] for this mission. |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| '''playScriptedMission''' [world,expression,config,ignoreChildWindow] |SYNTAX=
| '''playScriptedMission''' [world, expression, config, ignoreChildWindow] |SYNTAX=


|p1= [world,expression,config,ignoreChildWindow]: [[Array]] |PARAMETER1=  
|p1= world: [[String]] |PARAMETER1=


|p2= world: [[String]] |PARAMETER2=  
|p2= expression: [[Code]] |PARAMETER2=


|p3= expression: [[Code]] |PARAMETER3=  
|p3= config (Optional): [[Config]]|PARAMETER3=


|p4= config (Optional): [[Config]]|PARAMETER4=
|p4= ignoreChildWindow (Optional): [[Boolean]] |PARAMETER4=
 
|p5= ignoreChildWindow (Optional): [[Boolean]] |PARAMETER5=  


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


 
|x1= <code>[[playScriptedMission]]
|x1=  
<code>
playScriptedMission
[
[
"desert_e",
"desert_e",
{
{
private["_handle"];
[[execVM]] "\ca\missions_e\data\scenes\credits1\init.sqf";
_handle = execVM "\ca\missions_e\data\scenes\credits1\init.sqf";
},
},
configFile/"CfgMissions"/"Cutscenes"/"Credits"
[[configFile]] / "CfgMissions" / "Cutscenes" / "Credits"
];
];
</code>|EXAMPLE1=  
</code> |EXAMPLE1=
 
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[hostMission]], [[playMission]] |SEEALSO=  
| [[hostMission]], [[playMission]] |SEEALSO=
____________________________________________________________________________________________
}}
}}


Line 55: Line 48:
<h3 style='display:none'>Bottom Section</h3>
<h3 style='display:none'>Bottom Section</h3>


[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]


<!-- CONTINUE Notes -->
<!-- CONTINUE Notes -->
Line 65: Line 56:
<dt class="note">[[User:SkaceKachna|SkaceKachna]]</dt>
<dt class="note">[[User:SkaceKachna|SkaceKachna]]</dt>
<dd class="note">
<dd class="note">
For this command to work, you will need to<br>
For this command to work, you will need to:
<ol>
 
<li>call command with ignoreChildWindow param set to true (in VBS docs its called fromMission)</li>
# call command with ignoreChildWindow param set to true (in VBS docs its called fromMission)
<li>close any opened display (not sure about this part, but closing every display (but #0) seems to work):<br>
# close any opened display (not sure about this part, but closing every display (but #0) seems to work):
If mission is run from 2D editor, you can just close RscDisplayArcadeMap display (idd 26) (because this was done from 2D editor, so RscDisplayArcadeMap is still active in background -- [[user:benargee|benargee]])</li>
#* If mission is run from 2D editor, you can just close RscDisplayArcadeMap display (idd 26) (because this was done from 2D editor, so RscDisplayArcadeMap is still active in background -- [[user:benargee|benargee]])
If mission is run from single mission browser, you can just close RscDisplaySingleMission (idd 2)</li>
#* If mission is run from single mission browser, you can just close RscDisplaySingleMission (idd 2)
<li>end mission</li>
# end mission
</ol>
 
Debriefing will show and player will be moved to new mission after clicking on Continue.<br><br>
Debriefing will show and player will be moved to new mission after clicking on Continue.<br><br>


Command is a bit bugged:
Command is a bit bugged:
<ul>
* Third (config) param doesn't seem to work
<li>Third (config) param doesn't seem to work</li>
* If you run this command in mission loaded from pbo, said pbo won't be writable until you close the game (you can't update it)
<li>If you run this command in mission loaded from pbo, said pbo won't be writable until you close the game (you can't update it)</li>
</ul><br>


Following code will change change island to Stratis and spawns player as basic soldier at [0,0,0] coordinates.
Following code will change change island to Stratis and spawns player as basic soldier at [0,0,0] coordinates.
<code><nowiki>disableSerialization;
<code>[[disableSerialization]];
playScriptedMission ['Stratis',{
[[playScriptedMission]] ['Stratis', {
createCenter west;
[[private]] _grp = [[createGroup]] [[west]];
_grp = createGroup west;
[[private]] _player = _grp [[createUnit]] ["B_Soldier_F", [0,0,0], [], 0, "NONE"];
_player = _grp createUnit ["B_Soldier_F",[0,0,0],[],0,"NONE"];
[[selectPlayer]] _player;
selectPlayer _player;
}, [[missionConfigFile]], [[true]]];<br>
},missionConfigFile, true];
{{cc|Close all displays that could be the background display ... this is essentialy [[forceEnd]] command}}
 
{{cc|Closing #0 will cause game to fail}}
//Close all displays that could be the background display ... this is essentialy forceEnd command
_zero = [[findDisplay]] 0;
//Closing #0 will cause game to fail
_zero = findDisplay(0);
{
{
if (_x != _zero) then {
[[if]] (_x != _zero) [[then]] {
_x closeDisplay 1;
_x [[closeDisplay]] 1;
};
};
} foreach allDisplays;
} [[foreach]] [[allDisplays]];<br>
 
[[failMission]] "END1";</code>
failMission "END1";</nowiki></code>
(tested in {{arma3}} 1.54.133741)
(tested in Arma 3 1.54.133741)
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->
<!-- DISCONTINUE Notes -->

Revision as of 15:19, 22 December 2020

Hover & click on the images for description

Description

Description:
Load the given world, launch an empty mission and execute the given, expression. Config (optional) can reference to the config entry, replacing Description.ext for this mission.
Groups:
System

Syntax

Syntax:
playScriptedMission [world, expression, config, ignoreChildWindow]
Parameters:
world: String
expression: Code
config (Optional): Config
ignoreChildWindow (Optional): Boolean
Return Value:
Nothing

Examples

Example 1:
playScriptedMission [ "desert_e", { execVM "\ca\missions_e\data\scenes\credits1\init.sqf"; }, configFile / "CfgMissions" / "Cutscenes" / "Credits" ];

Additional Information

See also:
hostMissionplayMission

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

Notes

Bottom Section

Posted on December 31, 2015 - 17:55 (UTC)
SkaceKachna
For this command to work, you will need to:
  1. call command with ignoreChildWindow param set to true (in VBS docs its called fromMission)
  2. close any opened display (not sure about this part, but closing every display (but #0) seems to work):
    • If mission is run from 2D editor, you can just close RscDisplayArcadeMap display (idd 26) (because this was done from 2D editor, so RscDisplayArcadeMap is still active in background -- benargee)
    • If mission is run from single mission browser, you can just close RscDisplaySingleMission (idd 2)
  3. end mission
Debriefing will show and player will be moved to new mission after clicking on Continue.

Command is a bit bugged:
  • Third (config) param doesn't seem to work
  • If you run this command in mission loaded from pbo, said pbo won't be writable until you close the game (you can't update it)
Following code will change change island to Stratis and spawns player as basic soldier at [0,0,0] coordinates. disableSerialization; playScriptedMission ['Stratis', { private _grp = createGroup west; private _player = _grp createUnit ["B_Soldier_F", [0,0,0], [], 0, "NONE"]; selectPlayer _player; }, missionConfigFile, true];
// Close all displays that could be the background display ... this is essentialy forceEnd command // Closing #0 will cause game to fail _zero = findDisplay 0; { if (_x != _zero) then { _x closeDisplay 1; }; } foreach allDisplays;
failMission "END1";
(tested in Arma 3 1.54.133741)