playAction() is broken?

mayble , only not can manage it well,but is complex

if call it , more than one time not work ,

ex:
if AKEY:
ob.playAction(…)

not work, because , call all time.

need of special script for wor work??

and mode property?
and blendIn, where is? work only one time
how to set blendTime to zero???

all this thing in 2.59 was perfect ,not understand , whats is this improvement

import bge
ob = bge.logic.getCurrentController(). owner
ob.playAction(“your action name here”, 1, 200, layer=0, play _mode=bge.logic.KX_ACTION _MODE_LOOP)

try it. it must work. No blend in tho.

work only if I call it with one sensors always(no true)
but in this situation ,(when press a key for more time) not work


import bge
from bge import events

key=bge.logic.keyboard.events


c=bge.logic.getCurrentController()
ob=c.owner


if key[events.UPARROWKEY]!=0:
    ob.playAction("Action", 1, 20, layer=0, play_mode=bge.logic.KX_ACTION_MODE_LOOP)

there is a way to forgive the old action?

This is a disaster

you can try bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.eventsUPARROWKEY]:
or bge.logic.KX_INPUT_JUST_RELEASED == keyboard.events[bge.eventsUPARROWKEY]:
or bge.logic.KX_INPUT_JUST_ACTIVATED== keyboard.events[bge.eventsUPARROWKEY]:

with the older , you simply give one time activate(action)

and that’s all.

for change action
act.action=“walk”

change frame-> act.frameStart=11

ecc , now you MUST rewrite all, so restart ever to first frame, and the animation not work!

now try , but is a mess!!
because you cannot simply choose only the frameEnd and the frameStart to change(the loop) this is the problem

you must tell what exactly you want to do!
the main issue.

I may have found a way
ob.setActionFrame (ob[“fr”])

I run it with a my timer, as a mode property.

But how do you reset the blendTime?
without it , blendIn not can work

have you tried going to do this?
sensors-> always true-> python

keep the key pressed


import bge
from bge import events

key=bge.logic.keyboard.events


c=bge.logic.getCurrentController()
ob=c.owner


if key[events.UPARROWKEY]!=0:
    ob.playAction("Action", 1, 20, layer=0, play_mode=bge.logic.KX_ACTION_MODE_LOOP)

the action remain blocked on the 1 frame to loop

Just call it only once:


if key[events.UPARROWKEY] == bge.logic.KX_INPUT_JUST_ACTIVATED:
    ob.playAction("Action", 1, 20, layer=0, play_mode=bge.logic.KX_ACTION_MODE_LOOP)

if key[events.UPARROWKEY] == bge.logic.KX_INPUT_JUST_RELEASED:
    # Do something to stop the action

well(…)
maybe is more fast…
but blendTime / blendIn? nothing?
was too good :frowning:

i would just use sensors actuators ( when akey -->sendMessage “walk”) message "walk " --play animation with all blending and all the stuff.

thanks for trick :wink: it seems to work, when the impulse comes from the controllers.
cont.activate(cont.actuators[“Action”]) this have the same effect …

But it is a mistake that did not put the variable blendTime.
I do not know if this trick always works :wink:

blendIn is inutilizable de facto
if activate the brick , not work more playAction() …

bahhhhh

the only way to work WELL (as old) is adding one other variable , blendTime in KX_GameObject

if I have a loop 31-80
Then I want to change loop -> 151-190
with the legendary blendIn … how do??

more easy

31-80
31-80
31-80
31-80
31-80
>blendIn<
101-150
101-150
101-150
101-150

???how to see at work blendIn???(mix the two loop)?

ok, I found the solution, (thanks to the suggestion BlendingBGE;))

you can still use the brick actuators, as before, still has almost every feature with a few differences:

  1. every time you change the loop must reactivate (cont.acticate (act))
  2. the property mode is no longer working (probably using it just me)
  3. the mix (blendIn) can be set as appropriate, but in a different way from before, instead of acting on blendTime, we must act on blendIn

probably the code more understandable.


import bge
from bge import events

key=bge.logic.keyboard.events
c=bge.logic.getCurrentController()

c=bge.logic.getCurrentController()
ob=c.owner
act=c.actuators["Action"]

if not "init" in ob:
    ob["init"]=1
    c.activate(act)


if key[events.DOWNARROWKEY]==1:
    c.activate(act) 
    act.frameStart=11
    act.frameEnd=20
    act.blendIn=10 ## mix

if key[events.UPARROWKEY]==1:
    c.activate(act)
    act.frameStart=21
    act.frameEnd=30
    act.blendIn=0 #no mix
    #print(dir(act))

lol

Unfortunately, the brick
work no longer
mode property

the loop MODE is nothing short of disgusting, with INCREASE frame that goes with 0.4/0.5/0.6 frame , a kind of random Oo …and also the end loop is random , while the animation is not random , is sure a crap!
(this problem has always been there,
for this, I used mode property)

in the new version of Action is expected to return to blendIn?
or should I resign?
I can not imagine that blendIn is no longer supported!

I was having some trouble with something similar earlier which i think ive resolved.

I have a Gun with Pickup, Reload and Fire animations. When none of these animations are playing a looping IDLE animation (slight gun movement) Plays Underneath. I Set The Pickup, Reload and Fire Animation actuators (Blendin: 5, Priority: 0, Layer: 1, Layer Weight: 0) and the Idle Animation ( Blendin: 5, Priority: 1, Layer: 0, Layer Weight: 0). This Stopped my animations from locking up and jittering. and seem to transition reasonably. I Control the sensors and Action Actuators Via python but i dont see why logic bricking it will be a problem.

I don’t claim to fully understand this problem but i’m still experimenting.

This might not be what you are looking for but as i understand it Higher Layer and Lower Priority for Dominant Actions.

If There is still trouble with this issue ill start up another scene with test Armature Actions and ill upload a blend at some point.