I’m not sure what you mean by Attribute on the field. Ports are created by just calling “AddValuePort”.. there’s no field to put the attribute on?
Also the entire point is NOT to show integers but the text the integers refer to. A mission designers cannot identify a message that is to be sent by its integer, even though that’s how it’s serialized. The integer is an index to a list of messages and I’d like to display that message text on the node, so a mission designer knows what message the node is referring to.
As I said I worked around this by createing a struct that constains a string and the integer and make the port of that type. But that makes the port no longer a pure integer which leaves it less flexible. if I ever want to actually plug in a dynamic index, I’d have to add a converter node that turns it into my serialized type. I was hoping there’d be some other way to achieve this but apparently not.
Maybe it’s an idea for the future to offer a function that turns a serialized value into a string that is displayed on the port. You don’t always want to see just value.ToString there. Sometimes a built in type like boolean or integer has more semantic behind it, and it would be nice to be able to display that.
Login
Register
By registering on this website you agree to our Privacy Policy.