Forum rules - please read before posting.

General Action List and NPCs

So I've been tinkering around with NPCs lately, when I try to make this NPC a companion, following around, etc. It works fine in the first scene, I have an action list and conversations loaded into it with remember elements, even a prefab, but if I drop the NPC in the next scene that follows after this, I can click on it but it won't trigger the conversation menu, what should I do?

Comments

  • Scene-based ActionLists cannot exist in prefabs - you'll need to rely on ActionList asset files when dealing with Actions that can be run in multiple scenes.

    In the first scene, find the Interation Inspector, click the "cog" icon to the top-right, and click Convert to ActionList asset. This will create a new ActionList asset file, with the same Actions, that can be run from anywhere.

    To have your NPC's Hotspot run ActionList asset files instead of scene-based Interactions, set the Hotspot's Actions source field near the top to Asset File. You can then assign this new ActionList asset in their "Use interaction" panel.

  • All of that has already been done, in fact, I worked with action lists to make this NPC, nothing has changed nor worked. The next scene, I can click on him but the dialogue won't trigger.

  • I will need to know if this is a case of the ActionList not running, or the Conversation referenced by it not being found.

    Are there any Actions in the ActionList before the Dialogue: Start conversation Action? If not, try adding a Dialogue: Play speech Action to have the Player say some test speech - does that run?

    If not, test out running the ActionList manually by clicking "Run now" in its Inspector.

    If the speech plays but there's no Conversation menu, is your Conversation present in the scene, or attached to the NPC prefab? How is it referenced in your Action?

    If you can share screenshots of all the objects/Inspectors involved, that will help a lot to diagnose the issue.

  • Ok, let's start from scratch, I'd rather ask you then what's the proper procedure, some elements did carry over, like the NPC and well, the action lists, and one conversation element I had to recreate but I can't imagine this is the proper way to do it.
    In a full game it would be far too much to go scene by scene recreating every single conversation. So from scratch, what should I do?

  • You needn't recreate the Conversation for each scene - just create one, prefab it, and have your Dialogue: Start conversation Action reference the Conversation prefab - not the instance in the scene. You can then remove the Conversation from the scene.

    Check Override options?, and you can then create the response logic for the options within the same ActionList asset.

    The only drawback with this approach is that the state of the options won't save - so if you turn an option off or on, such a change won't be reflected in save games. This is because a Conversation (with a Remember Conversation component) needs to be in the Hierarchy in order to save.

    If you need this to be the case, you can attach a script to make the Conversation survive scene changes (see this page on the AC wiki). So long as Retain in prefab? is checked in the prefab's Remember Conversation component, AC should refer to the scene instance of the prefab at runtime because the IDs should then match.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.