playScriptedMission: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:ArmA 2: New Scripting Commands List\|{{uc:{{PAGENAME}}}}\]\]\s*" to "")
m (Text replacement - "<sqf>([^↵][^<]*↵[^<]*)<\/sqf>" to "<sqf> $1 </sqf>")
 
(38 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma2 |Game name=
|game1= arma2
|version1= 1.00


|1.00|Game version=
|game2= arma2oa
____________________________________________________________________________________________
|version2= 1.50


| 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=
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| '''playScriptedMission''' [world,expression,config,ignoreChildWindow] |SYNTAX=
|game4= arma3
|version4= 0.50


|p1= [world,expression,config,ignoreChildWindow]: [[Array]] -  |PARAMETER1=  
|gr1= System


|p2= world: [[String]] |PARAMETER2=
|descr= Load the given world, launch an empty mission, and execute the given expression.
If provided, ''config'' can reference to the config entry, replacing [[Description.ext]] for this mission.


|p3= expression: [[Code]] |PARAMETER3=
|s1= [[playScriptedMission]] [world, expression, config, ignoreChildWindow]


|p4= config (Optional): [[Config]]|PARAMETER3=
|p1= world: [[String]]


|p5= ignoreChildWindow (Optional): [[Boolean]] |PARAMETER3=
|p2= expression: [[Code]]


| [[Nothing]] |RETURNVALUE=
|p3= config: [[Config]] - (Optional)


|p4= ignoreChildWindow: [[Boolean]] - (Optional)


|x1=  
|r1= [[Nothing]]
<pre>
 
|x1= <sqf>
playScriptedMission
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"
];
];
</pre>|EXAMPLE1=
</sqf>
 
____________________________________________________________________________________________
 
| [[hostMission]], [[playMission]] |SEEALSO=


| |MPBEHAVIOUR=  
|seealso= [[hostMission]] [[playMission]] [[createMissionDisplay]] [[createMPCampaignDisplay]]
____________________________________________________________________________________________
}}
}}


<h3 style='display:none'>Notes</h3>
{{Note
<dl class='command_description'>
|user= SkaceKachna
<!-- Note Section BEGIN -->
|timestamp= 20151231175500
 
|text= For this command to work, you will need to:
<!-- Note Section END -->
# call command with ignoreChildWindow param set to true (in VBS docs its called fromMission)
</dl>
# 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]])
<h3 style='display:none'>Bottom Section</h3>
#* if mission is run from single mission browser, you can just close RscDisplaySingleMission (idd 2)
 
# end mission
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]


<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on December 31, 2015 - 17:55 (UTC)</dd>
<dt class="note">[[User:SkaceKachna|SkaceKachna]]</dt>
<dd class="note">
For this command to work, you will need to<br>
<ol>
<li>call command with ignoreChildWindow param set to true (in VBS docs its called fromMission)</li>
<li>close any opened display (not sure about this part, but closing every display (but #0) seems to work):<br>
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 single mission browser, you can just close RscDisplaySingleMission (idd 2)</li>
<li>end mission</li>
</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;
<sqf>
playScriptedMission ['Stratis',{
disableSerialization;
createCenter west;
playScriptedMission ['Stratis', {
_grp = createGroup west;
private _grp = createGroup west;
_player = _grp createUnit ["B_Soldier_F",[0,0,0],[],0,"NONE"];
private _player = _grp createUnit ["B_Soldier_F", [0,0,0], [], 0, "NONE"];
selectPlayer _player;
selectPlayer _player;
},missionConfigFile, true];
}, missionConfigFile, true];


//Close all displays that could be the background display ... this is essentialy forceEnd command
// Close all displays that could be the background display ... this is essentially forceEnd command
//Closing #0 will cause game to fail
// Closing #0 will cause game to fail
_zero = findDisplay(0);
_zero = findDisplay 0;
{
{
if (_x != _zero) then {
if (_x != _zero) then {
Line 98: Line 77:
};
};
} foreach allDisplays;
} foreach allDisplays;
 
failMission "END1";
failMission "END1";</nowiki></code>
</sqf>
(tested in Arma 3 1.54.133741)
(tested in {{arma3}} 1.54.133741)
</dd>
}}
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 19:42, 3 September 2024

Hover & click on the images for description

Description

Description:
Load the given world, launch an empty mission, and execute the given expression. If provided, config 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: Config - (Optional)
ignoreChildWindow: Boolean - (Optional)
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:
hostMission playMission createMissionDisplay createMPCampaignDisplay

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
SkaceKachna - c
Posted on Dec 31, 2015 - 17:55 (UTC)
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 essentially 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)