Jump to content

Recommended Posts

My briefing is showing up if I run my mission on my PC but does not show up if I put my mission on a dedicated server. I am just starting to work with briefings so I have a few questions.

 

1. Must briefings be named "Briefing" or can it be named anything? My briefing is in the file: addBriefing.sqf

 

2. Must briefings be in the mission root or can they be in a subdirectory?

 

3. I have my code that calls addBriefing.sqf in the initPlayerLocal.sqf file. The code waits to run until the server is ready.

i.e. waitUntil{sleep 1; !isNil "ServerReady"};

Must the briefing code run right away or can it be delayed in this manner?

 

4. Before setting the serverReady variable to true and making it a publicVariable the server sets another variable and makes it a publicVariable so that the briefing code can use its value to create a somewhat dynamic briefing. Is this okay?

 

The initServer.sqf calls "scripts\common\initVariables.sqf" which contains the publicVariable used by the briefing code:

if(!isServer) exitWith {};

spotterChance = floor random 100;
publicVariable "spotterChance";

Based on the contents of missionPath a addBriefing.sqf is run.

i.e. [] execVM (missionPath + "addBriefing.sqf");

 

example of addBriefing.sqf:

private _satReliability = [] call satReliability;

player createDiaryRecord ["Diary", ["Mission",
"<img image='pictures\header.jpg' width='350' height='66'/><br/>
Your mission:<br/><br/>
There is a scientist working on a deadly nerve agent.<br/>
Command does not want him to finish. His position<br/>
is marked on your map. Go take him out.<br/>
<br/>
The defence satellite application program is " + _satReliability]];

The first part of the addBriefing.sqf calls satReliability.

private _satReliability = "working well.";
if(spotterChance < 91) then {_satReliability = "fairly good.";};
if(spotterChance < 76) then {_satReliability = "spotty.";};
if(spotterChance < 51) then {_satReliability = "flaky today.";};
if(spotterChance < 21) then {_satReliability = "nearly down.";};

_satReliability

 

Share this post


Link to post
Share on other sites

Check your description.ext for briefing = 1. And Biki says - "If no briefing.html is present, it is skipped anyway."  - I'm not sure this is still valid but try and create an empty briefing.html on your mission root.

Share this post


Link to post
Share on other sites
11 hours ago, RCA3 said:

Check your description.ext for briefing = 1. And Biki says - "If no briefing.html is present, it is skipped anyway."  - I'm not sure this is still valid but try and create an empty briefing.html on your mission root.

 

Briefing.html is not valid for Arma 3 and thus not needed. See https://community.bistudio.com/wiki/Briefing.html

 

Execute your briefing script via initPlayerLocal.sqf. This will ensure it's added locally for each player that joins the mission.


See also: https://community.bistudio.com/wiki/Briefing.html

 

  • Like 2

Share this post


Link to post
Share on other sites
3 hours ago, R3vo said:

 

Briefing.html is not valid for Arma 3 and thus not needed. See https://community.bistudio.com/wiki/Briefing.html

 

Execute your briefing script via initPlayerLocal.sqf. This will ensure it's added locally for each player that joins the mission.


See also: https://community.bistudio.com/wiki/Briefing.html

 

Thanks R3vo, I am executing my briefing from initPlayerLocal.sqf. With further testing I have discovered that if I exclude the "The defence satellite application program is " + _satReliability line it works.  Am I concatenating the strings wrong for the Briefing.sqf method? 

Share this post


Link to post
Share on other sites
4 hours ago, R3vo said:

Try with format then. It could also be that initPlayerLocal.sqf is executed before initServer.sqf thus your variable does not exist when the briefing code is executed. See https://community.bistudio.com/wiki/Initialization_Order ("order is not guaranteed")

Thanks, I'll try format. For now I found a work around. I wrote a separate method that uses a switch/case construct to create the diary records. It's grossly inefficient but allows me to move forward.

switch (satReliability) do {
	case 1: {
		player createDiaryRecord ["Diary", ["Situation",
		"<img image='images\header.jpg' width='350' height='66'/><br/>
		Situation:<br/><br/>
		The defence satellite application program is nearly down so<br/>
		be careful."]];
	};
	
	case 2: {
		player createDiaryRecord ["Diary", ["Situation",
		"<img image='images\header.jpg' width='350' height='66'/><br/>
		Situation:<br/><br/>
		The defence satellite application program is flaky today so<br/>
		don't depend on getting accurate information."]];	
	};
	
	case 3: {
		player createDiaryRecord ["Diary", ["Situation",
		"<img image='images\header.jpg' width='350' height='66'/><br/>
		Situation:<br/><br/>
		Be aware, the defence satellite application program is spotty today."]];	
	};
	
	case 4: {
		player createDiaryRecord ["Diary", ["Situation",
		"<img image='images\header.jpg' width='350' height='66'/><br/>
		Situation:<br/><br/>
		The defence satellite application program is working fairly well."]];	
	};
	
	case 5: {
		player createDiaryRecord ["Diary", ["Situation",
		"<img image='images\header.jpg' width='350' height='66'/><br/>
		Situation:<br/><br/>
		The defence satellite application program working well today."]];	
	};
};

I tried using the <var><var/> like html but no joy.  I'll try format. Thanks. 

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

×