This post is in response to me playing around with setting up prefabs, reading documentation, and this article:
https://adventurecreator.org/tutorials/introduction-parametersThe problem I'm having, is it seems like in the end, there's no foolproof way to set up a prefab to the point where you could drag and drop them into a scene and have them work, depending on the setup of the action lists. In the article I referenced above, you would still always be stuck dragging game object references into the interaction of the hotspot so the ActionListAsset has the needed references. You'd also have to set the inventory item type each time in that example.
So where am I going wrong in my understanding? Typically prefabs are supposed to be there so you can completely configure objects, drop them into a scene, duplicate within the scene, and everything works fine in any of those use cases. I feel like it's really hard to fully set up self contained prefabs where interactions are properly set up and contained in the prefab.
Comments
I don't really want scene only objects of course, but it seems no matter how you slice it, you can't just have "carefree" prefabs with AC? To clarify, I'm looking at a simple case where I can setup something like an ammo item pickup where there are dozens or even hundreds, and the most I have to do is simply drag the prefab from the project view into the scene, and then duplicate/position to my hearts content.
This is version 1.64.5.
https://www.adventurecreator.org/forum/discussion/5535/prefab-interactions
That post seems to allude to the ability to set all parameters in the interaction which references an asset file based action list.
So am I expected to manually assign the CID after making it into a prefab? I'm so bloody confused.
.. nope manually assigning doesn't actually recover the reference after dragging and dropping it into the scene...
Manually assigning CID numbers is generally not necessary, but understand that if "Retain in prefab?" is checked on the prefab's Constant ID itself, then the ID will be the same for the first instance within the scene. Otherwise, or as with other instances, the ID number will be different - and the local instance needs to be assigned in the field if you want it to be "found" by the ActionList.
The discussion you linked to was from a while ago, and was only referring to the ability to set parameter values within asset files. The "Hotspot parameter" field is a way of automatically setting a "GameObject" parameter's value to the Hotspot that an Interaction is triggered from. The complexity of the ActionList: Set parameter Action makes it problematic to place within the Hotspot Inspector itself, hence that is limited to the automatic "Hotspot parameter" field. However, other values can be assigned via custom script, and I can assist with that if necessary.
Be aware, however, that destroying multiple instances of a shared prefab is made more complex because of the need to have them spawn back upon loading a save game made beforehand. I would certainly recommend considering simply moving items out of view when "picked up" as opposed to destroying them - at least while your ID issues are being sorted out - as these only add to the complexity of the situation.