What's the best way to create a popup with values from a list?

FlowCanvas Forums Support What's the best way to create a popup with values from a list?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1123
    xelnath
    Participant

    I have a dynamic list of strings that are the name of valid Prefabs to have the FlowScript create. Is there a simple way to setup a Blackboard to pick an item from a list, rather than requiring the string to be manually assigned?

    #1124
    Gavalakis
    Keymaster

    Hello,

    Can you please clarify your questions a bit more and what you want to achieve? Is this relevant to editor UI popup?
    I am sorry but I’m not sure I understand 🙁

    If you mean how to pick an item with index from a list, you could do it like the following image, but I presume that is not what you mean?
    PickItemFromList

    Please let me know.
    Cheers,

    Join us on Discord: https://discord.gg/97q2Rjh

    Attachments:
    You must be logged in to view attached files.
    #1127
    xelnath
    Participant

    Thank you, I appreciate the fast response.

    I am specifically trying to create a popup in the unity inspector driven by a dynamic list of strings to select a string to be used as an input for the blackboard.

    E.g. The flowscript is called ‘spawn and act’

    And I have inputs:

    String MonsterName
    String MonsterAction

    Which I want to source from a list of monsters specific to that level:

    Public Ilist<string> LevelMonsterList
    {
    Get {

    return ScenePrefabList.Select ( c => c.MonsterUniqueName );
    }
    }

    And I want to map that list (defined on the spawned object that has the blackboard) onto a popup that drives the “MonsterToSpawn” string

    #1128
    xelnath
    Participant

    Like this. A string driven by a list of strings popup 🙂

    Attachments:
    You must be logged in to view attached files.
    #1142
    Gavalakis
    Keymaster

    The blackboard GUI is not very customizable in this regards at least right now. There are some solutions I can think of like creating a custom class with custom object drawer, but I think this could become an overkill 🙂
    What I’d like to suggest instead is simply create a string variable and bind it to a property or field of a monobehaviour on the gameobject. This way, you can inspect and edit the property/field however you like, but still have it be bound to the variable 🙂

    For example:

    And then in the Blackboard:
    Bindings

    Let me know if this solution works for you.
    Thanks.

    Join us on Discord: https://discord.gg/97q2Rjh

    Attachments:
    You must be logged in to view attached files.
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.