# Every Tick conflict?

Get help using Construct 2

### » Mon Oct 05, 2015 11:32 pm

Does having multiple every tick events conflict with anything? if i want things to fire in a certain order, and have 2 every tick events will that cause problems? I am having weird things happen in my game =/
B
10
S
4
G
3
Posts: 223
Reputation: 3,463

### » Mon Oct 05, 2015 11:44 pm

The way I understand it, is code on a sub-branch will fire at the same time. At least that is how it happens in my experience.

Every Tic
> Do X
> Do Y
> Do Z

XYZ fire at the same frame.

Every Tic
> Do X
>> Do Y
> Do Z

XZ fire at the same time, then Y goes after X is done.
B
71
S
25
G
20
Posts: 1,761
Reputation: 18,268

### » Mon Oct 05, 2015 11:50 pm

"Does having multiple every tick events conflict with anything?"
No, they are just run in the order they are placed in the event sheet.
B
97
S
36
G
131
Posts: 5,514
Reputation: 83,466

### » Tue Oct 06, 2015 1:00 am

Wait, explain sub events again plz, because i have an event, it changes a variable, in that same event i have sub events depending on the if of the variable. am I doing it wrong?

The reason being is, in my game you die and respawn, and have ai that respawn as well, but it is saying '''respawning''' when I am already respawned, when ai allies are respawning.
B
10
S
4
G
3
Posts: 223
Reputation: 3,463

### » Tue Oct 06, 2015 1:41 am

If you have it like this:

Top Event
>Variable = 0 => Set Variable =1
>Variable = 1 => Set Variable =0

The final result is that Variable=0

Because the second event is true since it follows the first. They all occur in the same frame, but the order is preserved so the first event fires and set Variable to 1 followed by the next.
B
71
S
25
G
20
Posts: 1,761
Reputation: 18,268

### Who is online

Users browsing this forum: No registered users and 4 guests