Conditional Returning backwards?

NodeCanvas Forums Support Conditional Returning backwards?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #12295
    yulaw2k
    Participant

    Isn’t this backwards?

    If(_IsEnemyDead == false)
    FoundEnemy = true;

    On the right side you can _isEnemyDead == true, but it is acting like it is false and ongoing to the action.

    isDead

    Attachments:
    You must be logged in to view attached files.
    #12301
    yulaw2k
    Participant

    I am spending more time facing problems with this software than I am getting things done….. I only keep trying because I spent a good amount of money on it.

    Heres another example of it failing. Ive spent about 2 hours trying to fix this.
    isDead-1

    First I am trying to get a variable from another blackboard. Getting IsDead from the enemy which is set to true. The enemy IS dead.

    On the left I am saving it as a real variable. Its being autoconverted into a boolean. It should pass the condition on the print, but fails. I cannot autoconvert a boolean from another blackboard into a boolean. If this is not an option your code should not let it or throw an error or warning.

    On the right side I am doing a dynamic variable. It prints correctly, but fails the condition for some reason.

    So basically, I cannot get variables from other blackboards?

    Both those scenarios should pass as true, but both ways fail.

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

    Hello,

    I think you’ve made a mistake in your tree, but the tree is working as expected.
    Please allow me to point the mistake:

    TreeOrder

    1) You are setting the “_IsEnemyDead” to be equal to “isDead” variable, which is “FALSE” in the blackboard.
    2) You are checking “If _IsEnemyDead == False”, which it is, since you just set it to “isDead” (which is false).
    3) You are setting “_IsEnemyDead” back to true and this is why it is shown as true in the blackboard on the right, but at the time the Conditional Decorator was checked, it was false.

    So the problem here, is that within 1 frame, you are setting the variable to false, checking it against false (which returns true), and finally setting it back to true.

    Let me know.
    Thanks.

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

    Attachments:
    You must be logged in to view attached files.
    #12312
    yulaw2k
    Participant

    In the screen capture you can see I am pulling the variable from the correct blackboard and not its own blackboard.

    isDead-1

    You can see both variables on the inspector say they are true, one being a dynamic, one being a normal variable. Both still return failure. In the console you can see the normal variable is printing true while the dynamic is printing false, but both fail the is true.

    #12318
    Gavalakis
    Keymaster

    Hello again and sorry for the late reply.
    I just realized what is the problem here, thanks to your screenshot.
    You will need to please click the “Select Type” button that exists in the “Get Other Blackboard Variable” inspector and set the type to the type that you are getting, thus in this case “boolean”. This way the action will work correctly by knowing the type it needs to work with (and thus avoid it trying to promote it to a new variable as shown in the console log).

    I will improve the inspector GUI of the “Get Other Blackboard Variable” so that the type selection is mandatory before being able to set the other parameters. Thanks for bringing this into my attention!

    Please let me know if that works for you.
    Thank you.

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

    #12321
    yulaw2k
    Participant

    Confirming. This works now in both cases. I guess i’ll pick node canvas back up 😉

    #12327
    Gavalakis
    Keymaster

    Thanks for letting me know! 🙂

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

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