NodeCanvas Forums › General Discussion › A few more feature requests
1) When calling methods from a class that is inherited, could there be a menu option somewhere within the component, to select the base component?
I.E. I have a BaseController, then an EnemyController, and an AdvancedEnemyController which both inherit from BaseController. BaseController has methods common to both of them.
Rather than tie an anction to EnemyController, I want to choose the method from BaseController. My only solution right now is to tell it NOT to use self, then select the BaseController method, then tell it to use self, which is kind of a wonky workaround.
My explanation sucks, so I attached screenshots of what I mean I have to do.
2) Preset action lists, possibly saved as an asset file(?). Say I have some common behaviour things, such as telling an enemy to do 5 different things in a single action list, but all of the enemies will have to do it at some point. It’d be much easier if I can save it as an asset that shows up in a drop-down list of pre-saved actions/macros or whatever you will call it.
Then rather than copy/pasting, it’s as simple as a menu drop-down, as well as changes propigating between the different behaviour trees when that single preset is updated (perhaps a warning to notify that other FSMs/BT’s will be effected)
Lastly, #3 is an issue, but I’ll throw it in this same post… Since updating to 2.3 I have the following visual error in all the canvases. Attached is a screenshot (“Error”). I don’t think it’s anything I did, but it’s insanely annoying!
I haven’t had a chance to play around with it much, but thanks for the update!
Oh, nevermind about the first request, I just realized that it won’t call any override stuff in the inherited classes if it’s done that way.
Hey,
1 ) Yeah, I understand what you mean for when selecting methods. I could set the agent type to the DeclaringType of the method selected instead. The overriden method in the inherited class will be called by the way correctly, since at initialize it will basicaly do:
GetComponent(typeof(BaseController))…
…and this will return the EnemyController component since it inherits BaseController, and then call the method on that one as expected.
There are some minor reasons that this is not already the way it works, but I think I will go with what you suggest here regardless 🙂
2 ) Your idea of Preset action lists is actually a very good one. I like it. It would be a bit hard to implement, especialy if the parameters of each contained actions are saved in the preset, but far easier if just the type of actions contained. I suppose the first does not make a lot of sense eitherway.
If we are talking about the 2nd option, then a preset is basicaly a list of types. In this case an .asset file would be an overkill, so probably EditorPrefs can be used for that.
I could implement this feature in the next version 🙂
3 ) Regarding the weird (and indeed anoying) text wrapping issue, can you please verify that in the “NodeCanvasSkinLight” asset file, the WordWrap is checked off? (image attached) Let me know.
Thanks!
Join us on Discord: https://discord.gg/97q2Rjh
It’s turned off, and I haven’t touched any settings, so I’m not sure what’s causing the issue. Attached a screenshot of what mine are set to.
Also another feature I thought of, since I restructure my code like crazy as I try out new things, is an option to see/list all canvas errors (i.e., if a method in an action isn’t found on the blackboard, or a component), then I don’t need to click on each node to see if there was anything I forgot to update and only find out at runtime.
One last thing about reflecting methods actually, hah. Say I have a method MoveToRandomPosition(float distance = 1f), if I add that to NodeCanvas, then the default distance is 0. Is there any way you can pull the default parameters if they exist, and populate the fields with those?
Hey,
I am still looking at the wordWrap issue. There is no point in which I change the word wrap setting, so I am wondering whether you are using some other asset that it does somehow. But still, it should work since the GUISkin is loaded in the start of OnGUI of the editor.
Regarding the missing methods, in version 2.3 I’ve added the requested feature of showing missing methods in red as part of the action’s summary information, but a list of errors is usefull too. I will take a look at it as well as the default parameters to be set automaticaly.
Cheers!
Join us on Discord: https://discord.gg/97q2Rjh
Great, thanks!
Later when I have some time, I’ll backup my project folder and delete assets one by one to see if a specific one is the issue, then let you know
I was deleting assets a few folders at a time, and at one point NodeCanvas went back to normal, so I restored my repo from git back to normal so I could narrow it down to a single asset, but apparently after deleting the project cache, NodeCanvas IS working with all of my assets now.
So some odd issue, somewhere… But clearing the project cache fixed it, something for someone to try if they ever run into this I guess!
Edit: And now that the word wrapping is fixed, I can see that my code change early for descriptive actions makes nodes far too wide!
Which, reminds me of another feature request, but I’ll put it in a new thread since this topic is getting fairly cluttered with multiple things
Hey,
Thanks for letting me know.
By the way the default parameters request has been implemented now 🙂
Cheers.
Join us on Discord: https://discord.gg/97q2Rjh
Great! I’ll be able to revert my code to how it was after this