1
$\begingroup$

I am trying to convert my animations to python (instead of logic bricks). Here is the action actuator for logic:

action

I am looking to replicate all the parts of this into python: action playback type (including property and property value), force, add, local, animation name, continue, start frame, end frame, child, blendin, priority, layer, layer (amount, float), blend type, and frame property. In other words, I have various types of animations that use or do not use all these parts; how do I convert every piece of the action actuator into python? Thanks! (if you can't list all, please list the most important ones)

$\endgroup$

1 Answer 1

3
$\begingroup$

There is no way to "convert" logic bricks. They are native code and have much more connections to the BGE core code than Python has.

Mimic an action actuator

You might mimic the action actuator with playAction().

Dynamically configure action actuators

Your question sounds like you want to either dynamically change the configuration while the game is running e.g. setup a different action, or you do not want to use the GUI to setup a lot of actions to play.

In both situations you can still use one or more pre-set action actuators. The BGE API of the BL_ActionActuator allows you to change the configuration of each of them on the fly. Do not forget you need to activate them after configuration change.

I hope it helps

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .