Include and start layout strange behavior.

Discussion and feedback on Construct 2

Post » Sun Sep 04, 2016 10:51 am

Hello, I go straight to the point.
Why the sprite is not destroyed?

The eventsheet 2 is included after set the global variable "level" to value 1 but the sprite is not destroyed in the eventsheet 2.

https://dl.dropboxusercontent.com/u/60803633/testStartLayout.capx

EVENSHEET 1 IS INITIAL EVENTSHEET FOR THE UNIQUE LAYOUT

Image

EVENTSHEET 2

Image
B
30
S
13
G
21
Posts: 838
Reputation: 14,656

Post » Sun Sep 04, 2016 11:24 am

Although event sheet 2 is at the bottom of event sheet 1, execution precedent-wise for the trigger "on start of layout" in the included event sheet is executed before the trigger "on start of layout" in event sheet 1.

I think the behavior is correct.
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Sun Sep 04, 2016 2:38 pm

I know that programming languages work in this mode and the "include" block always is positioned in the beginning.
If that is how it C2 works then I'm wrong and you're right.

It would be good block "include" not have a choice to move in the eventsheet.
B
30
S
13
G
21
Posts: 838
Reputation: 14,656

Post » Sun Sep 04, 2016 5:19 pm

Yeah by the time level = 1 the start of layout checks are already finished. You can replace "Start of layout" in event sheet 2 with "Trigger Once".
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Sun Sep 04, 2016 8:08 pm

also a quick note I remember (seems to not have been changed): included triggers fire always first, then the one on the event sheet fires, dunno why (if you putted the content of the include instead of the include, it actually is destroyed).

for the normal events, they run from top to bottom, so it can be legit for an include to not be on top.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests