Guidebook

Guidebook

6M Downloads

[Suggestion] Gamestages Support

DJJBanx opened this issue ยท 3 comments

commented

Gamestages is an API that allows certain actions to be restricted based on a players "Stage" in the game. All stages are added and customized by modpack makers. I was wondering if you can add this same functionality.

Example: A book has 10 pages, pages 1-2 are viewable always, pages 3-6 are viewable at a certain stage, and pages 7-10 are viewable at a different stage.

Link to Gamestages API:
https://github.com/Darkhax-Minecraft/Game-Stages

commented

It has always been in my plans to allow mods/modpacks to customize the book contents, however it has always been a "potential future expansion".

However this is an interesting idea: I guess I could have some kind of conditional section support (I'm working on automatic pagination, which will include a new <section> tag), and support Game Stages alongside advancements.

I'm thinking some basic syntax, like:

<conditions>
  <condition name="before-stage-1">
    <stage-locked stage="stage1" />
  </condition>
  <condition name="stage-1">
    <stage-unlocked stage="stage1" />
  </condition>
</conditions>

...

<section conditions="before-stage-1">
  <p>Visit the nether to advance to the next stage...</p>
</section>
<section conditions="stage-1">
...

Can't promise it will be done any time soon, though! :P

commented

Yes that would be amazing. My modpack has a preset map and essentially my idea was to have a book with images as to where ores are found in the preset map. You only unlock the image of where the ores are found once you mine the ore. Currently, I have BetterQuesting quests that give you a unique book for each ore, each with just one image, but that is very messy and takes up inventory space. But if this enhancement is implemented I could use gamestages to detect when a player acquires a block and then have a single book that has all the ores in different chapters, and reveal the pictures of the ore generation after the gamestage is triggered.

commented

I have just uploaded version 2.5, which contains many experimental features, including improvements to the logic for calculating the book size, and should behave better overall. However due to the experimental nature of the HUGE changes to the mod's internals, I have marked it as alpha. Feel free to test (it's under review and should be available soon), and tell me if you can find any issue in it!

You can find an example of the conditions in use, in this gist: https://gist.github.com/gigaherz/7efeb2c17b05c179b970e4e0d3727714

Sadly I couldn't implement Advancements yet, due to them not being available client-side. I may write a way to synchronize the state of the advancements with the client, in the future, but for now, only game-stages are supported.