Tags

New releases and general discussions.

Post » Sat Jan 16, 2010 12:27 pm

First I started working with Contruct, I started adding variables to objects. Then I discovered Families and I thought that was a great thing to manage many objects. Now I think it is very frutrating. Deleting objects is a nightmare, adding or deleting variables in objects sharing different families too.

I really use families for one thing: Picking objects.

So I would like separate completly families and variables. A simplified version of family; maybe "Tag" concept ?
B
30
S
15
G
10
Posts: 285
Reputation: 7,144

Post » Sat Jan 16, 2010 12:35 pm

Attributes sort of work that way. You can create a custom attribute and use that for picking. You can't perform actions by attribute though. Would be nice if you could, perhaps there is a way that might be implemented?
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sat Jan 16, 2010 3:21 pm

What problems exactly are you having with deleting objects in families and managing variables? The family manager should take care of most of that for you.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Sat Jan 16, 2010 4:40 pm

Well, for one, you can't change the type of a variable in an entire family from the family manager, nor the initial value. You can only add or delete a variable, which has been a source of frustration for me at least, I've had to change two variables from number to text on every member of the family separately in order to not break the code that deleting the variables would cause, and I can tell you that this is quite a frustrating and time-consuming task to do with lots of objects in the family.
B
16
S
8
G
4
Posts: 136
Reputation: 3,144

Post » Thu Feb 04, 2010 12:32 pm

I create a family, add one variable to this family and include an object in this family. If this object has 50 variables, when you assign the family to an empty object, construct forces you to apply 51 variables, when I really want the family expecific one. If I check only the original one and uncheck the other 50, construct gives me this warning: "All events referring to the unselected family variables will be removed". The problem is, when you assign a family to a object, this family absorbs all the variables that alredy exits, so somehow it loses the family sense and dont has family expecific private variables, forcing you to share all of them.
Then if you want remove families and variables... it is a chaos, because you have dependencies everywhere.
B
30
S
15
G
10
Posts: 285
Reputation: 7,144

Post » Thu Feb 04, 2010 1:35 pm

[quote="Aritz":2isrurg4]I create a family, add one variable to this family and include an object in this family. If this object has 50 variables, when you assign the family to an empty object, construct forces you to apply 51 variables, when I really want the family expecific one. If I check only the original one and uncheck the other 50, construct gives me this warning: "All events referring to the unselected family variables will be removed".[/quote:2isrurg4]
That sounds like it's working OK so far: it warns you just in case. If you don't have any events referring to the other variables, it's fine to uncheck them, but Construct always warns you. So here you just need to uncheck all of them except the one you want to share across the family.

[quote:2isrurg4]The problem is, when you assign a family to a object, this family absorbs all the variables that alredy exits, so somehow it loses the family sense and dont has family expecific private variables, forcing you to share all of them.[/quote:2isrurg4]
You lost me here. When you add an object to a family, you should get the "which private variables do you want" dialog, just like you mentioned above. Then all you need to do is, again, remove all the variables you don't want to share across the family (as before, Construct will warn you again, just in case). Is there something you're doing differently?

Family variables are simply the private variables in common to all the objects in the family - you can always organise it by editing each object's private variables individually. If all objects in a family have a private variable in common (same name), it becomes a family variable. That's all; the family manager is there to make this process easier.

Still in Construct 2 I think this should be changed, since it is fairly ambiguous. I guess there could be a separate variables list for a family.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Thu Feb 04, 2010 2:39 pm

[quote:3derp6n5]I guess there could be a separate variables list for a family.[/quote:3derp6n5] :D
B
30
S
15
G
10
Posts: 285
Reputation: 7,144

Post » Thu Feb 04, 2010 4:25 pm

[quote="Ashley":zgxhggfd]Still in Construct 2 I think this should be changed, since it is fairly ambiguous. I guess there could be a separate variables list for a family.[/quote:zgxhggfd]


... We need an emote for forehead smacking :P

That's such a simple and useful idea you can't help but think "wow, it should have been that way from the start." Live and learn, I guess :)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Feb 04, 2010 6:57 pm

Families and objects are somewhat analogous to object orientation and inheritance. Perhaps you should seek inspiration there.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Feb 04, 2010 11:01 pm

That's a good perspective, madster. It sounds like a good way to implement it: families contain "base" variables, effects and behaviors, and objects in the family inherit them. The current "only those in common" is pretty obscure and was retro-fitted in after the main engine was written.

I wonder if we could even throw in encapsulation? Eg. variables only accessible by the object that owns them. Would that be useful in the real world? And polymorphism... can't think of a decent way that would fit in to events.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 6 guests