Skip to content

Conversation

@yuripourre
Copy link
Collaborator

Move towners to TSV file.

- Add townerdat.cpp/hpp for loading towner data from TSV files
- Add towners.tsv with towner definitions (position, animation, gossip)
- Add quest_dialog.tsv with quest dialog mappings
- Supports loading towner properties from data files instead of hardcoded values
- Replace hardcoded towner data with TSV-based loading
- Add InitTownerFromData() for default initialization from TSV entries
- Update InitTowners() to load data from TSV files
- Maintain special initialization for cows and cow farmer
- Add TownerBehaviors lookup table for O(1) behavior access
- Store animation order data with stable addresses for span usage
- Replace QuestDialogTable direct access with GetTownerQuestDialog()
- Replace QuestDialogTable assignments with SetTownerQuestDialog()
- Update quests.cpp to use new quest dialog API
- Update stores.cpp to use new quest dialog API in StartTalk() and TalkEnter()
- Quest dialog data now loaded from quest_dialog.tsv
- Add townerdat.cpp to Source/CMakeLists.txt
- Add towner TSV files to CMake/Assets.cmake
- Add townerdat_test to CMake/Tests.cmake
- Add test fixtures for towner TSV files
- Add townerdat_test.cpp for testing towner data loading
/**
* @brief Finds the towner data entry from TSV for a given type.
*/
[[maybe_unused]] const TownerDataEntry *FindTownerDataEntry(_talker_id type, Point position = {})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems this is a debug only function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is only called inside DebugTalkToTowner.

I don't know the best way to deal with that.

@yuripourre
Copy link
Collaborator Author

@AJenbo I tried to make this logic more dynamic but I think I went too far.

Please don't merge yet. Let me test Hellfire properly first.

@yuripourre
Copy link
Collaborator Author

@AJenbo so far I didn't find any issues. I think it's good now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants