Question that can't fit in the title

Get help using Construct 2

Post » Tue Apr 05, 2016 6:15 pm

What can the problem be if you can't make animations or values start timers? Whit animations i do make it so that the timer only starts at the animations first frame and whit values i only make it so that the vales immediatly switches to something else after it has started the timer. Still the effect of the timers never happen. So what can the problem be?
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Wed Apr 06, 2016 7:21 am

If you can't answer the question whitout looking at a copy of my capx, say that now.
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Wed Apr 06, 2016 9:10 am

You, indeed, need to post a copy of your capx, as it is always that best thing to do when asking for help.
Most of the time, the problems are specific to the project itself and how it is set up.

Also are you aware that there is, in the Sprite object, a "On animation end" condition that would trigger once the (non looping) animation is ended ?
It could be better than using a timer ?
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
296
S
119
G
96
Posts: 7,332
Reputation: 71,306

Post » Wed Apr 06, 2016 12:28 pm

I tested the On Animation ended solution but it has problems. The sprite is supposed to be affected multiple times. So after it has been affected by a another sprites on animation ended event, it still needs it to happen again multiple times. So i added the action, go to frame 0 to the On animation ended event so that the animation would run again and reach the ending frame. The problem is that if you have Loop set to no, the animation goes to frame 0 but don't go on past that. If you set Loop to no it goes past frame 0 but the effect the on animation ended is supposed to create doesn't happen instead. That could be becuase the On animation ended event doesn't work whit looping animations but like i said making it not loop doesn't work either. Thanks for the suggestion anyways. It maybe could work, if you could give a solution to these problems.



But in case there is no solution to the problems whit that suggestion, here is a copy of my capx. The capx takes up alot of memory, so now you know that and don't need to comment on that. I have changed the appearance of some sprites for private purposes. When you open the capx you will start on layout 50 where the Sprite 1258, the spriet whit problems is located. The latest event in Event Sheet 4 is the ones that is connected to Sprite 1258. Please don't look deeper into the project then necissary and don't comment on anything that isn't neccissary.
https://www.dropbox.com/s/4ks20oboupgz8 ... .capx?dl=0
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Thu Apr 07, 2016 11:06 pm

If you wonder what the sprite is supposed to do is that it should change movement direction. In the currents state its starts whit moving one direction but never changes direction even though it's supposed to.
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Fri Apr 08, 2016 1:21 am

Your game is too monstrous to investigate. I suggest making a smaller example the shows the same problem, so people can have a look.
ImageImageImage
B
71
S
22
G
259
Posts: 3,794
Reputation: 143,704

Post » Fri Apr 08, 2016 7:47 am

It doesn't matter that my capx takes up alot of memory and is massive. When you start the project you immediatly start at the layout where the problem is so you don't need to worry about all the other layouts and most things basically. The problematic events is also the latest events in Event Sheet 4 so no need to look for them. I have done all i can to make the capx take up as little memory as possible and if you know some way to make it take even less you are free to do it. But anyway if you still is hindered bu the high memoru usage here is a capx whit only thhe problem and nothing else. Evyrything is the same.

https://www.dropbox.com/s/4yxcwylmk4w90 ... .capx?dl=0
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Fri Apr 08, 2016 9:29 am

8 Billions of gigabytes necessary RAM. Nice...
It just doesn't make sense getting this to work honestly, you should serioulsy revise your base design otherwise you won't be able to make your project work except on a specific dev machine.
You don't want people to comment, but at the same time you are requiring help, so please, take that comment as another help feature.

Now for your issue.

To get back to "On animation ended", you can simply not make the animation loop and use the action "Animation - Start from beginning" to make it play again (be sure that the animation is not set to loop). That's how you manually handle a looping animation.

I must admit otherwise that I have no idea what your issue actually is.

What do you expect your project to do and what is effectively happening ?
According to what I can gather from the code, this is working as programmed. So I don't get where you are having an issue.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
296
S
119
G
96
Posts: 7,332
Reputation: 71,306

Post » Fri Apr 08, 2016 10:53 am

You will never get a timer in sync with an animation. Useless to try.

If you want something to happen on the end of an animation, then set the animation in 'no loop'.
Use the 'on animation end' trigger to do wath you need at that time and restart the animation. Now the animation loops and you can use the triggers as timers.

If u want to change in animations (by inst. directions changes) to happen after the previous animation ended, not during. Then record the need to change in a variable. Something like 'on key pressed' set variable to 'number of key pressed" Add to the trigger 'on animation end' an event that compares the variable. Reset the variable in an action, change animation.

That are the two things that i can understand out of youre incomplete info. Did i understand it wrong, then write exact what you want the sprite to do when what is triggerd.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: pegasus6464 and 27 guests