No containers? I just realized how bad it is...

Discussion and feedback on Construct 2

Post » Mon Jun 18, 2012 10:40 pm

Well, that's too bad.

I'm trying to create game with composite characters. Each character has cube sprite with platform behavior. But the whole mess begins when you trying to control _multiple_ instances of one enemy specie.
That problems could be easily solved by original construct's container system... which don't exist here.
I've suddenly realized how I am deep in troubles for now.NugMan2012-06-18 22:43:40
B
19
S
6
G
4
Posts: 171
Reputation: 2,507

Post » Mon Jun 18, 2012 10:57 pm

Yes, that's what's kept me from trying to do it. I've heart it is on the todo list, but when?
B
29
S
11
G
12
Posts: 281
Reputation: 11,868

Post » Mon Jun 18, 2012 11:07 pm

Containers' last mention.
I'm just broken till when it done. I thought that containers are so basic (well, after quite big possibilities of Classic 2 years or so ago), damn .
Anyway, I should be able to achieve my goals with UIDs and IIDs picking. But containers were the one and only elegant choice for me just 1 hour ago - that's why I'm so upset.NugMan2012-06-18 23:08:52
B
19
S
6
G
4
Posts: 171
Reputation: 2,507

Post » Mon Jun 18, 2012 11:16 pm

As long as the number of objects add up to the same, going by iid is fairly reasonable.
As in this index = that iid, blah, blah, blah.
One draw back from CC's containers was that creation, and destruction were tied together.
It would be nice if there were some flag you could apply. Telling if a contained object should be created with its parent, etc.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Mon Jun 18, 2012 11:25 pm

Another drawback - more lines of code - which contradicts the basic idea of both Constructs.
I'm also bad at programming - that's yet another drawback.

Ahh, if we could only knew approximate release date for containers ( @Ashley @Tom )...NugMan2012-06-18 23:30:51
B
19
S
6
G
4
Posts: 171
Reputation: 2,507

Post » Mon Jun 18, 2012 11:33 pm

Containers are easily implemented with events.

Say you want a container with 2 objects: Sprite* and Sprite2
* Sprite will be the primary object of the container. If you want to destroy or create the container destroy/create Sprite.

//first all container objects are created for each Sprite
+On start of layout
--- Sprite2: destroy
--- Sprite: spawn Sprite2

//creating a container
+Sprite: on created
--- Sprite: spawn Sprite2

//destroying a container
+Sprite: on destroyed
+System: pick Sprite2 instance Sprite.IID
--- Sprite2: destroy


//Then for simple container picking
+every tick
--- Sprite2: set position to Sprite

//Or when you want to pick the contained objects after some other picking has been done:
+for each Sprite
+System: pick Sprite2 instance Sprite.IID
--- Sprite2: set position to Sprite
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Tue Jun 19, 2012 1:30 am

good to know, must try this way, i for one always use a var and uid of the parent object, but i hate it when for some unknown reason they get misaligned somewhere down the road and they start to pile up when destroyed, uhhh vtrix2012-06-19 01:30:35
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Tue Jun 19, 2012 1:32 am

R0J0hound's idea works, but it gets quite messy! I have characters that have 8 "parts." Every time I want to modify the character as a whole, I have to create 8 events; it kind of sucks!
B
51
S
13
G
8
Posts: 194
Reputation: 7,311

Post » Tue Jun 19, 2012 1:49 am

ROJOhound is the best programmer ive known on this forum, also Yann is the second place.
B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Post » Tue Jun 19, 2012 2:47 am

I remember wanting containers, but I think I'm fine without them now I can't even remember why I wanted them. I feel there's more flexibility without containers, and only adds a few extra lines of code. I can have every enemy use the same detector object and attach what every sprite I want to it just using 'for each' and comparing to an ID.
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Next

Return to Construct 2 General

Who is online

Users browsing this forum: blackant, newt and 2 guests