Forum rules - please read before posting.

Global unhandled event: give to NPC is triggered when item given to non NPC

Hi,

I'm using a 9 verb box in the style of LucasArts.
When giving something to an NPC is unhandled, I want the player to respond, so I create the actionlist and attach it to Global Unhandled Events > Give to NPC.
The only problem is that the reaction is also triggered when the item is given to non NPC hotspots, like objects and such.

What could be happening?

Comments

  • The issue is more that the label isn't quite accurate - "Giving" an item is a property of the item's selection mode, not of the Hotspot you're using it on.

    What you can do, however, is define a GameObject parameter in the ActionList, and check Pass Hotspot as GameObject parameter? just beneath in the Inventory Manager, so that the parameter's value is automatically set to the clicked Hotspot.

    You can then precede your current Actions with a Object: Check tag Action. Then just assign a tag e.g. "NPC" and assign such a tag to your NPC Hotpots.

  • Thanks. I just tried that, but the tag check always returns false, no matter what (I checked that the NPC tags are on every hotspot).
    In inventory manager, it says that the hotspot will be set as a first parameter to the "use on hotspot" unhandled interaction. Maybe it's not passing the parameter to the "Give to NPC" unhandled interaction? (just to remind you I'm using 9 verbs so 'use' and 'give' are different icons and I would like them to have different responses).

  • edited February 2020

    A little update. Just to make sure and replicate it I went ahead and tried it on the 2d demo. I check pass hotspot as GameObject parameter, I add a tag to the hotspot and then on the unhandled use interaction I use a check making sure the parameter is selected as the object, but it never returns true. Both times I checked the inspector as I was playing, and the parameter reads

    Label 0: HotspotToPass
    Type: GameObject
    Current value: "
    Replacement token: [0]

    Are those quotation marks on Current value expected?
    I tried to pass hotspots both from the Cursor menu's unhandled interaction and the Inventory menu's Global Unhandled Event. Same result.
    I'm using AC 1.70.2 and Unity 2019.1.9f1

  • Which unhandled field specifically did you assign in the 2D Demo?

    When reading parameter values, make sure to view the Inspector of the ActionList asset's runtime instance in the scene - not the asset file itself. Which one are you viewing above?

    I'll attempt a recreation.

  • edited February 2020
    just to clarify, I tried passing hotspots to unhandled give and use in the inventory manager, as well as unhandled use in the cursor manager, just to see if I could pass a hotspot at all.

    I used the demo's unhandled use (I disabled the tree's use interaction and tried it on that).
    I think the values were from the instance, I compared it to other types of parameters and I could view the values being updated properly in the inspector between quotes. But I'll make sure about that --I'm on my phone now.
    Thanks.
  • Just adding I did confirm that's what the inspector shows for the Actionlist asset's runtime instance in the scene.

  • OK. I believe I've addressed this as part of the upcoming v1.70.3 update.

  • Great! Thank you!
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.