Automaticly added Alterable values.

New releases and general discussions.

Post » Tue Aug 12, 2008 12:29 am

A return from long hiatus \o/. I was in the finnish army for six months. I have been back for a month but haven't got time to lurk here :P.

I have few questions about families. I made a sprite and a text object. I assigned them to family Blue. Then I opened the event sheet editor and checked what conditions and actions "Blue" would contain. They were actually exactly same as sprite's features. ALTHOUGH the family contained a Text object also. If I assigned the family first to the text object, the family would get the features of the text object. However, a Text object and a Sprite do have common properties, for instance, they both have private variables and they both have action "destroy". But when I tested incrementing a variable 'yeah' ([code:630vlyhr]MouseKeyboard: 6 On key Enter pressed
> BlueAdd 1 to 'Yeah'[/code:630vlyhr]
) which I created to family blue, according the debug dialog, none of the objects got their values increased. As I tried to set variable to 5, Construct crashed. As I tried to destroy "Blue", it worked and both objects destroyed. Some bugs here, eh ;D?

But my question is, if there is many object types in a family, will or should family "inherit" their all features? And should user be able to manage some family features so that the members of the family would inherit them? Currently adding a private variables to family just adds the private variable to the each member of the family. Removing the family from an object doesn't remove the variable set by the family, and adding new member that doesn't have the common variable to family totally removes all releated events. This is deifinitely a bad thing. I event managed to mess my variables up so that one sprite had three variables: "yeah", "yeah" and "". Yes, same variable twice and a blank.
B
3
S
2
G
5
Posts: 263
Reputation: 2,201

Post » Tue Aug 12, 2008 12:53 am

Ah, you shouldn't be able to add different object types to a family. Families all have to be the same type of plugin (ie. all sprites, all text). You shouldn't be allowed to add text and sprite to a family - that's why it messes up and crashes.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Thu Aug 28, 2008 9:59 pm

[quote="Ashley":2jewp5p8]Ah, you shouldn't be able to add different object types to a family. Families all have to be the same type of plugin (ie. all sprites, all text). You shouldn't be allowed to add text and sprite to a family - that's why it messes up and crashes.[/quote:2jewp5p8]

I realised one more thing about this. Even if the objects that belong into family are of same type, their behaviours might not be. How families should support this? I noticed that currently using families with behaviours doesn't work.
B
3
S
2
G
5
Posts: 263
Reputation: 2,201

Post » Thu Aug 28, 2008 11:06 pm

Behaviors are only included if all the objects in the family have the behavior.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Thu Aug 28, 2008 11:21 pm

[quote="Arima":3rkqrb3d]Behaviors are only included if all the objects in the family have the behavior.[/quote:3rkqrb3d]

That's why I they don't work - I had the physics and dragdrop behaviors with every member, and dragdrop doesn't show in event sheet editor's tabs at all and physics tab is empty.
B
3
S
2
G
5
Posts: 263
Reputation: 2,201

Previous

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 2 guests