[Updated Request] Sys. Action - Destroy All Objects On Layer

Discussion and feedback on Construct 2

Post » Sun Nov 27, 2016 10:38 pm

The Feature Request:
I would like to request a system action with the purpose of destroying all objects on a selected layer.

Practical Example Of Use:
This action could make it possible to unload/destroy all objects on a certain layer by simply using one action.
Developers could for example destroy certain parts of their layer-segmented "gameworld",
without having to create many individual event-loops to destroy each type of object or object type family.

Minor Technical Details:
Plugin: System
Type: Action
Name: Destroy All Objects On Layer
Category: Layers & Layout
Basic Programming Logic: Get all objects on *layername* > Destroy all detected objects (including all instances)
Additional Requirements: Requires a window with textbox-input for the user to add the name of the layer.

@Ashley I would very much appreciate this feature or a short statement about this feature request.
I could also provide more information or practical examples of use if required. Thanks for your time!



Update:
TheRealDannyyy wrote:HERE is a plugin to do the thing mentioned in this request. Plugin made by one of our JS magicians that goes by the name of @Armaldio.
(C0 and everybody can feel free to use the code in one of their own plugins if they like to.)
Last edited by TheRealDannyyy on Tue Nov 29, 2016 6:58 pm, edited 3 times in total.
ImageImageImage
B
61
S
22
G
78
Posts: 646
Reputation: 44,755

Post » Mon Nov 28, 2016 3:45 am

That would be a useful feature but I don't think Ashley will implement it. The reason why is you can make a variable and when the variable is triggered true , it will destroy all the objects in the layer you want. If you want multiple events to trigger all the objects in the layer destroyed, you can make it into a function that way reducing your code.
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 681
Reputation: 16,613

Post » Mon Nov 28, 2016 3:58 am

A grouping like families, except for all world objects might be more feasible.
Image ImageImage
B
169
S
50
G
170
Posts: 8,291
Reputation: 108,726

Post » Mon Nov 28, 2016 4:27 am

You both made your fairly "negative" points towards this request and that's alright but I don't want to get into any further arguments.
I would really appreciate a more "official" approval or denial of this feature request, I'm sure you guys do understand.
Last edited by TheRealDannyyy on Fri Dec 30, 2016 6:57 pm, edited 1 time in total.
ImageImageImage
B
61
S
22
G
78
Posts: 646
Reputation: 44,755

Post » Mon Nov 28, 2016 6:54 am

You can easily implement this by using functions / families. But there is nothing wrong with having too many features. +1

Still, even if it were to be implemented. This will likely be postponed for C3.
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
64
S
19
G
90
Posts: 1,119
Reputation: 59,667

Post » Mon Nov 28, 2016 9:56 am

Yeah, I think it would be better if we could make families more usable so that you can say "Family is in layer -> Destroy" and have it do more or less the same thing. This way seems better since you can extend it to any conditions or actions, not just a special-case "destroy on layer" feature. But as with pretty much any feature suggestion at this point, it probably won't happen before C3.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,782

Post » Mon Nov 28, 2016 2:20 pm

Ashley wrote:Yeah, I think it would be better if we could make families more usable so that you can say "Family is in layer -> Destroy" and have it do more or less the same thing. This way seems better since you can extend it to any conditions or actions, not just a special-case "destroy on layer" feature. But as with pretty much any feature suggestion at this point, it probably won't happen before C3.

Thanks for the lightning speed response.

I just thought this this would be one of the "easier" features to implement compared to fully reworking plugins and so on, since the code for destroying and detecting objects on a layer should already be there (e.g. layer effects apply to all objects on a layer) but if you consider reworking whole engine side mechanics that's fine too.
It's just that recently a discussion about "unloading" certain things came up again and destroying objects is kinda C2's only way to stop rendering objects AFAIK.

Alrighty then, we're looking forward towards improvements that could make a process like this easier inside C3.
ImageImageImage
B
61
S
22
G
78
Posts: 646
Reputation: 44,755

Post » Mon Nov 28, 2016 5:21 pm

destroying objects is kinda C2's only way to stop rendering objects AFAIK

Not at all. Making them invisible will stop rendering them. So will having them out of the boundaries of your current screen.

Blog article on rendering in C2
Oldie but goldy.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,293

Post » Mon Nov 28, 2016 8:42 pm

Kyatric wrote:Not at all. Making them invisible will stop rendering them. So will having them out of the boundaries of your current screen. ...

I find this whole process a bit confusing to be honest.
So what I get from the "Image memory" part is that everything on the current layout is loaded into memory,
meaning that even if you would destroy or set X invisible to stop it from rendering, it's still consuming memory right?

I'm used to systems were you could load parts of the gameworld into memory while releasing others.
Not meaning to say that those kind of systems were perfect, they were mostly coming with micro stuttering on
low end devices but still, I think that 2D games like mine with a lot of high-res sprites would profit from using a method like that.

Anyway, HERE is a plugin to do the thing mentioned in this request. Plugin made by one of our JS magicians that goes by the name of @Armaldio.
(C0 and everybody can feel free to use the code in one of their own plugins if they like to.)
ImageImageImage
B
61
S
22
G
78
Posts: 646
Reputation: 44,755


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 12 guests