How do I - make repeat or loop for several actions?

Get help using Construct 2

Post » Tue Apr 11, 2017 10:38 am

Here we go again, I have another issue right now.

I have problem about repeating several actions.

In my event sheet, it goes like this:

{I want to make repeat/loop from here}
(event) System: on start of layout > (action) stop animation
(event) Mouse: on left button clicked on object > (action) animation start
(event) System: Time = 4 seconds > (action) create object

{to here for the repeat/loop}

NOTE: The system time is for waiting from mouse clicked until the object created.

This several actions that I want to repeat/loop but I can't figure it out.

Any Advice? I'm blank right now :cry:
Great person aren't made by praise and laugh but insult and tear
B
13
S
3
Posts: 36
Reputation: 861

Post » Tue Apr 11, 2017 10:52 am

What are you trying to do? Wait for the player to click? You don't need a loop for that.

You can repeat a action with the system events "Every tick" or "Every Second". The loop you are going to use when you have a determined amount of repetitions you want to execute.

Sorry if I can't be clearer but I didn't quite understand what you are trying to do LOL
B
17
S
7
Posts: 280
Reputation: 2,522

Post » Wed Apr 12, 2017 4:15 am

I'm not sure what are you trying to do too. Why do you want to repeat "on start of layout" trigger? These trigger usually placed in front of the other condition, example:

Code: Select all
on start of layout {
   stop animation;
}
on object clicked {
   start animation;
   wait 4 seconds {
      call function create_object();
   }
}

All those codes above inside the event sheet is repeated every tick by system default.

You're asking about repeating several actions, but your illustration in the first post shows like you're repeating several condition.
B
33
S
10
G
2
Posts: 46
Reputation: 3,063

Post » Fri Apr 14, 2017 5:14 pm

To @RayKi & @tmntppn
Sorry before for being unclear with my post. I'll try now to make it clearer.

Due to the game that I make is about restaurant, I have an object of frying pan that animated for few seconds (animation initial state of this object is disabled).
At start of layout, I want to make the frying pan to animate first, then after animation finished or stop to animate, it spawns another object as results (this is like when you cook for few minutes, it will result the dish).
Then, if I click again in the frying pan object, it will animated again, and repeat resulting another object as result (or you could say the dish).
That's what I want to repeat all over again.

I hope that it would make it clear to you, guys.

I have try the condition in my first post but it didn't work at all.I have no idea what's going on or what's wrong with mine. It was killing me, guys.

Hope that you could help me a bit and lifting my burden.
Great person aren't made by praise and laugh but insult and tear
B
13
S
3
Posts: 36
Reputation: 861

Post » Mon Apr 17, 2017 5:06 am

Like this: https://www.dropbox.com/s/8l97n86okvolr5c/cook.capx?dl=1?

- Click the grey square to start cooking.
- Once cooking is complete, a red box is spawned (the dish).
- Remove the dish from the pan (drag the dish somewhere else).
- When the pan is empty, click again to restart.
B
33
S
10
G
2
Posts: 46
Reputation: 3,063

Post » Tue Apr 18, 2017 7:52 am

Message: Darknessed can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
tmntppn wrote:Like this: https://www.dropbox.com/s/8l97n86okvolr5c/cook.capx?dl=1?

- Click the grey square to start cooking.
- Once cooking is complete, a red box is spawned (the dish).
- Remove the dish from the pan (drag the dish somewhere else).
- When the pan is empty, click again to restart.


Thank You @tmntppn for your sharing idea but at the moment I'm working on another project so, this one I must hold for now, but when I'm done with it, I'll definitely come back to this project and observe your example capx. :D
Great person aren't made by praise and laugh but insult and tear
B
13
S
3
Posts: 36
Reputation: 861

Post » Tue Apr 18, 2017 9:50 am

Glad to help. ;)
B
33
S
10
G
2
Posts: 46
Reputation: 3,063


Return to How do I....?

Who is online

Users browsing this forum: Lordshiva1948, worm1, Yahoo [Bot] and 20 guests