How to replace "as animation" block?

Arafrael

  • Posts: 64
Hi!

You removed "as animation" block in build #8932, but i cant find a way to replace its functionality.
What should i do, if i need to set new animation, using text concatenating?
Ofc, i tried just to put text block into animation setter and found them incompatible.

My case, for example:


If you need more information: i have actor with different equipments (like "sword" and "dagger") and states (like "move" or "attack") and "AnimationHandler" behaviour (part of which you see above), that helps me to choose necessary animation, based on current equipment and state.
The only option i found for replacing my logic - is to make a tons of "if-then" conditions each time i need to change the animation, but its really hard and leads to extremely messy code. Also, i would need to make changes in several places each time im adding new animation...
Hope i just miss something.

Thanks!

« Last Edit: January 26, 2016, 07:56:41 am by Arafrael »

captaincomic

  • *
  • Posts: 6109
I was convinced putting text blocks into directly into "switch animation" would work. Are you sure it doesn't? What do you mean by incompatible?

If it turns out to be still necesarry I can add the block back in, but internally animations are just stored as text now (it was different in Stencyl 2) so it should work.

Arafrael

  • Posts: 64
I mean, i cant put text blocks into "switch animation", it just doesnt fit. There would be no problem, if it does :)
Also, there is nothing except "current animation for <actor>" in dropdown menu.

You can see here: http://take.ms/KzDEJ



captaincomic

  • *
  • Posts: 6109
Oh, silly me, I should have noticed that :). Text blocks not fitting in is fixed in build 8952.

I'm still working on the dropdown menu, I'll think about how to add text blocks to the animation menu.

Arafrael

  • Posts: 64
Thanks!

P.S. If you are working on dropdown menu, maybe you would like an idea, i suggested here: http://community.stencyl.com/index.php/topic,46139.0.html

captaincomic

  • *
  • Posts: 6109
Ya, a keyboard-driven design mode would be a really cool feature, but I don't think I'll get to implementing it now ...

rob1221

  • *
  • Posts: 9430
What happens with existing [___as animation] blocks?

captaincomic

  • *
  • Posts: 6109
They just remain in the behaviors and don't cause any troubles. A warning icon is shown on the block (and all other / future deprecated blocks) as a hint so you can consider replacing them.

I guess I could also write a converter that removes them, but I actually think it's better without a converter, not to mess with existing behaviors.