Forum rules - please read before posting.

Best workflow for item reactions of hotspots

Hello,

I'm trying to develop a dynamic reaction system for the uses of an item with a hotspot, each item will have a different reaction (dialogue/action etc) for each hotspot.
I'm not sure about how should I propound this.
The general idea is to keep it simple: 1 item interaction per hotspot and the action itself will be the one that handles all possible cases.
Should I store all the reactions per hotspot on a custom item property class that is linked to ACs item system or should I create a lot of interactions with an action per case that are triggered by each item?

How do you handle this on your games?

Thanks in advance.


Comments

  • Sorry, I think I'm going to need more detail about this.  A Hotspot can already define individual interactions for a given Inventory item, as well as a "generic" unhandled/fallback interaction.

    So you're looking to eliminate the need for multiple interactions per Hotspot, and just put them all into one?

    Using specific Actions for each item/Hotspot combination allows you features such as lipsyncing / audio files to go along with each dialogue, but if you don't need those then it should be possible to reduce the number of Actions involved by altering the text spoken in a single Dialogue: Play speech Action dynamically.

    Action field values can be changed at runtime via ActionList parameters - see the Manual as well as this tutorial.

    One way you could use this would be to create a separate interaction for each Hotspot/Inventory item combination, but have them each run a single ActionList: Run Action that calls another, parameterised ActionList and sets e.g. the dialogue text dynamically.

    But if you insist on having only one ActionList per Hotspot, then you could rely on the "Unhandled interaction", which will run for all items unless referenced in the list of "Inventory interactions".  This Interaction ActionList would also be parameterised, but the first Action could be a custom one that sets the values of your parameters accordingly.

    For example, lets say your "Parameter 2" was a String parameter tied to your Dialogue: Play speech Action's Line text field, and the relevant speech text was written in your item's "Property 1".  You could have a custom Action read the last-selected item, and act accordingly:

    InvItem item = KickStarter.runtimeInventory.LastSelectedItem;
    string lineText = item.GetProperty (1).TextValue;
    thisActionList.GetParameter (2).SetValue (lineText);


    (Where thisActionList is an ActionList variable exposed in the Action's UI via the ShowGUI function).

    I can help you write such an Action if necessary, but let me know if that's the route you want to go down.
  • Hello Chris, thanks for your quick answer as always :)

    Sorry for the bad explanation. The idea would be to have an interaction call different "reactions" depending on the item:
    "use knife(item) on dog(hotspot) -> launch dyalogue -> "I can't kill that lovely puppy"
    "use cucumber(item) on dog(hotspot) -> launch dyalogue -> "Dogs hate cucumber!"
    "use ball(item) on dog(hotspot) -> launch animation -> dog running

    The idea is to use the "Unhandled interaction" and filter it by the last selected item as you said.

    My doubt was if relying all parameters on the items themself is the way to go.
    The workflow would be something like this:
    image

    Since I have to store some special dynamic parameters (such as dyalogue systems conversation or the hotspots that the item will have special reactions to) I think I might need a custom object class that links to ACs InvItem class by it's id and call a reaction depending on the custom objects parameters.



     
  • Indeed - if you're looking to incorporate this for many Hotspots, with variances in e.g. some having an animation / some just dialogue, then I'd recommend a dedicated data class over inventory properties.
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.