Switching navmeshes

Hi! I am planning to make one method for GE, but there is need for one thing. And it is Switching navmeshes. It wouldn’t be hard by itself, but - if I switch navmesh and the object needs to use navmesh that it isn’t located on, will it automaticly find the closest way to navmesh first and than do it’s path throguh navmesh? One more thing: how do I set type, navmesh, target, velocity, acceleration, turn speed etc. of steering actuator using python?

Answering the second question, first you need a reference to the steering actuator. Given a game object, you get that inspecting its “actuators” list.

gameObject = some KX_GameObject (eg. controller.owner or scene.objects[some name or index])
gameObjectActuators = gameObject.actuators
steeringActuator = gameObjectActuators[the name of the steering actuator in the blender UI or its known index]

Now you have a reference, steeringActuator, whose type is KX_SteeringActuator.
The API of that class tells you what you can change and the values you can use.

It is not easy with logic bricks.What do you mean?


I meant setting different navmeshes acording to situation!

Even if it does not sound helpful, I suggest you test that situation and let us know your results. It should not be that difficult. You do not even need Python.

Dynamically setting up another navmesh is not that hard.

OK! Can I ask one question here:
how do I loop trough object’s property in order:
0, 1, 2, 0, 1, 2, 0… meaning property sets to 0, than to 1, than to 2 and again to 0 and infinitely. The most important is that it should set in exact frequency! Who can help me?

Could you explain to me monster why my logic brick version did not work?It is in post 3.

I think it performs the situation I suggested to test I mention. It shows that the object will not move to the navmesh or the target when it is not over the navmesh. I can only guess that the path-follow does not find a path from the current location (unfortunately there is no attribute at the steering actuator providing this information).

You would see this when moving the actor into the middle (outside of the smaller navmesh).

Hint: You do not need to switch True Level Triggering on at the sensors. When working with states, you just need Level. That is all.