Forum rules - please read before posting.

Automating creation of custom hotspots

Hi

I find that creating new Hotspots in my game involve a lot of repetition.

I usually create a hotspot. Then I create a marker, add it to the hotspot and move it a bit. Then I create the USE interaction, the EXAMINE interaction, and the UNHANDLED INVENTORY interaction. Then I create the Action Lists for each of those three interactions. Then I go inside each Action List and, usually, make the first node a Dialog node that Plays Speech as a player line.

Although each dialogue line is different, the process previous to writing them is usually the same.
So I thought a prefab would solve the repetition. But Action Lists can't go inside a prefab. So, arguably the most tedious process (doing the Action List over and over), is a no go. I still have to create three Action Lists and set the first node to Dialogue.

Is there a way to do this automatically?

Thanks.

Comments

  • You could change the default action to dialogue in the settings manager, which might save you a bit of time.
  • Welcome to the community, @perezbalen.

    The Hotspot + Marker combination can be prefabbed, and you can rely on ActionList assets + parameters for the Interactions.

    Create a new ActionList asset that has a Dialogue: Play speech Action, define a String parameter in its properties and use it to override the Action's Line text field. You can then use this asset whenever an Interaction consists of a single speech line - by setting the line text from the Hotspot.

    To do this, set your Hotspot's Interaction source field to Asset File, and then set your Use Interactions to run this new asset file. Then, for each Use Interaction defined, attach a Set Interaction Parameters component to the Hotspot. In each, assign the Interaction type and Interaction fields, and you can then set the line texts by updating the value of the ActionList asset's String parameter.

  • Thanks. That seemed to do the trick.

  • edited March 2

    Question about this: The dialogue injected through the Set Interaction Parameter is also included when AC grab texts for translations? I remember trying something like this in the past, and I couldn't make it work.

    And one more thing: Do I have to add a new Set Interaction Parameter if I want to have more than one dialogue in that Hotspot (E.g. One dialogue for Use and other for Examine, where both dialogues are injected by parameters)

  • edited March 2

    More clear of what I mean with a couple screenshots.
    Notice how the LookDialogue string field lose the value in the examine Interaction type, but keeps it for the Use type.
    (Tested in v.1.82.5)

  • The dialogue injected through the Set Interaction Parameter is also included when AC grab texts for translations? I remember trying something like this in the past, and I couldn't make it work.

    No - parameter strings cannot be considered speech text.

    A workaround for this would be to have a separate scene / ActionList that stores all your speech lines (as regular speech, gathered via the Speech Manager), and then use this Action to reference them by ID number, which can be parameterised:

    https://adventure-creator.fandom.com/wiki/Playing_speech_from_ID

    o I have to add a new Set Interaction Parameter if I want to have more than one dialogue in that Hotspot (E.g. One dialogue for Use and other for Examine, where both dialogues are injected by parameters)

    Yes - each Set Interaction Parameters component needs to be configured for a specific interaction.

  • Understood! Thanks!

  • edited March 3

    What about the texts in actionLists in the asset folder? That should work, right? I'm using a regular Dialogue:Play Speech action. However I'm not getting the texts that are in the asset folder after gathering them...

    Update: I found the issue on other forum thread:

    It does indeed search ActionList assets, but only those referenced by your game - otherwise, asset files from other projects (including the demos) would be included.

  • edited March 4

    They'll need to be referenced by either a Manager, or a scene that's included in the build.

    You can create a scene that uses ActionList: Run Action(s) to reference any assets, and add it to your build settings.

    Alternatively, reference them in a custom script - see this thread for details.

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.