Journal - Hirato/lamiae GitHub Wiki

The journal serves a very important function in any RPGs, it records quests, your objectives, your goals, as well as what you have accomplished.

They are sorted by their status in the order of the JRN enum, and then in reverse orde by name, the initial idea is to have higher numbered/newer ones at the top as opposed to lower in the chain during display.

Adding a journal entry

The journals are divided into topics/buckets, and these consist of one or more journal entries reflecting your last action or info dump on this topic.

r_journal_record bucket[s] entry[s] state[i]
- Bucket defines the name of the topic
- entry defines the text you wish to add into the topic
- state is an optional parameter that sets the state if a value >= 0 is provided.

JRN_ACCEPTED  - quests you have formally accepted.
JRN_RUMOUR    - rumours, hearsay, notes.
JRN_MENTIONED - possible quests that have not actually been accepted
JRN_COMPLETED - quests you've completed successfully
JRN_BOTCHED   - quests you have failed

New topics are initiated with theJRN_RUMOUR state. If they didn't exist prior, and if a state wasn't explicitly provided.

Do take care when writing the actual entries, once created, they cannot be removed, and this isby design.

Starting the game with some entries

If you want to start off your game with some initial journal, create them via the "spawn" signal inside the player's script, or use the map's "load" signal.

Depending on some circumstancse, you should consider using global/local variables to inhibit multiple journal entries. Such as when you're using the load singla on a map which doesn't persist.

Example

r_journal_record "fall by the sword" "Someone named Hendrick is looking for an adventuer to retrieve an old magical weapon described in the times of Legend" $JRN_MENTIONED

r_journal_record "fall by the sword" "I have found the weapon that hendrick was looking for." $JRN_ACCEPTED.

r_journal_record "fall by the sword" "I have decided to keep the sword, Hendrick wasn't particularly happy" $JRN_BOTCHED