[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
37
S
11
G
6
Posts: 962
Reputation: 11,254

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
Image
B
98
S
21
G
16
Posts: 1,338
Reputation: 21,152

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
155
S
61
G
41
Posts: 2,577
Reputation: 34,314

Post » Tue Aug 28, 2012 3:43 am

@shinkan but it'd lose all it's instance variables.
B
37
S
11
G
6
Posts: 962
Reputation: 11,254

Post » Tue Aug 28, 2012 11:36 am

Indeed, it will loose all variables... but still it's easy to walkaround.
ImageImageImageImage
B
155
S
61
G
41
Posts: 2,577
Reputation: 34,314

Post » Tue Aug 28, 2012 4:58 pm

Not without a bunch of global variables though, right?
B
37
S
11
G
6
Posts: 962
Reputation: 11,254


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests