• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker [Solved] How will you handle troop teams?

S

SeirLord Games

Guest
Okay, I was thinking about something that should work:

For example we have the following;
- IA1 -> Team 1
- IA2 -> Team 1
- IA3 -> Team 2

Then when the IA1 creates soldiers, it will create obj_soldier_1, where 1 is the team number. This object will have the variable 'ia', which will be equal to IA1, this allows the soldier to interact with the IA1 and vice versa.

And the same with the IA2, it will create obj_soldier_1, with the difference of the variable 'ia', which will be equal to IA2.

Then we have IA3, which will create obj_soldier_2.

This allows obj_soldado_1 to make 'instance_nearest' of soldiers that are not from their team without problem.

It's easier than I thought, I leave this here in case someone has the same question or serves you.

A greeting!
 
Top