Example Spriter/Capx using animation Events/Variables

Get help using Construct 2

Post » Thu Sep 17, 2015 5:50 pm

I have been messing around more with Spriter and wanted to take advantage of the events, tags, and variables that can be added to the animation.

I am able to get the Events to trigger in C2. I also am able to get Tags to work. However, I am having issues getting the correct variable value when Events trigger.

What I want is to have the Spriter animation variable change throughout the animation. The first 1/3 of the animation it will be 3, then 2/3 it will be 2, and then the rest it will be 1. In Spriter at each event key frame I have the variable active and is setting the actual value. I do it like this:

time 0 value 3
time 334 value 2
time 667 value 1

When updating a text box in C2 upon each triggered Event I am not getting the expected 3, 2, then 1. Oh, and it looks like the animation needs to stop then play for the trigger at time 0 to fire. It does trigger if its repeated.

Does anyone have a simple Sprite file and capx they can share that shows what I am asking?

Thanks! :)
Last edited by Exile03330 on Tue Sep 22, 2015 4:55 pm, edited 2 times in total.
B
12
S
2
Posts: 22
Reputation: 648

Post » Thu Sep 17, 2015 6:18 pm

is spriter the program from steam? I got it but never really used it in favor of the art from construct 2... shame there's no way to rotate individual highlighted parts from the drawing scene. it would make the animating so much easier

also in construct, you should be able to say, animation is playing frame 1 set variable to 3. eg:
animation frame x (wherever 1/3 is) set variable to 3
animation frame x (wherever 2/3 is) set variable to 2
where you choose to set it is up to you to get an equal balance

this will not use the time event, but will be sooo much simpler. I think if there is a specific time, construct 2 uses milli seconds, so the event requires exact timing. even 3ds games have frame errors

i used spriter once, and couldn't figure out how to transfer the animation to c2, so gave up basically.
B
9
S
3
Posts: 102
Reputation: 987

Post » Thu Sep 17, 2015 6:30 pm

@Aher0

Yeah, I may end up just using variables in C2 which if fine. I guess I wanted to know more for a learning experience hehe. Anyhow, check out this link for adding Spriter.

http://brashmonkey.com/forum/index.php? ... nstruct-2/

The biggest thing is changing your save settings in Spriter and saving both .scml and .scon files. Then drag those files to the layout in C2. Oh, and make sure you have the Spriter plugin downloaded and in the correct folder. Its quite powerful.

I have a timer that I was thinking about changing from using many events to using an animation from Spriter. The triggers would tell me when to change a variable. I may just do that and use the triggers and not worry about the variables in the animation.

If you have some time give it another shot :).
B
12
S
2
Posts: 22
Reputation: 648

Post » Thu Sep 17, 2015 11:11 pm

i will do, this will be great. i can see how epic it would be to use spriter, actually the first question i asked on this forum was how to merge spriter with c2! ... no1 answered lol.
B
9
S
3
Posts: 102
Reputation: 987

Post » Tue Sep 22, 2015 4:54 pm

The Spriter plugin has been updated and resolved these issues. I also got some feedback from the Spriter forum regarding plugin usage.

http://brashmonkey.com/forum/index.php? ... variables/

Thanks! :)
B
12
S
2
Posts: 22
Reputation: 648


Return to How do I....?

Who is online

Users browsing this forum: yolkgames and 32 guests