• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to squad 101

Status
Not open for further replies.
Hey Hazop

I wouldn't be caught dead downloading that map file, testing it and building my own explanation of what's wrong.

Anyone who does that for you is an idiot.

Can you clarify what this is, what you think it's supposed to do, what you think it's not doing correctly, and where you suspect the problem is coming from? Please show all the code directly here in thread.

Best of luck!

Cheers
 
Level 14
Joined
Jul 2, 2015
Messages
878
Hey Hazop

I wouldn't be caught dead downloading that map file, testing it and building my own explanation of what's wrong.

Anyone who does that for you is an idiot.

Can you clarify what this is, what you think it's supposed to do, what you think it's not doing correctly, and where you suspect the problem is coming from? Please show all the code directly here in thread.

Best of luck!

Cheers
Its a script for a battalion/squad system, akin to what MechanicalMan has in his God Fall campaign, where a captain controls a squad of infantry owned by a friendly faction.

Each captain has a mana pool with = the amount of soldiers in that battalion, if a captain has 3/4 mana, that means that (including himself) there are 3 of the total troops available in the unit.
When the captain dies, it resurrects it and swaps it with another random squad member and kills the replacing unit

The issue currently is that the soldiers of the squad (not including captain) dont spawn when the squad is created via training captain, or when the captain is pre-placed map start.

This is the map file with literally only the code and 2 example units
Example Map | HIVE

I'll post the code in either screenshots or notepad or smth a bit later
 
Level 6
Joined
Mar 7, 2011
Messages
124
I'll post the code in either screenshots or notepad or smth a bit later
please post the code as text lol

Each captain has a mana pool with = the amount of soldiers in that battalion, if a captain has 3/4 mana, that means that (including himself) there are 3 of the total troops available in the unit.
When the captain dies, it resurrects it and swaps it with another random squad member and kills the replacing unit

The issue currently is that the soldiers of the squad (not including captain) dont spawn when the squad is created via training captain, or when the captain is pre-placed map start.
it sounds like you're depending on a global variable referencing the captain, but in some situations that global variable won't actually be pointing to what you're expecting (the captain). if you don't want to post your code, you might start by digging deeper on this idea by printing the state of the variable to your screen at different moments in the game, both when it's working and when it's not
 
Status
Not open for further replies.
Top