Forum rules - please read before posting.

Adding page X of Y to a journal

Hi all,

Is there already a simple system for adding a "page x of y" text item to the bottom of a journal page?

I can see other threads where getting the totalnumber of pages in a journal via a custom script can be done, but wondered what the most efficient workflow is for setting that up in an action?

Thanks in advance.

Comments

  • edited April 17

    After further searching, I found this great tutorial for custom tokens that do exactly what i was after:
    https://adventurecreator.org/tutorials/creating-custom-tokens

    But unfortunately it's not clear to me how/where I run this script during gameplay - and when should it be triggered, so it's always updated no matter what scene I'm in?

    Is there a place to put C# scripts so they are always called on update? or does this script just need dropping onto a gameobject in every scene in the game to ensure it's on update function is continually called? - is this efficient?

    Any help would be gratefully appreciated.

  • If your Menu uses Unity UI, you can just attach the script to the Canvas prefab.

    Otherwise, you can attach it to a prefab, and then have it spawn into the scene automatically using Events.

    To do this, open up the Events Editor in the top toolbar, create a "Scene: Change: After" event, and have it run an Object: Add or remove Action to spawn the prefab once each scene begins.

  • As always great advice, thanks Chris, I'll go for the later in this case, I'm using AC menus for my UI and that way i wont forget to add it to scenes later.

    I've been using AC for years now (thanks so much for all the support) and I dont know how I've not noticed that events editor before! that's really handy!

Sign In or Register to comment.

Howdy, Stranger!

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

Welcome to the official forum for Adventure Creator.