Families are overrated?

Discussion and feedback on Construct 2

Post » Tue Feb 14, 2012 4:06 pm

That's a good point @Yann, using families as a second independent object-picking list is probably the best unintended feature of families!
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Tue Feb 14, 2012 4:48 pm

Also during dev, it happens that you make 2 really different objects.
That never shares any kind of behavior or aren't close enough to justify any blending.
But one day you discover that you begin to copy paste many identical stuff. Like if you want to destroy a bunch of sprite on game over or because of a brand new feature you just added that spawn a nuclear warhead that destroy everything within a certain range (decor tiles, enemy and pickup sprites) here family come really handy. You just have to create a 'destroyable' family and test for distance or invisible radius sprite overlap.


The other possible thing you could do is a pokemon kind of game.
yes you could have all pokemon animation in only one object.
But having dedicated sprite for each pokemon allows you to do something interesting : setting default parameters and some list of attack ID in variables during edit time.
And then just drive all your pokemon with the family system.
That's very powerfull, 'cause the work around without family would be to put all the pokemon in one pokebal... erm 'pokemon' sprite :D
And then have a CSV string for default properties of each pokemon.
Pretty painfull to maintain. You'll have to keep track of which line match which pokemon.

@Ashely
Anyway, I might be wrong, but there's still on thing in this design that work better with one sprite instead of family: a random creation system.
It would be intersting to be able to do a
System: create pokemon[floor(random(pokemon.ObjecttypCount))]
to spawn random pokemon in the overworld.
Well you could have just a little sprite with all the pokemon for the overworld display and do a set frame to random(animationframecount)
But then you'll still have to be able to call a specific objecttype within the family.
So yeah objecttype index and object creation using expression could be a plus.

Edit: Just saw that Creating family creates a random object from the family. But still, having an index could be interesting for weighted randomness or if we want to match some stuff to the order of the objecttype in the family (like a 'thumbnail' family would relate to a 'photo' family by the order of their member)Yann2012-02-14 18:32:58
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Tue Mar 05, 2013 6:07 pm

I just got my license and was excited about implementing families. Seems good for a lot of things, but I was kind of thinking about them like a class. I might be wrong about that though...

I have a character that can pick up objects, so I put all the pickup objects in an "objects" family. Then instead of having a separate function for each object I created a generic function for "pickupObject". Woot! The problem I'm having is that it doesn't seem like you can reference your particular instance once you discover it. I want to pickup when I'm overlapping an object, but I don't want to pin all the objects in the layout to the player at the same time.

Is there a way to get Objects.name or this.Object or something so I can pin just the object I'm overlapping with? I can't find anything like this...
B
8
S
1
G
1
Posts: 37
Reputation: 1,326

Post » Tue Mar 05, 2013 6:17 pm

I'm pretty sure instance picking with families should work differently to what you are stating - could you share a capx so we can see your issue?
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Tue Mar 05, 2013 6:23 pm

@GabeOfThrones
You can pass the object's UID to the function and use that to pick it.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,000

Post » Tue Mar 05, 2013 6:48 pm

Ramones! Thanks! UID was what I was looking for!
B
8
S
1
G
1
Posts: 37
Reputation: 1,326

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: 99Instances2Go, TGeorgeMihai, TheRealDannyyy and 7 guests