[Feature | Modding] Some API suggestions
Quarris opened this issue ยท 4 comments
I have 2 suggestions for the API.
- Events
Add an event for various actions in patchouli. For example, unlocking entries (Actually this is the only thing I can think of but an idea none the less) - Unlocking Entries from Code
Being able to unlock entries in code instead of using advancements.
Sometimes I want to have many entries being related in a few ways (I am creating a quest like task system for example where an entry gets unlocked after the quest is complete and having 2 advancements or more per "thing" seems a lot) and creating advancement for each entry creates a huge advancement system that feels redundant. - Hidden pages
A way to hide pages in an entry until something unlocks them.
This would allow pages to be unlocked without the need to create new entries for new information, if one would want to add new information to an entry.
I'm sorry if any of those are already in and I just couldn't find them.
I think your points 2. and 3. could use the already existing flag
system. Give your entry and/or page something like flag: "my_unlock_flag"
, and then when you're ready to unlock the page, call:
PatchouliAPI.instance.setConfigFlag("my_unlock_flag", true);
You know this is probably exactly what I was looking for. I saw that code in here and I genuinely thought it was a way to allow modders to add their own configs to the patchouli configs (for some bizarre reason, I must have been drunk or something). Yeah I'll take a look into this when I have time
Yeah, it should work for you. I'm setting flags from code to include/exclude certain pages based on what features are enabled/disabled in my mod's config, but using it as a kind of progression unlock should also work fine.