How do I make all objects on a single layer solid?

Get help using Construct 2

Post » Tue Jan 21, 2014 12:03 am

So I have these layers, and they're invisible, but I want the layers to at some point become visible and I want all objects on that layer to become solid at once. Is there an easy way to do that?
B
11
S
2
G
1
Posts: 172
Reputation: 1,486

Post » Tue Jan 21, 2014 10:24 am

If we knew why you want this it would help to give a better answer.

Layers can be set to be visible or not - I have not used it but that might be your answer ?

How many objects ? Set a boolean flag for the solid enabled/not ?
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Tue Jan 21, 2014 10:39 am

What does it mean to set a flag?

Right now my game randomizes the layout of my dungeon room by randomly selecting a pre-designed layout, which has its own dedicated layer, and setting the layer to visible. Unfortunately, it doesn't make the objects solid, obviously, so I need to find a way to (hopefully easily) make all objects in the visible layer solid too. Also, for the purpose of saving memory, I should probably delete all the other invisible objects as well. So... is there a trick for deleting the contents of an entire layer all at once?

So that's two questions:
1. Make all objects on a single layer visible
2. Make all objects on the other random layers deleted
B
11
S
2
G
1
Posts: 172
Reputation: 1,486

Post » Tue Jan 21, 2014 10:40 am

Would something as simple as this work?

If layer is invisible
Object is on layer
trigger once
-set solid behaviour disabled

if layer is visible
object is on layer
trigger once
-set solid behaviour enabled
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jan 21, 2014 11:25 am

Thanks for the idea, but I don't think it's going to be that simple. I'm struggling with this... I may have to resort to posting my file later, but I'd feel more comfortable doing it privately if someone with a lot of ability and experience could advise me.
B
11
S
2
G
1
Posts: 172
Reputation: 1,486

Post » Tue Jan 21, 2014 11:34 am

Why wouldn't it be this simple?

And thanks for doubting my ability and experience.. :p
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jan 21, 2014 11:37 am

Stuff all the desired objects in a family, and when triggered to show the layers also activate the solid state for the family objects.

Or add a sub to the make layer visible, add event pick all from system, select desired object, and set solid state enabled.lennaert2014-01-21 11:38:06
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Tue Jan 21, 2014 11:44 am

@Lennaert

You'd have to check if the family members are on the layer, right?
Else you'd set them solid across all layers.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jan 21, 2014 11:50 am

[[email protected]] Lennaert

You'd have to check if the family members are on the layer, right?
Else you'd set them solid across all layers.[/QUOTE]

That depends if he has similair objects on other layers.

If he has he could easily add an extra check for that.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Tue Jan 21, 2014 1:30 pm

[QUOTE=LittleStain] Why wouldn't it be this simple?

And thanks for doubting my ability and experience.. :p[/QUOTE]

Sorry about that inconsiderate comment. I can see that you're very experienced and I'm not. You may very well be correct, but when I tried to implement your suggestion it didn't work. Probably I'm just doing it wrong. I need to find a way to group the objects I think before it'll work.
B
11
S
2
G
1
Posts: 172
Reputation: 1,486

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 27 guests