Forum rules - please read before posting.

Global variables used in Action List Assets not found in search

Global variable -> Cogwheel -> "Find global references" only seems to go through action lists in scenes, not in assets?
I got a action list with one Variable check and one variable set against a global var and it's not showing up in search.

Thanks!

Comments

  • Assets are searched as well, but they need to be referenced by your game in the same way that the Speech Manager only searches referenced assets when gethering text.

    Let's see the ActionList, and how is your ActionList called upon in-game?

  • I see, here's the chain:
    An inventory item points to an examine action list that takes a parameter (Unity object) specifying the action list to run. This is because all inventory item examine action lists needs to do the same things (stop the player from walking etc.) before they do the item specific thing).

    I then use a custom component that maps the inventory item to it's action list and in runtime hooks up to EventManager.OnInventoryInteract and calls SetParametersBase.BulkAssignParameterValues to transfer the params to the actual list. I basically copied what you were using on your component to set params to inventory items but put them all in one component (and to specify some metadata for each item).

    So I totally get that this isn't the usual way to go about it, but I'm sure there are a bunch of other possible ways to miss variable references. Since performance isn't an issue when searching for variable references, might I suggest you load all Action List Assets and preform a truly globally check?

    Thanks!

  • edited August 2019

    I see now that the dialog:speech texts in these are ignored once clicking "Gather text" too. Would you consider processing all action list assets here as well?

    If you think it will benefit more people than me that is.. If not - I'll just bite the bullet and get in line :)

  • I understand your point, but as a project can have multiple "AC games" in one, this would cause corruption between them. You'd start gathering up lines from the demo games, for example.

    If a Unity Object parameter is set to an ActionList asset, it should get picked up so long as its set in an ActionList: Set parameter or ActionList: Run Action, or serialized in a SetParametersBase class.

    Ignoring the parameters within the ActionList you're trying to locate, how exactly is it referenced? From an Action within the inventory item's Examine ActionList? Please share screenshots to illustrate.

    If all else fails, you can always just create a direct reference to the asset file somewhere (e.g. a dummy scene that just has an ActionList: Run Action to any asset not being picked up).

  • I moved back to wiring up the action list asset for inventory items directly and so var searching and text gathering works again.

    This means that every list needs to start with an action that stops the player from walking, would be so cool if we could (in the inventory Editor) specify an action list that runs before any of the appointed lists, and one that runs after. These could take the item as a param for special cases.
  • I don't feel that would be intuitive or widely-used, but you can of course hook into the OnInventoryInteract custom event to run an ActionList independly of whatever you've set in an item's properties panel.

    Example:

    using UnityEngine;
    using AC;
    
    public class StopPlayerOnInventoryInteraction : MonoBehaviour
    {
    
        private void OnEnable ()
        {
            EventManager.OnInventoryInteract += OnInventoryInteract;
        }
    
        private void OnDisable ()
        {
            EventManager.OnInventoryInteract -= OnInventoryInteract;
        }
    
        private void OnInventoryInteract (InvItem item, int iconID)
        {
            KickStarter.player.EndPath ();  
        }
    
    }
    
  • Cool, 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.