OK What I have in mind isn't exactly inventory as such. What I have in mind more is 'you click on this thing to have a list that populates when you encounter things that the player will want history on.'
I might want to ask how specifically to do that, but right now I just want to be able to mouse to the side or above or below the actual story area, click a button, then get a list of things players can view at their leisure, potentially with flags that trip if you look at them.
Comments
StoryMenu
Since I'm going more for a guidebook approach here is what i want.
Person clicks on snippit. In that snippit are a few things I will want people to read about.
How do i indicate an event where the guidebook has new items in it (text blinking till clicked, text blurring in and out, or something) and have entries only pop up if you click on story snippits that have items you want to go into length about?
I'd almost want to say treat it like a table of contents that populates with thigns as you get there.
That actually isn't a bad idea either since it means you can go back to different nodes and see if different paths can be taken.
I like that i can populate a sidebar with Things since I can have a separate inventory and guidebook.
Should get you started. It works pretty well. You can make adjustments to suit your needs.
How are you tracking that journal entries are discovered? That will, obviously, shape the mechanics of how the journal page is populated. If you don't know that yet, then that's the first thing you need to think about.
It could be as simple as something like setting some kind of boolean flag. As an example, say you wanted to track whether the player had found an autopsy report and decided to use a $variable to do so. First, you'd want to initialize it to false in the StoryInit special passage. Then, whenever the player has discovered the report, you simply set the $variable to true: In your journal passage, you'd just test the value of the associated $variable. For example:
Can you track what snippits have been clicked on so i can use that as something like <<if 'name of thing' true>>
-Character commentary about the thing-
<</if>>
Like character goes to 'farmhouse' there's a new journal entry about the farmhouse.
I am assuming things found in <<if> flags can contain links and other variables?
It'll happen right when they visit. Now your appendix or whatever has that next bit that shows it.
You can also include that set to true code inside a click.
That way when they click farmhouse they add it to the appendix. So you could have " read about the farmhouse " and it displays the info, but that info is also in the journal.
I would recommend trying some things out until you get a good idea of what you want, that'll make it easier to figure out how to do things.
As to how to do the notification itself, that would largely depend on what you're looking for. It could be as simple as a bit of code in the StoryCaption special passage. For example: If you wanted something more animated and/or displayed elsewhere, then you need to get specific about what you want.
Also I don't have to keep resetting the update flag to false after each update?
That said, you really should not test boolean values against the boolean literals in a conditional. While it is not incorrect to do so, it is unnecessary. It would be better as the following:
However, in this case, you don't really need the <<if>> there at all. Since the code's sole purpose is to turn the flag off when the player views the journal, you could simply do that. For example:
Thank you Sir of Sirs.
Edit: I only thought to include an explicit check for a true condition because the way it was explained to me by a codemonkey friend over the years is generally it's better to not assume. Then again literally this thing is just an off button for a single condition, not checking an entire array of conditions and having to flip one or two depending on what's going on.