Because mostly diary entries are text based you likely build something up which includes writing the text into a VS Value string and display it via e.g. object text.
I would suggest the following:
create a definition script in the LUA workspace and add a global table which includes ALL diary entries which are possible in this game:
entries = {
"Some log text about a thing i discovered in the forest next to a skeleton.\nThe text after the word skeleton should be written inside a new line.\nBlah",
"some other entry",
"some next entry"
}
Thats for the database itself.
Now you need to construct the diary itself. I would recommend displaying two pages like in your example video in an interface. Use an open book image as the background image.
Create the interface and assingn an own interface class to it. Make the interface usable for your character.
In this diary interface create two buttons, type action area:
Button: left_side , type: action area
Button: right_side , type: action area
No need for images in here.
Also create 3 Values in the interface:
Value: page_left: default string: TEST LEFT SIDE
Value: page_right: default string: TEST RIGHT SIDE
Value: current_page: default: 1
Create also a new button in the interface, type action area and call it "texts". In this we will setup the diary behaviour.
select the "texts" button and go under its "Actions" tab.
Create a new tab "display_entries", type "called by other action".
When opening the interface via your preferred action, just call after the "show diary" interface the "display_entries" action from the diary interface.
In this "display_entries" action add a "display object text" action part and select the "left_side" object, choose a font and the coordinates for the soon to be displayed text on the left page . As text use "<vs=page_left>" Do the same for the right page and enter "<vs=page_right>" as text and coordinates for the right side text.</vs=page_right></vs=page_left></div>
Now when you go in game and show the inventory, calling the "display_entries" action, it should show TEST LEFT SIDE on the left page and TEST RIGHT SIDE on the right side.
So far so good.
Now we need to make these pages dynamic. Remove the TEST LEFT SIDE, TEST RIGHT SIDE texts from the value strings.
For this we need a new Lua array which will only contain the entries which are "learned" on the characters journey. Go into the lua workspace and add a new table under the "entries" table. Call it e.g. "diary". At start it contains 0 items:
to add an entry from to the diary use a table function whenever you want to put something new into the diary:
table.insert(diary, entries[1])
This would add the content from "entries" table at index 1 to the "diary" table.
Now you can feed the your diary as you wish with new content.
Back to the interface. You need to display the arrows and if clicked on them they need to add/substract 2 pages (because this is a two page display of entries)
Left Click Action - Execute a script, Left arrow Button
if Values["current_page"].Value > 1 then
Values["current_page"].Value -2
startAction(Actions["display_entries"])
end
Left Click Action-Execute a script, Right arrow Button
if #diary > 2 and Values["current_page"].Value < #diary then
Values["current_page"].Value +2
startAction(Actions["display_entries"])
end
this should trigger the clicking only when you are inside the table dimensions.
After each click "display_entries" gets called again. We need to edit this action a bit, so that the entry depending on the current page gets displayed:
Edit "display_entries" action. Before the "display object text" action parts enter an "execute a script" action part:
Values["page_left"].String = diary[current_page]
Values["page_right"].String = diary[current_page+1]
this should update the ValueString just before you display it. to the objects.
----
The End.
-----
Disclaimer :: This was all written out of my head without any testing. There could be something missing or may need some adjustments in the if queries... I hope this all would lead you into the right direction^^