Variable names lost on custom nodes

NodeCanvas Forums Support Variable names lost on custom nodes

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #10174

    I’ve created custom datatypes

    Defined their data like this:

    Now I have created a node which copies this data to Blackboard variable:

    the problem is that when the tree is reloaded (I change script and the node editor says “Recompiling”), the variable name is gone. Attaching before and after picture:

    #10178

    Actually none of my nodes that use custom BB types save the values in the inspector (regardless if it is a temp variable, bb variable or something else)

    #10177

    Ohhh… nevermind. Forgot to put [Serializable] in front of every declaration like this:

    #10176
    Gavalakis
    Keymaster

    Hello,

    Yep, you have to mark them all as [Serializable] 🙂

    By the way:

    – You can just use the [BlackboardOnly] attribute without initializing the BBVariable like {blackboardOnly = true}. This was the old way of doing this and that’s why some tasks still have it which I have not changed yet 🙂

    – You can have your classes in any namespace you want if you have your own ECO namespace for example. They don’t have to be in the NodeCanvas.Variables or NodeCanvas.Actions respectively.

    – In your info property you can use for example abilities.ToString() to get a nice formated text if you want like:
    {return “NPC -> ” + abilities;} You can do this for any BBVariable of course.

    – The agent is a Component type. You can GetComponent from it directly without going through the .transform
    agent.GetComponent().abilities;

    Just saying 🙂

    Cheers!

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

    #10175

    Thank you very much! Great tips!

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