Forum rules - please read before posting.

Show pending interaction whilst action/interaction is running during cutscene?

2»

Comments

  • Thanks for the hooks! How should I tap in to when the player is looking at an inventory item and the dialog pauses gameplay? https://gfycat.com/SelfishEagerAsianelephant

    I assume it's not presently working because I'm rebuilding the sentence and freezing it with 'MyUse(Hotspot hotspot, AC.Button button)' ?

  • You can hook into the OnBeginActionList and OnEndActionList events and check if the ActionList is an Interaction.

  • Okay, so I can't use button in OnBeginActionList because it's not recognized? Since I'd probably need to use
    int language = Options.GetLanguage(); newLabel = KickStarter.cursorManager.GetLabelFromID(button.iconID, language) + " " + hotspot.GetName(language);
    to rebuild the sentence to hold it in place for the duration of the "cutscene" dialog when the inventory item is looked at.

  • OnBeginActionList has nothing to do with buttons - its a generic event called whenever an ActionList is triggered, regardless of how or when. To access the Button involved, you can use OnHotspotInteract.

  • Thanks, that's how it's building the label already, but I assumed that since OnBeginActionList is a separate hook, OnHotspotInteract wouldn't be triggered unless a hotspot is chosen (in this case, I'm merely interacting with an inventory item). So in order to rebuild the sentence if an inventory item is interacted with so I can hold that sentence in place during the "cutscene", does the sentence need to be rebuilt using a different method that would work in OnBeginActionList?

  • I thought the line of thinking was that you'd continue to build it how you were already doing so, but use the new ActionList event hooks to choose when to show and hide it. You can use them to record the currently-running Interaction, and if they match, remove the dummy label.

  • edited February 3

    Yeah, I'm creating the sentence here:
    private void MyUse(Hotspot hotspot, AC.Button button) { textOnEvent = true; if (button != null) { int language = Options.GetLanguage(); newLabel = KickStarter.cursorManager.GetLabelFromID(button.iconID, language) + " " + hotspot.GetName(language); } }
    But I need to do this when an inventory item is interacted with, which doesn't trigger the OnHotspotInteract hook obviously, but I can't just hold the current text into dummy during an inventory interaction, as it will have cleared by the time the inventory interaction is triggered. Is there a hook for inventory interactions, or is everything going through OnBeginActionList?

    Using this:
    private void OnBeginActionList(ActionList actionList, ActionListAsset actionListAsset, int startingIndex, bool isSkipping) { if (actionList is Interaction) { amInteraction = true; myInteraction = actionList as Interaction; print("test"); }

    doesn't actually debug for an inventory actionlist?

  • Is there a hook for inventory interactions

    You can use OnInventoryInteract for inventory interactions - see the Manual's "Inventory scripting" chapter.

    doesn't actually debug for an inventory actionlist?

    It won't - the Interaction class type is for Hotspot interactions only. Hooking into OnEnterGameState / OnExitGameState would also allow you to track when to hide/show the label.

  • edited February 4

    Sure, but I need to build the label again, for instance if I right-click on an item, it will never build the sentence "Look at item" it just builds a "Use item" sentence when hovering, and upon right-clicking, it will just say "Use". So, in effect I need to do the same as I did with the hotspots and actually manually construct a sentence from the cursor interaction that is being run during the Inventory interaction.

    private void InventoryInteract(InvItem theItem, int cursorID) { }

    And I'd need to do something like:
    int language = Options.GetLanguage();
    newLabel = KickStarter.cursorManager.GetLabelFromID
    (button.iconID, language) + " " + item.GetName(language);
    For full disclosure, here's the script I'm using so far:

    http://pasteall.org/1477956

  • edited February 5

    So far, I've gotten something that works okay, I just need to be able to build the sentence correctly inside OnInventoryInteraction by grabbing the cursor used: http://pasteall.org/1478639

    So far I've just substituted KickStarter.cursorManager.GetLabelFromID(button.iconID, language) with a basic "Look at", and using invItem.GetLabel(language) is great for the actual item being examined.

    Is there a way of grabbing the current cursor used for the inventory interaction to build the sentence with? That way, for items that have a "cutscene" interaction for combines or other cursors will be able to hold the sentence during the "cutscene" actionlist.

    and yes, I will be refactoring everything using the new hooks when I've gotten this working! :D

  • Is there a way of grabbing the current cursor used for the inventory interaction to build the sentence with?

    The OnInventoryInteract event's iconID parameter is just that:

    newLabel = KickStarter.cursorManager.GetLabelFromID (iconID, language) + " " + invItem.GetLabel(language);
    
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.