{"behavior_tree":{"result":"Running","relativeFilePath":"","parameters":[{"type":"Float","name":"tipI","value":[-1.0,0.0,0.0,0.0]},{"type":"Float","name":"targetDistance","value":[80.0,0.0,0.0,0.0]},{"type":"Float","name":"i","value":[0.0,0.0,0.0,0.0]},{"type":"Float","name":"repeatI","value":[0.0,0.0,0.0,0.0]},{"type":"Float","name":"angle","value":[0.0,0.0,0.0,0.0]},{"type":"Float","name":"repeatCount","value":[3.0,0.0,0.0,0.0]},{"type":"Float","name":"baseAngle","value":[0.0,0.0,0.0,0.0]},{"type":"Float","name":"didSpawnLeft","value":[0.0,0.0,0.0,0.0]}],"rootNode":{"name":"Start","position":[0.0,0.0],"type":"Decorator","childTreePath":"","currentChildI":-1,"children":[{"name":"Create Root","position":[0.0,0.0],"type":"Decorator","childTreePath":"","currentChildI":-1,"children":[{"name":"","position":[0.0,0.0],"type":"Sequence","childTreePath":"","currentChildI":-1,"children":[{"name":"Repeat Until Fail","position":[0.0,0.0],"type":"Decorator","childTreePath":"","currentChildI":-1,"children":[{"name":"","position":[0.0,0.0],"type":"Sequence","childTreePath":"","currentChildI":-1,"children":[{"name":"Create 1 node","position":[0.0,0.0],"type":"ChildTree","childTreePath":"grow_segments.json","currentChildI":-1,"onStart":"\nchild.parentI = tipI\nchild.segmentCount = 1\nchild.targetDistance = targetDistance\nchild.newSegmentAngleSpan = 23\nchild.baseAngle = 0\nif (repeatI == 0) {\n    child.baseAngle = baseAngle\n}\n\ntargetDistance *= 0.9","onUpdate":"","onDone":"tipI = child.parentI\nrepeatI += 1\nif (repeatI > repeatCount) {\n    result = Failure\n}"},{"name":"Spawn Leaf Branch","position":[0.0,0.0],"type":"Decorator","childTreePath":"","currentChildI":-1,"children":[{"name":"Spawn Subtree","position":[0.0,0.0],"type":"ChildProcess","childTreePath":"cow_parsley.json","currentChildI":-1,"onStart":"child.tipI = tipI\nchild.repeatCount = repeatCount - repeatI\nchild.targetDistance = targetDistance * 0.7\nchild.baseAngle = random(20, 30)\ndidSpawnLeft = 0\nif (random(0, 1) > 0.5) {\n    child.baseAngle = -child.baseAngle\n    didSpawnLeft = 1\n}","onUpdate":"","onDone":""}],"onStart":"if (repeatCount - repeatI < 1) {\n    result = Success\n}","onUpdate":"","onDone":""},{"name":"50% Chance","position":[0.0,0.0],"type":"Decorator","childTreePath":"","currentChildI":-1,"children":[{"name":"Create Left Leaf","position":[0.0,0.0],"type":"ChildProcess","childTreePath":"grow_segments.json","currentChildI":-1,"onStart":"child.parentI = tipI\nchild.segmentCount = 1\nchild.targetDistance = targetDistance * random(0.7, 1)\nchild.newSegmentAngleSpan = 0\nchild.baseAngle = random(30, 50)\nchild.nodeType = 1","onUpdate":"","onDone":""}],"onStart":"if (random(0, 1) > 0.5 && !didSpawnLeft) {\n    result = Success\n}","onUpdate":"","onDone":""},{"name":"50% Chance","position":[0.0,0.0],"type":"Decorator","childTreePath":"","currentChildI":-1,"children":[{"name":"Create Right Leaf","position":[0.0,0.0],"type":"ChildProcess","childTreePath":"grow_segments.json","currentChildI":-1,"onStart":"child.parentI = tipI\nchild.segmentCount = 1\nchild.targetDistance = targetDistance * random(0.7, 1)\nchild.newSegmentAngleSpan = 0\nchild.baseAngle = -random(30, 50)\nchild.nodeType = 1","onUpdate":"","onDone":""}],"onStart":"if (random(0, 1) > 0.5 && didSpawnLeft) {\n    result = Success\n}","onUpdate":"","onDone":""}],"onStart":"","onUpdate":"","onDone":""}],"onStart":"","onUpdate":"","onDone":"if (result != Failure) {\n    result = Running\n}\n// TODO: Why does \"else\" not work?\nif (result == Failure) {\n    result = Success\n}"},{"name":"Create Flower","position":[0.0,0.0],"type":"ChildTree","childTreePath":"create_flower.json","currentChildI":-1,"onStart":"child.parentI = tipI\nchild.pedalCount = repeatCount + 2\nchild.size = child.pedalCount * 5","onUpdate":"","onDone":""}],"onStart":"","onUpdate":"","onDone":""}],"onStart":"tipI = Stem.createNode(tipI, angle)","onUpdate":"","onDone":""}],"onStart":"","onUpdate":"","onDone":""}}}