Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

History/Journal 2 (Simple but maybe of some help to someone?) (sugarcube)

So, I have a very simple way of creating a journal/tracking history in Sugarcube 2 for the player menu. Not very elegant, but no coding up front for the beginners like me. Maybe someone will find it useful.

Link your StoryMenu passage (make one if you haven't got one) to a new passage 'History' (our journal or diary, whatever you prefer to call it) which creates a new menu option.

In the History passage, list entries as variables under the <<print>> command eg

<<print $entry1>>
<<print $entry2>>
<<print $entry3>>

And in your StoryInit passage (make one if you haven't got one) set all the $entry variables to ""

Then whenever a passage does something you think is worthy of a diary entry, have that passage set the relevant $entry to "The diary entry goes here", which will then automatically be printed in the History passage.

I know it's not very sophisticated, but I'm finding it very easy to implement -- especially if you are slightly winging-it with the plot! Gives the player a nice journal in the menu.

Comments

  • That's a great idea. You might want to look into trying an array though: it'll make listing and adding entries easier, since you'll essentially be able to write the code setting up and printing the variable in the history menu once.
  • I hadn't considered an array, that does seem like a better idea. Thanks!
  • As a suggestion for an array-based journal, it could look something like the following: (in Twee notation)
    :: StoryInit
    <<set $journal to []>>
    
    
    :: StoryMenu
    [[Journal]]
    
    
    :: Journal
    !!Journal
    <<if $journal.length gt 0>>
    \<<print $journal.join('\n\n')>>
    \<<else>>
    \No journal entries.
    \<</if>>
    
    <<back>>
    
    
    :: Some Passage Which Generates A Journal Entry
    <<set $journal.push("''Day 15:'' Stuff happened…")>>
    
Sign In or Register to comment.