Families and Variables

Get help using Construct 2

Post » Sun May 15, 2016 3:22 pm

Is there any way to make objects from families share variable types, but give them each individual amounts OF that variable?

Let's say I have 3 bullet types in the family "PlayerShots". I want each to do an individual amount of damage, but I don't want to have to make each enemy have 3 different reactions to said bullets, but instead just subtract their health by the variable in each individual bullet's damage amount.
B
30
S
14
G
6
Posts: 29
Reputation: 5,507

Post » Sun May 15, 2016 3:43 pm

I think I understand you but I'am not %100 sure. I made a game where you buy guns and each upgrade does more damage to the zombies. Better yet if you got an android device run my game and then tell me if thats what your looking for.

https://play.google.com/store/apps/deta ... ead.nights
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 682
Reputation: 16,635

Post » Sun May 15, 2016 4:36 pm

Smedis2 wrote:Is there any way to make objects from families share variable types, but give them each individual amounts OF that variable?

Let's say I have 3 bullet types in the family "PlayerShots". I want each to do an individual amount of damage, but I don't want to have to make each enemy have 3 different reactions to said bullets, but instead just subtract their health by the variable in each individual bullet's damage amount.


Yes, set the variable on playershots then edit all the members of playershots individually in the editor on the object list, changing the default value of the damage variable for them. Newly spawned instances of all those objects should correctly use the same default values as other bullets of that type.
B
15
S
6
Posts: 85
Reputation: 1,195

Post » Tue May 17, 2016 10:30 am

Pulstar wrote:
Smedis2 wrote:Is there any way to make objects from families share variable types, but give them each individual amounts OF that variable?

Let's say I have 3 bullet types in the family "PlayerShots". I want each to do an individual amount of damage, but I don't want to have to make each enemy have 3 different reactions to said bullets, but instead just subtract their health by the variable in each individual bullet's damage amount.


Yes, set the variable on playershots then edit all the members of playershots individually in the editor on the object list, changing the default value of the damage variable for them. Newly spawned instances of all those objects should correctly use the same default values as other bullets of that type.


Welp. I thought that didn't work. I recall a previous time where I tried that and the variables all remained the same for ALL objects in the family. Thread can be closed and locked, I was being silly.
B
30
S
14
G
6
Posts: 29
Reputation: 5,507


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 9 guests