Jump to content
beno_83au

selectDiarySubject Help

Recommended Posts

Hi, I'm trying to bring players to what is intended to be the first topic of a briefing. I've seen the note about selectDiarySubject not working with a recent version of ArmA 3 so I've gone and tried the command and the work-around function but I can't get it to happen. Here's what I've got, minus what would've been a wall of text with all the diary record text:

player createDiarySubject ["description","MIL_DominationDM"];
player createDiarySubject ["features","Features"];

player createDiaryRecord ["features",["Roles","ROLES TEXT"]];
player createDiaryRecord ["features",["Features","FEATURES TEXT"]];

player createDiaryRecord ["description",["Scoring","SCORING TEXT"]];
player createDiaryRecord ["description",["Description","DESCRIPTION TEXT"]];

sleep 0.1;

//function
["description"] call BIS_fnc_selectDiarySubject;
//script command
//player selectDiarySubject "description";

So how have I got this seemingly simple process wrong?

 

Edit:

Larrow's post below offers a good workaround.

https://feedback.bistudio.com/T142552 - Issue raised.

Share this post


Link to post
Share on other sites

The diary is just a set of LnB listboxes.

 

As an example to run from the debugConsole.

Spoiler

h = [] spawn {
	player createDiarySubject ["description","MIL_DominationDM"];
	player createDiarySubject ["features","Features"];
	
	player createDiaryRecord ["features",["Roles","ROLES TEXT"]];
	player createDiaryRecord ["features",["Features","FEATURES TEXT"]];
	
	player createDiaryRecord ["description",["Scoring","SCORING TEXT"]];
	player createDiaryRecord ["description",["Description","DESCRIPTION TEXT"]];
	
	openMap true;
	sleep 0.1;
	
	TAG_fnc_selectedDiaryEntry = {
		params[
			[ "_subject", "", [ "" ] ], 
			[ "_record", "", [ "" ] ]
		];
		
		if ( _subject == "" ) exitWith {
			"No subject given" call BIS_fnc_error;
		};
		
		for "_row" from 0 to ( lnbSize (findDisplay 12 displayCtrl 1001) select 0 ) - 1 do {
			if ( ( findDisplay 12 displayCtrl 1001 ) lnbData[ _row, 0 ] == _subject ) exitWith {
				( findDisplay 12 displayCtrl 1001 ) lnbSetCurSelRow _row;
			};
		};
		
		if !( _record == "" ) then {
			for "_row" from 0 to ( lnbSize (findDisplay 12 displayCtrl 1002) select 0 ) - 1 do {
				if ( (finddisplay 12 displayCtrl 1002) lnbText[_row,0] == _record ) exitWith {
					( findDisplay 12 displayCtrl 1002 ) lnbSetCurSelRow _row;
				};
			};
		};
	};
	
	[ "description", "scoring" ] call TAG_fnc_selectedDiaryEntry;
};

 

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Fantastic @Larrow thanks. I had a look at the function last night and saw that it was all about selecting listbox rows, but I'd exchanged too many empty bottles for full ones by then. I'll trim this down to run specifically for my briefing and use it. Cheers mate.

  • Like 2

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

×