You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could we get some way of visualizing the current tree? For example:
.selector('wander around')
.do('do nothing if unit is already moving', CheckMotion.checkIfMoving())
.sequence('perform wander sequence')
.do('wait for some time', Wait.wait())
.do('locate a fitting tile', Tile.locateFitting())
.do('go to tile', Tile.goToPoint())
.do('reset wait cycle', Wait.reset())
.end()
.end()
.build();
const tree = wanderBehavior.tick();
const treeLooksLike = {
'wander around': {
name: 'wander around',
result: 'RUNNING',
children: {
'do nothing if already moving': {
name: 'do nothing if already moving',
result: 'FAILURE'
},
'perform wander sequence': {
name: 'perform wander sequence',
result: 'RUNNING',
children: {
'wait for some time': {
name: 'wait for some time',
result: 'SUCCESS'
},
'locate fitting tile': {
...,
result: 'SUCCESS'
},
'go to tile': {
...,
result: 'RUNNING'
},
'reset wait cycle': {
...,
result: 'SUCCESS' //or maybe 'UNREACHED'? since the tree hasn't reached this point yet, as the previous action is still RUNNING
}
}
}
}
}
}
Then you can feed this into your console.log or your tree visualizer package.
I'll see if I can put together a PR if you're interested in having this in the main branch.
The text was updated successfully, but these errors were encountered:
Could we get some way of visualizing the current tree? For example:
Then you can feed this into your
console.log
or your tree visualizer package.I'll see if I can put together a PR if you're interested in having this in the main branch.
The text was updated successfully, but these errors were encountered: