[SOLVED] Animations (actors) in my primary actor by clicking the animations?

Dieko

  • Posts: 5
Hi everyone, friendly community

I am trying to create something different with Stencyl in my first creation, which It's going to be a character maker, and I will explain as much clear as possible. Before I start I want to point that I have spent many hours trying to solve this by myself and guides but without success... yet, there's a particular point that stops me, so I decided to seek for help in Stencyl community.

Let's imagine that I have the next
Animations
10 different bodies animations (they're just skin colors where it match with faces & hairstyles) in an actor type
10 different faces animations in an actor type
10 different hairstyles animations in an actor type

Goal
The goal is to put the 30 different animations (bodies, faces, hairstyles) in the whole scene (around in the top, like floating but not moving) where, if I click for instance, let's say 1 hairstyle animation, then the clicked hairstyle will switch/appear on the main primary selected actor (should I make a 4th actor?), and also switch between different bodies, faces and hairstyles by only clicking the already explained animations that I will put around the top.

Bad design
The best thing that I was able to made in the time was by clicking in my primary actor (self) then it switches of appearance but It's a turn on/off feature, I will probably delete this as I want to click in any animation then change it to my primary actor, but I will share the screen of the failed attempt anyways, I joined less than a week ago.


 "on" is a boolean attribute, and "body1/body2" is an animation attribute

Thank you very much in advanced for your help any suggestion and help is welcome.

« Last Edit: September 23, 2015, 02:53:40 pm by Dieko »

TheIndieStation

  • *
  • Posts: 2256
So basicly a dress up game?

ajimundi

  • *
  • Posts: 230
Here's how I would do it:

Actor 1-3: bodies, faces, hairstyles
Actor 4: a dynamically created actor with the 3 actor types above attached as child. Or you can use an instance of the body actor and attach the other 2.

Each actor type (used by 1-3) have behavior that allows them to switch animation by changing an attribute (e.g. 'animation number'). In your update event, check if that attribute has changed (maybe by storing an old value and compare with current value). If it's changed, switch animation. You can then code the changing mechanism (e.g. if self is clicked, change 'animation number').

Create behavior that monitors change in actor 1-3 and pass the info to actor 4.

Create a behavior in actor 4 that can execute the changing mechanism of its child actors.
::: It's never too late, unless you're dead. Maybe not even then. :::

LIBERADO

  • *
  • Posts: 2659
<a href="http://www.filz.us/files/816df2f6/4a0/GIRLFRIEND.swf" target="_blank" class="new_win">http://www.filz.us/files/816df2f6/4a0/GIRLFRIEND.swf</a>
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

ajimundi

  • *
  • Posts: 230
As always, Liberado saves the day. :D

Sorry, I would've loved to help you further, but it's holiday, which means no computer. But I got the feeling Liberado's going to turn up. :)
::: It's never too late, unless you're dead. Maybe not even then. :::

LIBERADO

  • *
  • Posts: 2659
I will dare to ask you for a copy of the blocks/project if possible?
The project file is attached to this post.

Is the main actor able to move?
Yes. Simply, add frames to each animation, according to your tastes.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.