pause all action for X seconds

Get help using Construct 2

Post » Thu Jan 19, 2012 3:19 pm

The syntaxe I used to write the code above is what I found mimic c2 event sheet the closest.

[code]+Object: Condition
->Object: Action[/code]

I use "+" for condition and "[indentation] ->" for action
When I indent condition block it means they are nested
[code]+Object: condition
+Object: nested condition
    ->Object: action[/code]

The code I posted above is at beginner level (if you except the use of dt which is just a tad more advanced... maybe)
as dt is the time between two tick of the game, the 'Timer' variable will just count time.

Anyway, if you don't understand the code above, you need to follow some tutorial and read the manual.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu Jan 19, 2012 3:34 pm

I will. Thank you
B
6
G
1
Posts: 44
Reputation: 1,220

Post » Fri Jan 20, 2012 3:08 am

ok i did what you said it seem to work. now to make it work properly i would need a way to send it to send it to a different mode than 0 at the end.

for exemple instead of mode=2
                         timer>pauseDuration : set to mode0

i would need something more like: mode=2
                                  timer>pauseDuration : set to lastmode+1

or something like that. i dont know if it would work or if im clear.
B
6
G
1
Posts: 44
Reputation: 1,220

Post » Fri Jan 20, 2012 3:13 am

then i could do mode 3.4.5.6.7... for each different wave because every time they will be stronger or just completely different monster
B
6
G
1
Posts: 44
Reputation: 1,220

Post » Fri Jan 20, 2012 3:25 am

You can do :
[code]+System: mode = 2
+ System: Timer > pauseDuration
    -> System: set pauseDuration to pauseDuration + Mode (at that moment, mode should be = 2)
    -> System: set mode to 0
[/code]

This should add 2 (seconds) per wave.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Fri Jan 20, 2012 3:29 am

thats not what i want to do. right now the first wave are very weak monsters. the first wave = mode0.

as you see every time every monster are dead and 30 secondes has passed, it go back to mode0. i want it to go to mode3 so i can make a stronger wave with different monsters. then when they are all dead and 30 second has passed it goes to mode4. etc

i guess i dont explain it very well :S
B
6
G
1
Posts: 44
Reputation: 1,220

Post » Fri Jan 20, 2012 3:49 am

Well the meaning of the variable in my example is not the same as the meaning you want to put in it.
My variable "mode" meant to differenciate phases in cyclic events (I could have called it "phase" instead of mode then)
You on the contrary want to make something evolve.
So, along with the mode (or phase if you want to rename it) variable, you need another one which will carry the meaning of "difficulty"
Then you can, as Kyat suggested, use this variable to increase the time of each wave like

atkDuration = 30 + 10*difficulty
30 would be the starting point
10 would be the increment of each difficulty mode (if you increment it one by one)
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Fri Jan 20, 2012 4:03 am

hmmm. im probably retarded because no one seems to understand :(

i want each wave to be completly different and easy to cuztomize. maybe a group for each one, wave1 (8 monster, that spawn at every 3 seconds, with 5 health), wave2 (6 mmonster that fire at player, spawn at every 2 seconds), and so on.

the only thing i want to stay the same for each wave is for how the wave is activated and that when every monster is dead there is a pause of 5 seconds and then we move to another wave.
B
6
G
1
Posts: 44
Reputation: 1,220

Post » Fri Jan 20, 2012 4:07 am

yeah that's what I said, the "mode" variable will give you the "stay the same part" you refer to.
You need other variable to build difficulty over waves.

If you want to pick in a list of monster you have, you will have to have a way to know what monster in what wave. Maybe you can have an instance variable in your different monster that will tell in which wave they belong, or maybe you can have a big array that hold the pattern of each wave.
But definitely don't use the "mode" variable for other thing than handling phases.Yann2012-01-20 04:08:13
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Fri Jan 20, 2012 4:16 am

yeah i think the best way to go would be to treat each wave individually. the thing is i dont know how to when they all die, pause, go to wave1, then 30 seconds pass, they all die, pause, go to wave2, etc
B
6
G
1
Posts: 44
Reputation: 1,220

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Yahoo [Bot] and 5 guests