Jump to content
Sign in to follow this  
coolfact

Remove diaryrecords?

Recommended Posts

A while back I found this piece of code (can't remember where), I believe it's used to delete diaryrecord. However I am not familiar with GUI, so if someone is able to help me get started I would be grateful.

//Remove Diary
class RscDisplayDiary {
    idd = 129;
    movingEnable = 0;

    class Controls {
        delete Diary;
        delete DiaryIndex;
        delete B_Quit;
        delete B_Add;
        delete DiaryPage;
        delete DiaryTitle;
        delete DiaryBackground;
    };
};

Share this post


Link to post
Share on other sites

Okay found the source of the code from a DayZ Github, where it's stated in line (426-440), still can't find where this piece of code getting called. Is there any coders with knowledge about DayZ code which can help me?

Share this post


Link to post
Share on other sites

 

A while back I found this piece of code (can't remember where), I believe it's used to delete diaryrecord. However I am not familiar with GUI, so if someone is able to help me get started I would be grateful.

//Remove Diary
class RscDisplayDiary {
    idd = 129;
    movingEnable = 0;

    class Controls {
        delete Diary;
        delete DiaryIndex;
        delete B_Quit;
        delete B_Add;
        delete DiaryPage;
        delete DiaryTitle;
        delete DiaryBackground;
    };
};

 

This is config file. Not sqf script. You would need to pack this into an addon.

Share this post


Link to post
Share on other sites

I am gravedigging this thread, because I have the same question and I am unable to find results.

 

Did anyone ever manage to remove a created diary record? Not necessarily all at once, but a certain topic? So far I am unable to produce anything that works.

Share this post


Link to post
Share on other sites

Maybe use tasks for information that will be changing during the mission instead?  Can you set them to nil?

Share this post


Link to post
Share on other sites

But tasks would appear under the tasks tab and I don't think it's possible to move them somewhere else.

Share this post


Link to post
Share on other sites

Sure, but that's more important to you?  Removing the information or having information in the "wrong" spot.

Share this post


Link to post
Share on other sites

Removing the information. :D

 

I mean, I could as well just add a new diary entry and keep the old one... but then it will be "out of order", which probably annoys the hell out of me at some point.

 

Weird how there apparently is no native solution for removing a diary entry. Did nobody ever need this?

 

/Edit: Alternative would be to update the existing text. But I'll guess this isn't possible either?

 

 

/Edit2: Going the way of the first post (via Rsc stuff) would be an option too, but honestly, I have no idea how to work with this RscDisplayMain stuff.

Share this post


Link to post
Share on other sites

brute force time

This will prevent the player from selecting the desired diary subject (unless they click like a mad man but even then it will appear for less than a second). It won't hide the subjects name either.

h =[] spawn {
	waitUntil {!isNull (findDisplay 12)}; 
	disableSerialization; 


	_a = player createDiarySubject ["testPage1","My page 1"];
	_b = player createDiarySubject ["testPage2","My page 2"];
	player createDiaryRecord ["testPage1", ["Intel", "TEST 1 "]];
	player createDiaryRecord ["testPage2", ["Intel", "TEST 2"]];
	INDEX = [_a];

	["HGF", "onEachFrame", {
		{
			((findDisplay 12) displayCtrl 1001) lbSetData [(_x-2), ""];
		} forEach INDEX;
	}] call BIS_fnc_addStackedEventHandler;
};

I originally tried to delete the subject from the listbox but it seemed to add it back each time and prevent me from selecting any further custom subject:

h = [] spawn {
	waitUntil {!isNull (findDisplay 12)}; 
	disableSerialization; 


	_a = player createDiarySubject ["testPage1","My page 1"];
	_b = player createDiarySubject ["testPage2","My page 2"];
	player createDiaryRecord ["testPage1", ["Intel", "TEST 1 "]];
	player createDiaryRecord ["testPage2", ["Intel", "TEST 2"]];
	INDEX = [_a];

	["HGF", "onEachFrame", {
		{
			((findDisplay 12) displayCtrl 1001) lbDelete (_x-2);
		} forEach INDEX;
	}] call BIS_fnc_addStackedEventHandler;
};

Share this post


Link to post
Share on other sites

Some time ago I attempted to overwrite/erase diary/briefing records... I failed :)

 

I searched through uinamespace, mission namespace and local player object namespace. no data related in there

Share this post


Link to post
Share on other sites

afaik there is no way to remove entry once added. Sort of like when you add record to a real life paper diary it stays there and you could only add more.

Share this post


Link to post
Share on other sites

I can always remove a page from a paper diary. Besides, it's the year 2035- we ain't using no paper diary no more. :>

 

Tried hallyg's stuff above. It actually kind of works in a limited way. Funny enough, with the first one I am not only adding two new pages, but also removing the Team-tab.

Share this post


Link to post
Share on other sites

Update. (Literally)

 

As I just found out by accident... It's actually extremely easy to *update* an existing diary entry. Just create a new diary record without changing the title. This will add the new text to the top of the exiting one. Use like this:

    player createDiaryRecord ["Diary", [localize "STR_A3_diary_situation_title", "original text is here"]];
    player createDiaryRecord ["Diary", [localize "STR_A3_diary_situation_title", "test1"]];
    player createDiaryRecord ["Diary", [localize "STR_A3_diary_situation_title", "test2"]];

It's not removing an entry, but at least it updates the existing without cluttering up the menu too much...

  • Like 1

Share this post


Link to post
Share on other sites

An overhaul to the diary system is long due.

Or best a replacement for it.

I'd rather set up my own dialog to display information than using the diary.

Glad you got it sorted.

 

Cheers

  • Like 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
Sign in to follow this  

×