How do I Animations from frames

Get help using Construct 2

Post » Wed Aug 03, 2016 3:42 pm

Its possible create animation only using animation frames?
For example i have many frames in Default animation
frame 0 is player idle
frame 1 &2 walking
frame 3& 4 attack

Now i try find way to make animations using this frames
i create Global variable called animations
and when global variable is:
1 - set frame 0 (stand)
2- set frame 1, 0(walk)
3 set frame 2, 3 (attack)


This seems to be easy but this dont work
when i operate this global variable
animation frame is always 0


AND QUESTION number 2
its possible to create event, this event should operate animation frames just like choose(1,3,5) but i need playinorder(2,3,5,3,2) ?
Last edited by IGDev on Thu Aug 04, 2016 7:30 am, edited 1 time in total.
B
24
S
7
Posts: 208
Reputation: 2,032

Post » Wed Aug 03, 2016 7:13 pm

Go through the manual regarding animations...
You need to Put those frames into seperate Animation groups, i.e other than "Default"
Then in event sheet actions, select your player sprite and set that animation group to play on trigger
B
9
S
2
Posts: 76
Reputation: 739

Post » Wed Aug 03, 2016 7:21 pm

@signupdemo i dont want create other animations than Default
i need have all frames in default and picking right frames to play
B
24
S
7
Posts: 208
Reputation: 2,032

Post » Wed Aug 03, 2016 9:13 pm

We don't know your project so we can't say for sure, but it looks like you made a bad approach on your feature. There are built-in animations functionalities in C2 which should be enough for you if you plan your feature the right way...

...but if your project is so original and you're sure you need to control frames directly then you can simply use Sprite > set frame function. Now to make animation you can use loops or Function + System > wait function. Hard to say what would be the best without knowing what exactly do you need. If you have really small amount of frames then simple Functions should do the job. If it's much more complex then you can even code the sequence in XML or Array and then run some self made generic code to play coded animation sequence.

In short words there are many ways of achieving what you need but as long as you want to stick to one Sprite animation, then you'll have to make a manual animation with Sprite > set frame.
ImageImage
B
27
S
16
G
68
Posts: 934
Reputation: 38,572

Post » Thu Aug 04, 2016 4:36 am

C2 has animation groups for a reason... to make it easier to change between animations, and stop people from asking silly questions about it.

Unless you have some SUPER SPECIFIC reason to do it the way you did, then you should consider doing it the way it's meant to be done.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
80
S
34
G
40
Posts: 3,029
Reputation: 30,393

Post » Thu Aug 04, 2016 5:25 am

I hope this is what you want
Image
B
63
S
39
G
42
Posts: 628
Reputation: 30,524

Post » Thu Aug 04, 2016 6:40 am

@luckyrawatlucky yes something like that. You use global variables fpr each animation. I do this same thanks
B
24
S
7
Posts: 208
Reputation: 2,032

Post » Thu Aug 04, 2016 7:30 am

@SoldjahBoy i need one animation group for one skin of character
thats better than create families or create new sprite called Enemy 2 and copy events for each created sprite only because i must create animations on standard way.

All enemies and player's will be on two sprites ONLY on whole peroject
This way help me save lot of time, lot of CPU usage and not lot of other sprites on project and collision checks
Last edited by IGDev on Thu Aug 04, 2016 8:36 am, edited 1 time in total.
B
24
S
7
Posts: 208
Reputation: 2,032

Post » Thu Aug 04, 2016 8:01 am

It would be a better solution to use new animations for every skin and animation type. You can add folders to your animations to help you keep organized.
B
127
S
33
G
17
Posts: 1,551
Reputation: 20,458

Post » Thu Aug 04, 2016 8:50 am

@glerikud
if you have animations skin1, skin2, skin3. you should make lot events to steer all addational animations for each skin.
If you upload all animation frames on skin1.

and create event to set walking animation and
even if you change skin on start of layout
this same events will display walk animation

I still think this is better way than others
B
24
S
7
Posts: 208
Reputation: 2,032

Next

Return to How do I....?

Who is online

Users browsing this forum: ivanski1983, KTML5, Yahoo [Bot] and 4 guests