How do containers actually work?

Get help using Construct 2

Post » Sat Nov 24, 2012 7:37 pm

@Ashley
I'm starting to suspect containers in my construct (110.2) is bugged out and probably the source of my confusion. Can you take a look at this scene and tell me this is normal behaviour? :)

https://dl.dropbox.com/u/4898391/container_test.capx

When you run the cap, is the output the same as this image? https://dl.dropbox.com/u/4898391/containers.PNG

Why is one family member added to the hotspot of some of the other members?

Thanks for all the hard work you put into Construct 2, I don't mean to be ungrateful for all the shiny features. I'm trying to solve a problem I've had with all game making software since, well, ZZT; re-usability and prefabing.Julmust2012-11-24 19:49:17
B
16
S
6
G
6
Posts: 100
Reputation: 4,840

Post » Sat Nov 24, 2012 7:38 pm

@Kyatric

Thanks for the clarification. I'm starting to suspect I have a bugged version for some reason :)
B
16
S
6
G
6
Posts: 100
Reputation: 4,840

Post » Sat Nov 24, 2012 9:28 pm

@Julmust: It works as intended. Your version is not bugged.
Sprite7 is a "end of cliff" and Sprite5 is a "ground tile".

Sprite5 contains Sprite7.

In the layout you have two Sprite7 for four Sprite5.
So when you launch your project, due to the nature of containers, the missing Sprite7 are automatically spawn in the layout.

Hopefully this modified capx will help you visualize the action of containers.
It is your project with simple events to hopefully make sense of what's happening.

When you put your mouse cursor over a Sprite7 the opacity of the associated Sprite5 is modified.Kyatric2012-11-24 21:28:55
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Sun Nov 25, 2012 7:28 pm

@Kyatric Oooooh I see... Of course. That was the distinction from families I was looking for. I thought it worked like how Construct generally work (you have to have at least _ONE_ instance of the object in the scne) but with Containers you have to have atleast one instance of each object referencing it. gotcha. Thanks for your time and effort :)Julmust2012-11-25 19:28:49
B
16
S
6
G
6
Posts: 100
Reputation: 4,840

Post » Wed May 18, 2016 1:43 pm

@Ashley @Kyatric

Sorry for resurrecting an old post. But I had few questions on Containers too. I have a Container with sprites having different frames, say base sprite with 2 frames for Red and Blue soldier, Helmet sprite with again 2 frames fir Red and blue respectively.
I place the 1 Red and 1 Blue Base sprite on the layout at design time. When the game is run, I want the Red base to get teh red Helmet and similarly Blue base to get Blue helmet. How can I achieve this?
Create your own Isometric Runner Game using C2:

Image

Check out my game "Last of the Survivors":
Play Store
App Store
B
45
S
7
G
1
Posts: 356
Reputation: 3,772

Post » Wed May 18, 2016 2:44 pm

@SamRock: Compare the frames of the Base and set the same frame in the Helmet.

Or even better, consider setting your images in different animations ("Blue" and "Red" for example).
If Base animation is "Blue", set Helmet animation is "Blue".
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 16 guests