setActionthread vs playthread

Scripting questions, discussions, etc
4 posts Page 1 of 1
Posts: 447
Joined: Sat Feb 07, 2015 11:37 pm
by Johxz » Mon Jun 20, 2016 12:26 am
when they should be use?

I want to play an attack animation, playThread seems to work, but only for "attack1", for some reason the "attack2" don't play. In the shape editor I can play any animations.

bob.playThread(0, "attack1");
bob.playThread(0, "attack2");

This don't work.

bob.setActionThread( "attack1", true, true);
bob.setActionThread( attack, 1);

Can anyone how would be use this two? and example of how can use it?
Posts: 84
Joined: Fri Feb 27, 2015 5:13 pm
by irei1as » Mon Jun 20, 2016 10:12 am
I can't give you explanationes but here are my confusing experience. I would love explanations, too

I've used and worked for the main player (class AIPlayer, 3rd person beat'em up thing)


But take in account that punch animation is a blended animation. If it were not then just walking would stop the animation. It's a pain if you want to kick.

I had problems with setActionThread doing "punch" and walking with the main char. But for NPC (class AIPlayer) this worked:

function SlimeData::onDisabled(%this, %obj, %state)
%obj.stop(); //so the death doesn't move

and also worked

function AIPlayer::do_atk(%this)
Posts: 447
Joined: Sat Feb 07, 2015 11:37 pm
by Johxz » Thu Jun 23, 2016 4:59 am
hey @ irei1as thanks!

BTW I managed the problem I did something in my animation.cs I think it was copy and renamed some animations and something screw up anyway....

I empty that file and then added all animation again, for me I don't have blend animation, I have one file per animation (.dae)


and now can do some testing from the console... just fine..
new AIPlayer(EnemyBob) { datablock="EnemyData";; };
EnemyBob.playThread(0, "attack1");

EnemyBob.playThread(0, "attack2");

setActionThread never work for me... I need to do more test, sure I miss something. If anyone can trow some enlightenment :roll:

@ irei1as I found this links to help us
- ... ent-631013
- ... ent-706009
- ... hread/1479
Posts: 324
Joined: Tue Feb 03, 2015 10:30 pm
by Steve_Yorkshire » Sat Jun 25, 2016 2:36 pm
Just to note, movement animations will overrule and disable scripted animations, so if the AI/Player is moving they won't play the animation. You could mount an invisible weaponImage and have the animation play as a recoil animation.
4 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests