Hi
Our game is built around revisiting a level over multiple days.
Some part of the level is common to all days (most art, some NPCs, etc)
Any day could also have unique things or modify one of the common thing in the level (NPC only there on weekends)
Our plan is to implement one AC scene which contains all the common things.
Then we add another AC scene additively for the current days unique things.
This is working well. I've written actions/code to support this.
For example, a NPC in the base scene could be moved to a unique location in the additive scene by using an asset list - object -> teleport and reference the guid of the NPC in the common scene (in a action list asset of course)
However: If a NPC in the base scene has a hotspot with a generic talk interaction in the common scene, afaict there is no way to change that hot spots interaction at runtime. Hotspot -> Change Interaction dosent support this.
This thread suggested alternate methods:
https://adventurecreator.org/forum/discussion/2339/change-hotspot-interaction-with-a-different-interaction
Imo neither works well for us. We could have 30+ unique days. We don't want 30 checks on the common scene or a unique interaction per day they we enable/disable. That's messy
So - as a test I wrote a custom action similar to hotpot - modify interaction.
Assign a reference to an NPC and a reference to a asset list. When the action is run, the NPCs use button.assetfile is replaced with the specified asset list. (It's more complex than this - I handle various interaction types, in scene vs asset, etc, but essentially its goal is to swap a action list asset on any given hotspot interaction.)
This works well in my initial testing.
The wall of text above is me asking if you think this is a reasonable (and safe) solution. It feels like a reasonable use case - modifying NPCs hotspot interaction at runtime?
Apologies if class or property names are off above. Posting from memory away from computer
Thanks
Comments
It's certainly a viable approach - though as such changes wouldn't be recorded in save-game files, you'd need to run the same code when loading a save file (most easily done by hooking into the OnFinishLoading custom event).
Alternatively, you could keep the ActionList asset file the same, and then have it begin with a Variable: PopUp switch Action to run different branches / ActionLists based on its value (using a PopUp variable to record the day).
One thing to note regarding moving NPCs across scenes: this is most easily done with the Player-switching system. Inactive Players (which could effectively be NPCs) will have their scene/position recorded automatically, so you can move them around different scenes with Player: Teleport inactive and leave it at that.
Hi
Perfect! Thanks for the quick, detailed, response as always.
And yes - definitely aware properties on components like this arent saved.
Good point on the NPC. I didnt think of that. Ill look into it.