Jump to content

Recommended Posts

Hiya everyone.
 

My aim is to make an animated briefing in a multiplayer mission using the ORBAT. 


To start off, I want to be able to call BIS_fnc_ORBATOpen during the initial briefing screen. 

I've adapted the example from the BIKI: https://community.bistudio.com/wiki/BIS_fnc_ORBATOpen

But this expression only works if it's run from the debug console during a mission. Not in the initial briefing screen, which, let's face it, is the only time players will want to look at an ORBAT. If used there, Arma will hard lock to a black screen, without an error in the RPT. You need to cntrl-alt-del to manually end the program.
 

Turns out the initial briefing screen and map screen have different IDDs. So I drafted this expression, which creates a diary record with the the words "Open ORBAT". When clicked, it checks whether the mission has already started, and then chooses the expression with the appropriate IDD. Please excuse my excessive indentation:
 

player createDiaryRecord ["Diary", ["Situation"," // diary record

	<execute expression=' // execute code when clicking text
		if (time > 0) then 
			{ 
				[ configFile >> ""CfgORBAT"" >> ""BIS"" >> ""O_Brigade"",findDisplay 46, [], 4, [""ConfigClass_1"",{systemChat ""ConfigClass_1""}] ] call BIS_fnc_ORBATOpen;
			}
		else 
			{
				[ configFile >> ""CfgORBAT"" >> ""BIS"" >> ""O_Brigade"",findDisplay 37, [], 4, [""ConfigClass_1"",{systemChat ""ConfigClass_1""}] ] call BIS_fnc_ORBATOpen;	
			}
	'>	
	Open ORBAT // the bit of text
	</execute>
"], taskNull, "", false];

However, although this expression works in singleplayer, it does not in multiplayer.

The list https://community.bistudio.com/wiki/Arma_3:_IDD_List says IDD 53 should work. But it doesn't. 
 

So my question is: what is the correct IDD for the initial briefing screen of clients in multiplayer?

(or am I missing something else entirely?)

with thanks,

 

Share this post


Link to post
Share on other sites

Hi everyone. 
After getting some help elsewhere, I've gotten a working piece of code. 

I wasn't being very sharp, and forgot that when hosting locally (eg Eden "Play in Multiplayer") you are the server, not the client. So IDD 53 would have not worked in my test case, but 52 did.
The code has been amended to check for server, client, briefing screen, or mission start.
===
Long story short: this will allow players to click a piece of text and see a specific ORBAT entry. Enter this into your initplayerlocal.sqf file:

player createDiaryRecord ["Diary", ["Situation"," 
 
    <execute expression=' 
        [ configFile >> ""CfgORBAT"" >> ""BIS"" >> ""O_Brigade"", findDisplay (if (isMultiplayer &amp;&amp; {getClientState isEqualTo ""BRIEFING SHOWN""}) then { [53, 52] select isServer } else { [37, 46] select (time > 0) }), [], 4, [""ConfigClass_1"",{systemChat ""ConfigClass_1""}] ] call BIS_fnc_ORBATOpen;
    '>     
    Open ORBAT 
    </execute> 
"], taskNull, "", false];

 
See other pages for information on how to write your own ORBAT entries, such as this one: 

 
Enjoy!

  • Like 3

Share this post


Link to post
Share on other sites

Thanks. Do you know why you can't write  &&   in condition, but   &amp;&amp;   works (also and ) ?

 

Share this post


Link to post
Share on other sites
43 minutes ago, pierremgi said:

Thanks. Do you know why you can't write  &&   in condition, but   &amp;&amp;   works (also and ) ?

  

createDiaryRecord is picky when it comes to special characters, it prefers the html character entities like &amp; or &#38; instead of the character & itself.

Not sure why it's like this, maybe it was simply an easy way to implement a parser 🤔

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×