Forum rules - please read before posting.

Containers Closing on Event - Inventory Add

Hello!

The new Events handling is phenomenal. It's allowing me to strip down a lot of my actionlists and reduce workarounds significantly.

I did notice one possible issue: When using an Inventory Add Event, Containers seem to close automatically as the event actionlists run. This only seems to be the case when the menu Appear Type is On Container. Manually opening the Container menu works as expected.

Thanks again for all the great work!

-Jacob

Comments

  • edited August 2023

    You're welcome - reducing workarounds and adding flexibility was my hope with the event system.

    Containers will be hidden automatically during cutscenes. Is the ActionList's When running field set to Run In Background, so as not to interrupt gameplay?

  • Hm, actionlists were set to pause gameplay in both instances. One ran fine while another did not, and the only difference was the Appear Type. May have something to do with when/how they update? With events triggering and the possibility for parallel actionlists or overlap (I trigger actionlists from actionlists here, there's really a lot going on her more or less at once.

    The scenario's probably more than what most would need or attempt. Whenever the player picks up any inventory item, the event triggers an actionlist that cycles through ~20 inventory item categories to see what needs to happen. Each category then triggers an actionlists specific to the category (e.g., head apparel, weapon, crafting material) and has a number of possible results for handling the items within each category, including more contextually triggered actionlists.

    I have it working well as-is, but if I run across something similar I'll let you know. I definitely still haven't 100% sorted out when to pause gameplay and when not to. I'll likely default to just turning off player interaction for the most part. That seems to be necessary most of the time and you've provided good tools for it.

    One other consideration I'm anticipating: with the events now added, there's some potential for conflicting processes. For instance, my events trigger an actionlist that changes a global variable. An event triggered by that global variable could then trigger while the actionlist is still running. This is probably just a matter of policing one's own actions and workflow -- similar possibilities can happen with actionlists alone -- but the introduction of events puts a finer point on it.

    I think I'll also need to generally implement a menu manager to keep things sorted. Again, I think that's completely workable just with actionlists.

    Probably not anything really actionable in all the above, mainly just some thoughts and observations as I'm incorporating the new and the less new functionality.

  • Hm, actionlists were set to pause gameplay in both instances. One ran fine while another did not, and the only difference was the Appear Type. May have something to do with when/how they update

    If a "Pause Gameplay" ActionList doesn't run over multiple frames (e.g. it just displays a comment and nothing else), then it won't block gameplay.

    You can check if the game is currently in Cutscene mode - and the reason for it - from the AC Status box, which can be enabled at the bottom of the Settings Manager.

    One other consideration I'm anticipating: with the events now added, there's some potential for conflicting processes.

    True - care needs to be taken so as not to create conflicts, but it's the offset of added flexibility the feature allows for. It's an Uncle Ben feature, to be sure.

  • Not sure if this is related, but also having an issue where the On Inventory Add Event fires twice in some instances. The only factor that seems to differentiate it is that the inventory item in question is being removed from the inventory and added to a global container.

    Is it possible that adding an item to a container fired the On Inventory Add event?

    As a side question, it might be helpful to have an event for adding items to a container specifically.

    Thanks!

    Jon

  • Is it possible that adding an item to a container fired the On Inventory Add event?

    I'll check, thanks for the pointer.

    it might be helpful to have an event for adding items to a container specifically.

    There is - the Container event category has both Add and Remove events.

  • Ah, totally missed the Container events. You provided much more of these than I'd have expected straight off. I should be able to test the above theory with an actionlist alone then. Thank you!

  • I've checked, and the Inventory add/remove events are indeed being called for Containers.

    This should be the case for scripted events, but for the Events Editor they should only fire when the Player's inventory is affected. I'll address this in the next update, thanks.

  • That's great news. Thanks again!

  • ...and by next update you meant the next day. My icebox doesn't make cubes that quickly.

    One more secondary concern: It looks like the Container/Add event assigns the Container parameter as an inventory item field type rather than (what I assume should be) a game object.

    Works great, though!

    For anyone curious: I have actionlists that run to check newly added inventory items. Based on an item property, it does things like check to see if the character is too encumbered, and if so automatically adds the item to a container for later retrieval. That allows for pretty solid RPG mechanics for ~0 coding.

  • One more secondary concern: It looks like the Container/Add event assigns the Container parameter as an inventory item field type rather than (what I assume should be) a game object.

    Quite right, apologies.

    To fix, open up EventContainerAddRemove, and replace line 56 with:

    new ParameterReference (ParameterType.GameObject, "Container"),
    
  • Perfect. Thanks!

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.