Turrets attack target with instance variable

Get help using Construct 2

Post » Tue Aug 13, 2013 8:41 pm

Is it possible to have Turrets attack only targets with a specific instance variable?
Epic Space Online - Google it!
B
34
S
10
G
5
Posts: 165
Reputation: 6,687

Post » Tue Aug 13, 2013 10:18 pm

You can limit turrets to only target objects from certain families. Just ensure that the family you're targeting contains objects with only the specific instance variable you want assigned.
B
45
S
15
G
73
Posts: 2,008
Reputation: 43,398

Post » Tue Aug 13, 2013 10:20 pm

What is it you are trying to achive? could you not just have two different enemys?

If you want to do something different with those two different enemys you could just add them to a family.
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Tue Aug 13, 2013 10:41 pm

[QUOTE=plinkie] You can limit turrets to only target objects from certain families. Just ensure that the family you're targeting contains objects with only the specific instance variable you want assigned. [/QUOTE]

Can you explain how this would work? Can you assign objects to a family at runtime?
Epic Space Online - Google it!
B
34
S
10
G
5
Posts: 165
Reputation: 6,687

Post » Tue Aug 13, 2013 11:24 pm

@Taurian

It is for grouping object types. Not 100% sure on what you want to group with but for example you could assign all objects that have a specific instance variable set (e.g. EnemyType:Beast) and put them all in one family called 'Beasts'. Then you can set the turret to target only objects assigned to the 'Beast' family.
B
45
S
15
G
73
Posts: 2,008
Reputation: 43,398

Post » Tue Aug 13, 2013 11:32 pm

[QUOTE=plinkie] @Taurian

It is for grouping object types. Not 100% sure on what you want to group with but for example you could assign all objects that have a specific instance variable set (e.g. EnemyType:Beast) and put them all in one family called 'Beasts'. Then you can set the turret to target only objects assigned to the 'Beast' family.[/QUOTE]
Ok,

I have this object, and during runtime it's Variable, "Type" was set to beast, how do I add that specific one to the Beast Family?Taurian2013-08-13 23:33:07
Epic Space Online - Google it!
B
34
S
10
G
5
Posts: 165
Reputation: 6,687

Post » Wed Aug 14, 2013 12:01 am

@Taurian

I'm not sure you would need families then for that. If your object was imported as e.g. 'PLAYERMAN' you would just create a function : turret target 'PLAYERMAN' if variable type = beast.
B
45
S
15
G
73
Posts: 2,008
Reputation: 43,398


Return to How do I....?

Who is online

Users browsing this forum: Darth Crusher and 9 guests