Losing BB variables/references after compiling

NodeCanvas Forums Support Losing BB variables/references after compiling

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #11252
    lolzor
    Participant

    Hello,

    I’ve been using NodeCanvas for a few weeks, really happy with the product, but I have a problem.

    I setup a (bound) FSM with references to Blackboard variables (or gameobjects in scene) in Action State. Then, if I make a mistake in one of my scripts (even a non-FSM related one) and compile, the FSM displays Action States comments in red, surrounded by asterisks, and a “Missing Action” for every Action Tasks (even though the action tasks scripts are still here and have no errors in them) — see picture 1.png.

    Now, If I correct the mistake in my badly coded script and compile again, the FSM is back to normal (no more comments in red and the action tasks are back) but I lose all my Blackboard variables references in action tasks, as well as the Blackboard variables themselves (they are still here but not assigned to the correct object type). I have to manually add them back, which is very time-consuming.

    Do you have any idea what would cause this problem ?

    Thank you very much for your help

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

    Hello,

    Thanks. I am glad you like NodeCanvas.
    Do you have by any chance moved NodeCanvas folder under a “Plugins” or “Standard Assets” named folder in your project?

    Let me know.
    Thanks.

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

    #11256
    lolzor
    Participant

    Yes, I moved it to my “Plugins” folder. Should I move it somewhere else ?

    #11257
    Gavalakis
    Keymaster

    Hey,

    Yes, Please move the NodeCanvas folder outside of the Plugins folder to avoid this problem. The reason this is happening is because everything in the Plugins folder is compiled in a different assembly than everything outside of it.

    Let me know if this works for you.
    Thanks.

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

    #11258
    lolzor
    Participant

    Yes, this is working. I’m not losing all Action tasks and BB references anymore. Thank you very much !

    However, the NodeCanvas window is still going temporarily bonkers if I try to compile with bad code somewhere. The window will close while throwing hundreds of errors in the console (see picture). If I correct my mistake and recompile, the window is back again (after throwing another round of errors) and everything is working fine. Is this normal behavior ?

    #11259
    Gavalakis
    Keymaster

    Hello again,

    You are very welcome 🙂
    Hmm. No, this is not a normal behaviour. The window should work in both cases correctly. I think you forgot to attach the image though 🙂
    Can you please do so, and also copy-paste for me the errors show in the console?
    Also, what Unity version are you under?

    Thanks in advance!

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

    #11260
    lolzor
    Participant

    The behavior described above just changed a little bit after I relaunched Unity (5.3.5f1). Here is the detailed description :

    1- I have a perfectly fine FSM window, everything is working. I introduced a small mistake anywhere in the code and CTRL-R to recompile.

    2- The FSM Window completely disappears. If I go to Tools/ParadoxNotion in the Unity Menu bar, the submenu does not appear. If I go to the gameobject the FSM is attached to, I have the FSM Owner Component displaying only the script name (FSMOwner) and then a grayed out line with “Start Called” and an unchecked checkbox. The “Edit FSM” button is not present. The Blackboard component below displays the script name (Blackboard) and a line with “Serialized Blackboard” followed by a string. Third line is an empty Object Reference array.

    3- Correcting the mistake and CTRL-R to recompile. First error thrown in the console :

    NullReferenceException: Object reference not set to an instance of an object

    Then more than 300 identical errors :

    Then at the end, this single error :

    Exception: Error while parsing: unable to parse; invalid token "="; context = <=null]]"}}}s":{"bb_CurrentBrain":{"_value":{},"_na>

    (bb_CurrentBrain is one of my BB variable)

    4- The window is still missing. But if I click away in the hierarchy then click back to the gameobject owning the FSM, the FSM window then immediately pops up back on the screen, and the FSM is then working fine.

    Thank you very much for taking the time to help me !

    #11261
    Gavalakis
    Keymaster

    Hello again,

    This is a very weird error you are facing here and the first time I’ve been reported such issues :/
    Before I dig further into what can potentially be going wrong here, is it possible for you at all to please send me the project (or another project showcasing these problems) to support@paradoxnotion.com ?
    Taking a look at it would greatly help figuring the problem out and help you.

    I hope that is possible. Let me know.
    Thanks in advance!

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

    #11263
    lolzor
    Participant

    Unfortunately I can’t send you the whole project. I tinkered a little bit this morning and I think that the errors I copy/pasted earlier are unrelated to Node Canvas. This is some kind of weird unity bugs when editor is refreshing (probably this problem but I can’t fix it in my current project).

    On the other hand, I started a new blank project, created a bound FSM, then create a mistake in my code and recompile. The FSM window disappeared (“Failed to Load” on the tab title) and the Paradox Notion submenu in the Tools Menu in the Unity menu bar is not available anymore. If I fix the mistake and recompile, I can access the FSM window again and everything is working fine. Is this a normal behavior, or should the FSM window stays open despite compiling with error ?

    Again, thanks for your help.

    #11268
    Gavalakis
    Keymaster

    Hello,

    Thanks for letting me know.
    Normally, the NodeCanvas window should stay open even when there is compilation error since if there is a compilation error, Unity will not recompile of course and instead will use the last successful compilation. I think in one specific version of Unity though, this was not working as expected (bug?) but can’t remember which version exactly this was happening on. What platform are you under and which version of Unity are you using?

    Thanks.

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

    #11368
    lolzor
    Participant

    Sorry for the delay, I was in vacation. I switched to Unity 5.4 a few days ago, disabled auto-compile on refresh and I don’t have problems anymore. Thank you very much for your help.

    #11372
    Gavalakis
    Keymaster

    Hey,
    No problem! I hope you had a good time 🙂 and I am glad that the issue is resolved in Unity 5.4.
    Thanks for letting me know!

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

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