[Suggestion] Enable/Disable Instances

Discussion and feedback on Construct 2

Post » Mon Aug 27, 2012 3:42 am

Disabling an instance would cause it to become invisible and not be effected by any events until it is enabled again.
B
2
Posts: 4
Reputation: 533

Post » Mon Aug 27, 2012 6:15 am

I actually support this idea very much.
Its annoying when I need to disable all the events in a group relating to my character, as well as one by one disable each behavior, make it invisible. Then finally, reverse this process to make him appear again.
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Mon Aug 27, 2012 8:09 pm

[QUOTE=purge] Disabling an instance would cause it to become invisible and not be effected by any events until it is enabled again.[/QUOTE]

It can be made using simple events.

Make a Boolean instance variable called ON_OFF inside the instance you want disable.

Make all the events for this instance check if the variable is ON, set it visible, so, when it's not ON, it'll not reproduce any of the events nested in it.

Also, make a new event checking if the instance if OFF, when OFF, set it invisible.

It will affect each instance individually, and only the instances with the variable ON will be affected by the events.

For more info about how instance variables works, please, read this single tutorial: Understanding UID, IID, Health of Enemies and Rocket smoke trail.
ImageImageImageImageImageImage
B
92
S
19
G
12
Posts: 1,192
Reputation: 18,276

Post » Mon Aug 27, 2012 8:22 pm

I would put them all in one family and then do what telles0808 wrote.

[QUOTE=purge] Disabling an instance would cause it to become invisible and not be effected by any events until it is enabled again.[/QUOTE]
Enabling/disabling instances could be extremely confusing. From what you wrote, you could easily destroy and create sprites when you need them.
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Tue Aug 28, 2012 3:43 am

@shinkan but it'd lose all it's instance variables.
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Tue Aug 28, 2012 11:36 am

Indeed, it will loose all variables... but still it's easy to walkaround.
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Tue Aug 28, 2012 4:58 pm

Not without a bunch of global variables though, right?
B
36
S
10
G
6
Posts: 948
Reputation: 11,101


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests