Jump to content
rekkless

How to make WORKING Diary Entries

Recommended Posts

So I've spent the last few weeks making a Team vs Team vs Team mission where 6 players out of the 30 need a working Diary Entry for some additional intel about their character.


I had used the Create Diary entry module in the editor and in all my testing it worked fine. Then on the weekend when we decided to play the mission we rallied the required 30 players onto the server. Went through the briefing only to fine NOT ONE of the players had the Diary Entry work (on the map screen before mission start) on their player which completely killed the mission.

 

Unfortunately this isn't the first time the modules have failed for me. I made a zombie role play mission last year that had diary entries which gave the players background information about their character and their role in the scenario and we found the entries were less than reliable. Especially when it came to players who joined in progress.

 

 

Anyway I've wasted enough of your time with my gripe. Is there a more reliable way of adding specific diary entries for specific players. Can I write something up in notepad and call for it in the units init box in the editor??

 

Or is there a better way of doing it, I just need additional intel for specific players to appear in the map screen (or somewhere else they can refer back to) about their role? I need something bullet proof (well bull proof by ArmA standards) that will work for JIP players as well.

Share this post


Link to post
Share on other sites

I am always stranded from any kind of modules, always write self any code i need.

This way i have most of the time control what's are going about.

 

Writing something for player first of all you need to knew how the players are initialised in MP/SP scenario.

After mission object initialized  a init.sqf will be executed. After that a file called initPlayerLocal.sqf if exist.

 

Those two runs on every client once after connect and mission read for JIP as well.

The difference is the order and  that init.sqf will run for server too.  That is why good practice is to strip some part of code to server only or player only,

using statements like isServer and hasInterface.

 

So keep this in mind and write your own diary record and execute it from one of those two files.

For example i will post what i use, very simple code and how i run this.

 

init.sqf or initPlayerLocal.sqf

if (hasInterface) then {
	0 = [] execVM "scripts\briefing.sqf";
};

 

scripts\briefing.sqf

//Diary  by DaVidoSS
private ["_mission", "_diary_text", "_roles"];
_mission = toUpper (format ["%1",getText (missionconfigfile >> "onLoadName")]);

_diary_text = _mission + "<br/>" + 
format [" Date: %3.%2.%1<br/>",date select 0,date select 1,date select 2]+
format [" Location: %1<br/>",worldName]+
format [" Typ: %1<br/>",getText (missionconfigfile >> "Header" >> "gameType")]+
format [" Players: %1-%2<br/>",getNumber (missionconfigfile >> "Header" >> "minPlayers"),getNumber (missionconfigfile >> "Header" >> "maxPlayers")]+
format [" Authors: %1<br/><br/>",getText (missionconfigfile >> "author")]+
"<br/>"+
"FEATURES:<br/>"+
"- Virtual Arsenal<br/>"+
"- Supply Dropp<br/>"+
"<br/>"+
"THANKS:<br/>"+
"- BIS for his great game<br/>"+
"- engima for his great Civilian and Trafic systems<br/>"+
"- psycho for his great A3 Wounding System<br/>"+
"";

_roles = "<br/>"+
"*********************************************<br/>"+
"NOTES:<br/>"+
"*********************************************<br/>"+
"- Do not respawn on unconsciousness, wait for help<br/>"+
"<br/>"+
"";

waitUntil {!isNull player};
player createDiaryRecord ["Diary", ["Notes",_roles]];
player createDiaryRecord ["Diary", ["Mission brief",
format ["
%1<br/>
Hello Gentleman's!<br/>
<br/>
As you know, we conduct a operations against hostile UAFoN.<br/>
<br/>
Today's task is, to sneak up behind enemy lines.<br/>
After successful infiltration we're on 'stand by' being at HQ disposal.<br/>
Orders form HQ are expected form this stage of mission.<br/>
Our progress, as well as current situation is being constantly monitored by drone..<br/>",worldName]+
"<br/>***********************************************************************************<br/>
<br/>"
]];
player createDiaryRecord ["Diary", [_mission, _diary_text]];

 

Share this post


Link to post
Share on other sites
8 hours ago, davidoss said:

I am always stranded from any kind of modules, always write self any code i need.

This way i have most of the time control what's are going about.

 

Writing something for player first of all you need to knew how the players are initialised in MP/SP scenario.

After mission object initialized  a init.sqf will be executed. After that a file called initPlayerLocal.sqf if exist.

 

Those two runs on every client once after connect and mission read for JIP as well.

The difference is the order and  that init.sqf will run for server too.  That is why good practice is to strip some part of code to server only or player only,

using statements like isServer and hasInterface.

 

So keep this in mind and write your own diary record and execute it from one of those two files.

For example i will post what i use, very simple code and how i run this.

 

 

 

 

 

Thanks mate, Its going to take me some time to syphon through all that to make sense.

 

How do I go about giving that briefing to one specific player.

 

The thing is in the mission Im making the 6 players that need the diary entry need 6 different diary entries.

How do I go about calling each player to the different entry?

Share this post


Link to post
Share on other sites
6 hours ago, rekkless said:

How do I go about calling each player to the different entry?

 

Expanding on the above example by davidoss, you could give each player a variable name (e.g. p1 - p6) in the editor and then use the switch command like this

_diary_text = switch player do {
  	case p1: {"Diary text for player 1"};
  	case p2: {"Diary text for player 2"};
  	default {"Unknown player"}
};

I hope this helps

Share this post


Link to post
Share on other sites

Is it possible to pass whole diary to side? Example:

player createDiaryRecord ["Diary",  
    ["INTEL PACKAGE",    
"<font color='#E61919'>Source 37</font><br/><br/>
Some info of position and movement<br/><br/>

Prediction nubmers of enemy ammunition<br/><br/>
"]  
];

But instead of player, to be the whole side so I dont need to run script for every soldier who have acces to intel info (diary record)? 

I tried east "east" (east) but errors appear of course. Can't understand how this works due to creating task is working great for whole group:

[east, "M4a", [" 
[TASK 1] Aprroach and sabotage<br/><br/> 
", "
[M4a] [sabotage] [hatch] 
", "_mrk"], objNull, "CREATED", -1, true, "boat", false] call BIS_fnc_taskCreate; 

...but for the diary record don't.

Share this post


Link to post
Share on other sites

@NemanjicYou could check what side the player is on: https://community.bistudio.com/wiki/playerSide

 

You could insert example 2 (the switch case) from the above link within this part to select the correct diary script:

On 1/29/2018 at 4:15 PM, davidoss said:

Init.sqf or initPlayerLocal.sqf


if (hasInterface) then {
	0 = [] execVM "scripts\briefing.sqf";
};

 

 

  • 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

×