anegostudios / VintageStory-Issues

Vintage Story's public issue tracker for reporting bugs, crashes and the like
47 stars 16 forks source link

[1.20] ModJournal.DidDiscoverLore() Missing in 1.20 #4575

Open splitlungs opened 3 days ago

splitlungs commented 3 days ago

Game Version

1.20.0-pre13

Platform

Windows

Modded

Vanilla

SP/MP

None

Description

As of 1.20.0-pre1, the ModJournal system is not working in several ways. 1: DidDiscoverLore() public bool is missing. - There is now no native way to check if a player has discovered a lore without building a duplicate ModJournal. 2: api.Event.PushEvent("loreDiscovery", treeAttribute) does not trigger. - ModJournal still has a listener, and ItemRandomLore still appears to push the event. I'm not fully sure yet where the disconnect is.

How to reproduce

New single player game in 1.20 and referencing the VintageStory.GameContent.ModJournal class when modding show these changes since 1.19.8

Screenshots

No response

Logs

Log

tyronx commented 2 days ago
  1. Why would you need DidDiscoverLore()?
  2. Show code
splitlungs commented 2 days ago

I need to be able to determine if a player Did Discover Lore on-demand for the purposes of knowing if they discovered a specific lore chapter or not. Lore is not even readable at the moment, and the Journal is mostly non-functional in 1.20.

Example: In the KRPGEnchantment mod, there are a number of Lore items which are used to determine if a player should be able to read a specific text in the Enchanting Table's GUI. https://github.com/splitlungs/krpgenchantment/blob/master/krpgenchantment/Util/ApiAdditions.cs#L117

See the code in Journal.cs here: https://github.com/anegostudios/vssurvivalmod/blob/master/Systems/Journal.cs

If there is a rework of the Journal planned, I would appreciate some advisory on how to utilize it. However, I saw no notes about these changes in any of the devlogs or release notes.

tyronx commented 1 day ago

Lore is not even readable at the moment, and the Journal is mostly non-functional in 1.20.

Not sure what you mean with that, vanilla lore works just fine for me

tyronx commented 1 day ago

as for DidDiscoverLore(), i'll add it back for you

splitlungs commented 10 hours ago

as for DidDiscoverLore(), i'll add it back for you

Confirmed, thank you for adding that back. It keeps me from having to add redundant code in my mod.

splitlungs commented 10 hours ago

Lore is not even readable at the moment, and the Journal is mostly non-functional in 1.20.

Not sure what you mean with that, vanilla lore works just fine for me

I just tried generating a new, unmodded, creative singleplayer world and could not read any lore. I'll have to do more debugging and get back to you with more evidence.