In my game, I have one of my characters write Journal entries as a quick and easy way to convey large amounts of information to the player, rather than toss out a long cutscene of multiple pages of dialog, and it has the added benefit of being something they can go back and easily reference in the future, as needed, in case they stop playing the game for a while and then want to pick it back up and have no idea who or what they were doing anymore. (I can't be the only person in the world who suffers from this problem with games, am I?)
One nice thing I've found is the VisuStella CommonEventMenu with lets me write each Journal Entry as a separate common event, and then call the menu to display them so the user can select which journal they'd like to read. My question here is, can someone help me with a little javascript to create my menu properly?
In game I have a variable for "0003 Journal Entries Written", which tracks how many entries the character has written in the story so far. In the CommonEventMenu plugin, you specify which events you want to have accessible by the menu, and there's an area there where you can add custom javascript.
What I need is the simple little javascript routine to load event IDs from 3 (the start element of my Journals in the Common Event database) to 2 + "0003 Journal Entries Written" (the variable which tracks how many entries have been written by the character -- note the 2 here, as when we write our first entry, the variable is stored as 1, and we only need to get elements [3] to [3]. No base 0 at work here.).
Is this something that can be done fairly easily? I can already see a workaround which I *could* implement, if necessary, which would focus a lot on IF conditions...
IF "0003 Journal Entries Written" == 1 THEN
setup event with only 1 entry
Exit Processing
END IF
IF "0003 Journal Entries Written" == 2 THEN
setup event with 2 entries
Exit Processing
END IF
IF "0003 Journal Entries Written" == 3 THEN
setup event with 3 entries
Exit Processing
END IF
It's messy, but it doesn't involve any knowledge of JS. I just think there has to be an easier way than the solution I've came up with, and I'm betting it involves that segment where you can add custom JS to the setup...
Unfortunately, I don't know much JS, so I'm just hoping someone here could help me fill in that missing blank for me, before I end up having to go about doing things the long and dirty way. 😉
One nice thing I've found is the VisuStella CommonEventMenu with lets me write each Journal Entry as a separate common event, and then call the menu to display them so the user can select which journal they'd like to read. My question here is, can someone help me with a little javascript to create my menu properly?
In game I have a variable for "0003 Journal Entries Written", which tracks how many entries the character has written in the story so far. In the CommonEventMenu plugin, you specify which events you want to have accessible by the menu, and there's an area there where you can add custom javascript.
// Declare Variables
let list = [];
// Add Common Event ID's
// Return List
return list;
What I need is the simple little javascript routine to load event IDs from 3 (the start element of my Journals in the Common Event database) to 2 + "0003 Journal Entries Written" (the variable which tracks how many entries have been written by the character -- note the 2 here, as when we write our first entry, the variable is stored as 1, and we only need to get elements [3] to [3]. No base 0 at work here.).
Is this something that can be done fairly easily? I can already see a workaround which I *could* implement, if necessary, which would focus a lot on IF conditions...
IF "0003 Journal Entries Written" == 1 THEN
setup event with only 1 entry
Exit Processing
END IF
IF "0003 Journal Entries Written" == 2 THEN
setup event with 2 entries
Exit Processing
END IF
IF "0003 Journal Entries Written" == 3 THEN
setup event with 3 entries
Exit Processing
END IF
It's messy, but it doesn't involve any knowledge of JS. I just think there has to be an easier way than the solution I've came up with, and I'm betting it involves that segment where you can add custom JS to the setup...
Unfortunately, I don't know much JS, so I'm just hoping someone here could help me fill in that missing blank for me, before I end up having to go about doing things the long and dirty way. 😉