BehaviorTree.CPP icon indicating copy to clipboard operation
BehaviorTree.CPP copied to clipboard

script compare with negative number exception

Open jiezenghuang opened this issue 8 months ago • 0 comments

version: 4.6.1

example as below:

static const char* xml_text = R"(
 <root BTCPP_format="4">
     <BehaviorTree>
        <Sequence>
            <Script code=" A:=0 " />
            <AlwaysSuccess _failureIf="A!=-1"/>
        </Sequence>
     </BehaviorTree>
 </root>
 )";

int main(int argc, char** argv)
{
    BT::BehaviorTreeFactory factory;

    try
    {
        auto tree = factory.createTreeFromText(xml_text);
        tree.tickWhileRunning();
    }
    catch(const std::exception& e)
    {
        std::cerr << e.what() << '\n';
    }  

    return 0;    
}

output: Error in the script "A!=-1" error: while parsing Grammar::Expression | 1 | A!=-1 | ^ operator cannot be mixed with previous operators

jiezenghuang avatar Jun 05 '24 03:06 jiezenghuang