I'm very new to Javascript and object-oriented programming, so forgive me if I sound really dumb.
I'm trying to create a journal to which players can add their own journal entries. The journal will contain the following information:
I then created the following script.
Now this is working... sorta. If the game is running, it adds the entry and I can even get the NPCs to repeat the date back. However, when I close the game, the data resets and the new entry disappears.
The other thing I'm realizing as I work on this is that I need the data to save dynamically to the game and not to the primary JSON file. I thought maybe the DoubleX Dynamic Data plugin might help. However, I put in the following command and it isn't adding the new journal entry date the way I thought it would.
So yeah. I feel like I'm moving in the right direction. However, I'm so new to all of this, that I feel like I'm swimming through pudding trying to figure it out.
I'm trying to create a journal to which players can add their own journal entries. The journal will contain the following information:
- Journal Entry Date (Example: 01/01/2023)
- States Affecting the Character at the Time (Example: Poisoned)
- Tasks Accomplished
[
null,
{"id":1,"entryDate":"01/01/2023"},
{"id":2,"entryDate":"01/09/2023"},
{"id":3,"entryDate":"01/10/2023"}
]
null,
{"id":1,"entryDate":"01/01/2023"},
{"id":2,"entryDate":"01/09/2023"},
{"id":3,"entryDate":"01/10/2023"}
]
I then created the following script.
var jsonJournalEntry = $dataJournalEntry
jsonJournalEntry.push({"id": 4, "entryDate": "01/13/2023"});
jsonJournalEntry.push({"id": 4, "entryDate": "01/13/2023"});
Now this is working... sorta. If the game is running, it adds the entry and I can even get the NPCs to repeat the date back. However, when I close the game, the data resets and the new entry disappears.
The other thing I'm realizing as I work on this is that I need the data to save dynamically to the game and not to the primary JSON file. I thought maybe the DoubleX Dynamic Data plugin might help. However, I put in the following command and it isn't adding the new journal entry date the way I thought it would.
$gameSystem.setDynamicData("$dataJournalEntry", $dataJournalEntry[4])
So yeah. I feel like I'm moving in the right direction. However, I'm so new to all of this, that I feel like I'm swimming through pudding trying to figure it out.