'Check CSharp Event' trouble

NodeCanvas Forums Support 'Check CSharp Event' trouble

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #12178
    jun
    Participant

    Hi ! I’m honestly lost in the use of a simple Condition Box in a Behaviour Tree : the Check CSharp Event. I want to use it for a more complex stuff in our game, but since I can’t make it work, I resume it to a easiest use… and it still doesn’t work. Any help would be useful, I feel like I’m doing something wrong but where ?
    Here’s a class Test that launches the System Action<float> :

    I have this class on a gameobject on my scene. When I hit the A key, the debug log displays into the console as planned. Perfect.

    I’ve also got another gameobject with the following behaviour tree :

    img1

    An here’s my problem : I’m only doing a simple set value when the Check Csharp condition is true. But it doesn’t work, the tree never launches that right side. Here’s the condition box in details :

    img2

    Thank you very much for any help, I know it’s a very easy use of the nodeCanvas plugin but even that I can’t make it work.

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

    Hello,

    I just tried your code and setup to confirm if there is a bug or not, and honestly everything is working fine.
    As soon as I press “A”, the Sequencer continues to the next node as expected.
    Have you tried using a Wait action instead of SetFloat for example just to easier confirm that the condition is (or is not) evaluated?
    Are there any warnings or errors in the console?

    Let me know.
    Thanks in advance.

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

    #12259
    jun
    Participant

    Hi Gavalakis and thank you for your reply. I tested again in a clean project, and it was my mistake : I was drag&droping the BT at runtime, so, of course, it didn’t work. Silly, silly me v_v

    I have another question thought, since I’m still trying to make this csharp event working for my project.

    When the event is raised in the Condition Task, is it possible to compare this eventValue variable with a value of my own ?

    I create my very own “Check CSharp Event” condition box, and I’m changing the code in Raised method, to make the return yield true launched only when the eventValue is equal to another value. Like this :

    img3

    I want into my “Check Csharp Event” to compare this GlobalBlackBoard Variable (with the name of abigailCard) with my eventValue raised. I can’t make it work, and it’s quite an important aspect of my code :/
    It’s probably a very simple task. I’m open to ideas or better methods.

    Thank you !

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

    Hello again,
    Thanks for the follow up.
    Regarding checking the value of the event directly, here is how I would do it.

    Is this what you were indeed after?
    Let me know.

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

    #12283
    jun
    Participant

    I can’t believe all I was missing was that line EditorUtils.BBParameterField("Check Value", checkValue); -____-” I didn’t understand why I couldn’t see my check value. It works pretty well 😀

    Thank you a thousand times Gavalakis for your time, your patience and your awesome plugin \o/

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