Scriptable Object Switcher node

FlowCanvas Forums Support Scriptable Object Switcher node

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #3382
    spayke
    Participant

    Is it possible to make “Scriptable Object Switcher node”? like enum switcher, but for SO (for example i have SO type: “Weapon”, and i want switcher that will split according to SO items: “Axe”, “Sword” etc.)

    if yes can you please show example how to make one?( i tried to make one for two days, but making switcher is harder than simplex nodes)

    Ideally, tho I wanted SO switcher node like in “SwitchIntCustom”(screenshot), but instead of ints, you add your SO files, and instead of “Default” output, there will be “Then” output(like in “SwitchBool”)

    Please give me starting point(if node needs to be made for each specific SO type, that you need to declare in node script each time, i am okay with that)

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

    Hello there,

    I’ve just made a Switch Unity Object node which will do what you are after (works with all Unity Object types) and this will be part of the next update as well. It is also attached for you here. Please note that I did not add a “Then” output since the other similar Switch nodes do no have one for consistency, but if you do need it it would be very easy to add (let me know if you need help with that).

    Let me know if this works for you.
    Thanks.

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

    Attachments:
    You must be logged in to view attached files.
    #3389
    spayke
    Participant

    Hi, Thank you so much for this useful node! (  is it possible to have [T] version of this node in the future? this node works great, you just have to look for your SO files in hundreds of other files :D, if it is too hard to make this one is very useful, especally as SO switcher, thank you! )

    About “Then”. Main node i want it for is “enum switcher”, because there is many times when i need only 1 option from enum, and then go on with the flow, but i have to connect all other enum options to the flow(couple times when I added new option to enum and forgot to connect it to the flow, and flow didn’t go further causing bugs, and it was hard to detect what is going on), in code you can make quick check for one option of enum and go further freely, but in “enumswitcher” node you hard locked to enum options only, there is no “Then” option 🙁

    So please show me how to add it for node “enum switcher”

    #3390
    spayke
    Participant

    I actually added “Then” to “EnumSwitch” 🙂

    Can you proof check if i did it right way? (screenshot)

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

    Hello again,

    You are very welcome! It is a good node idea 🙂 I just changed the node to be a T (better this way) and attaching the change for you here. It will of course be part of the next version as well. Please note that this replaces the SwitchUnityObject node I previously send to you.

    Let me know if it works for you.

    By the way, if you only need to check an enum for one of its values, you might want to use the “Any Equals” node with a Switch Condition node. This requires a few more nodes, but you might prefer it.
    AnyEquals

    Your added code change for the “Then” is very correct, yes 🙂

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

    Attachments:
    You must be logged in to view attached files.
    #3398
    spayke
    Participant

    Oh yes, T version is just perfect, just what I wanted! Thank you! :))

    Happy to know my node idea will be in the next version, hehe 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.