Topic category: Advanced modding
Sorry if this was repeated anywhere, I tried searching beforehand.
I am trying to make various insects (roaches, crickets, etc) who would both walk and fly. When I tick flying entity in the behavioral tab it makes them hover around and never land. When I give it the fly option and the walking option in the AI when it's not a "flying entity", it doesn't fly at all. I want the entity to choose between whether it's going to walk or fly. I thought I might be able to do this as a walking condition, or a flying condition, in the AI. However I'm having some trouble piecing it together in my head.
-Can I make it switch between walking and flying in a boolean-style if/else statement? Example: (check: is entity flying. If yes, make it walk. If no, make it fly)
-Can I make it do a check like this NOT every tick? Switching from walking to flying every tick would be terrible, could I make it wait a certain number of ticks before checking the condition again? I see there's a "repeat _ times, do ___" type of procedure, would that be what I use for something like this?
Sorry if this doesn't make much sense, my coding knowledge is pretty basic. Let me know if I need to clarify anything.
make it choose, first by making a flying entity and a ground entity. When it touches the ground it changes into that form, and backwards if it falls i guess.