Behaviour tree implementation in lua