Easy save nodes are simple but I’m struggling with structure. The keys are all stored in the same file generally, easy save example says just use GUID of the game object. Where is that new GUID stored, or I see people use an editor script to set one…
But what if I want to save two variables, but not the whole black board. So I thought, the variable name is unique, and Id + variable name would never have a conflict. I know there is an ID flowcanvas uses I can see when I serialize a blackboard. But I can not get the name of a variable. There are expressions or nameof examples in forums but I can’t see how to get them to work in a node.
Am I missing something? Should I do it differently? I want an automatic key so I can plug things into a macro. The variable name seems so easy. I know it’s usually only used for logging… which is kind of what is happening with the key. It’s consistent and relative to that object.
I am a bit confused 🙂 Are you referring to saving with Easy Save, or saving a Blackboard with the included “Save” method found in Blackboard?
In either case, both the “name” and the “ID” of a variable are public properties you can access and get from a Variable reference. Can you please explain in more detail what you are trying to do.
I want to access the variable name to combine with an ID that I can set as the key value when saving with EasySave. I’m only aware of ways where I can type in the name. What node is used to get the variables name and ID?
I only referred to blackboard to serialize to note that I can see the values are there.
I have a node returning with what I want using a ParameterVariableNode. I am trying to figure out the other node types, attributes, and how they interact. I think it could be better. I have to specify the type of variable I am going to select from every type listed and I would like it to be one node in the search that, once on a graph, goes off of the dropdown selection of the variable chosen. Again, I am planning to use this as a unique, reproducible key for the “key” used by the easysave nodes.
[Name(“Get Name Of”)]
[Category(“Test/Variable”)]
[Description(“Returns the name of the selected blackboard variable.”)]
public class GetNameOf : ParameterVariableNode
{
[BlackboardOnly]
public BBParameter value;
public override BBParameter parameter => value;
public override string name
{
get { return string.Format(“{0} [{1}]”, base.name, value.ToString()); }
}
protected override void RegisterPorts()
{
AddValueOutput(“Name”, () => { return value.name; });
}
}
[Name(“Get ID Of”)]
[Category(“Test/Variable”)]
[Description(“Returns the ID of the selected blackboard variable.”)]
public class GetIDOf : ParameterVariableNode
{
[BlackboardOnly]
public BBParameter value;
public override BBParameter parameter => value;
public override string name
{
get { return string.Format(“{0} [{1}]”, base.name, value.ToString()); }
}
protected override void RegisterPorts()
{
AddValueOutput(“Name”, () => { return value.targetVariableID; });
}
}
Just to wrap this up here is the full node. (If you tack on <T> as I did, but apparently didn’t copy up above, it makes every type in the search). There is only one generic node in the search, and both strings are provided. I ran this through a tool to make it paste better, indent as needed in editor.
[Name(“Get Name&Id Of”)]
[Category(“Test/Variable”)]
[Description(“Returns the info of the selected blackboard variable.”)]
public class VariableInfo : FlowControlNode
{
[BlackboardOnly]
public BBParameter value;
public override string name
{
get { return string.Format(“{0} [{1}]”, base.name, value.ToString()); }
}