Forum rules - please read before posting.

Problem with list of actions

edited April 2023 in Technical Q&A

First of all, I don't know if the English I type here is understandable for everyone. I don't know how to speak English, I use a translator. I live in Brazil.

I have an NPC, in preFab the interaction I selected in the hotspot ''intercation source'' ''Asset file'' I created an action list for this NPC, the actionList has some elements such as ''Hotspot enable or disable'' or ''Hotspot to affect'' only allows using the scene's hotspot not allowing assets.

There is another one which is ''Object Animate'' the animator only allows the scene.

It has the ''character Animater '' which also only accepts the character of the scene.

All of them have the ''assets and scene'' box, but it only accepts scenes.

This problem complicates because I programmed it so that when the NPC is hit, another NPC will appear in the gameObject associated with the camera by the Prefab and several actions will not work.

Comments

  • Even updated to AC 1.77.0 the problem is the same.

  • When an asset-based Action references a scene object, it will do so via its Constant ID number. This is a number that will be added automatically to the scene object when you assign it - and will be displayed in the Action.

    As this number is what links the two together at runtime, you will need to make sure that it is unique for the object you want to affect.

    This is normally not an issue if each NPC is independent, and has its own assets. However, if you have multiple NPCs that all run the same ActionList asset, you will need to use parameters.

    A tutorial on parameters can be found here, but the basic steps are:

    1. In your ActionList's "Properties" tab, create a new GameObject parameter for the character.
    2. Update your Actions Character/GameObject fields to use this parameter
    3. To your NPC prefab's Hotspot, attach the Set Interaction Parameters component and assign the NPC as the parameter field value.

    This technique is covered in more detail in this tutorial.

  • I created a parameter, which became ''parameter 1''. Some strange problems appeared

    1) as seen in the first video, the animation of the bleeding from the bite happens with the first person in the scene, then with the second that is called by Prefab, the third onwards by Prefab, it no longer occurs.

    2) In the list of actions in the second video there is an action that makes the NPC go to the marker, it is not working, when the NPC receives the bite he should walk to the marker, but it is in the second call of the NPC that it looks like a person going to the marker without being bitten. There are also duplicates of NPCs that appear above.

    All NPCs use the same actionlist.

    In the second video is the actionlist used, also the parameter settings on the NPC.
    In the action list in all appears the box to assign the parameter, some I don't know if I attribute. The ''character ;move point'' I tried to define as ''parameter 1'' in the movement of the Npc and in the ''marker to reach'', it didn't work.

  • Your Hotspot and NPC components are on separate GameObjects - you will need two separate parameters to represent each of them.

    Create a new GameObject parameter and name both "Hotspot" and "NPC" to make the distinction between them clear.

    Then, in the Hotspot component, clear the Hotspot parameter field. This will be overridden by the Set Interaction Parameters component.

    Next, in the Set Interaction Parameters component, set the NPC's root GameObject to the NPC parameter, and their Hotspot child GameObject to the Hotspot parameter. Set the GameObject references fields to Reference Scene Instance - otherwise the parameters will be set to the original prefabs, and not those spawned in the scene.

    Finally, update your Actions to use the correct parameter. Hotspot: Enable or disable will need to reference the Hotspot parameter, while Character: Move to point will need to reference the NPC parameter. Make sure that the NPC prefab is no longer referenced by these Actions - only the NPC parameter should be used. Also set the second Object: Animate Action to reference the parameter that has the NPC's Animator component on it - the video doesn't show which object has it.

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.