• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to squad 101

Status
Not open for further replies.
Level 13
Joined
Jul 2, 2015
Messages
872
Trying to get a squad system I've been using to work. I thought I setup all the ability/unit ID's correctly, but it still refuses to work.

Some pointers would be much appreciated!
 

Cokemonkey11

Code Reviewer
Level 29
Joined
May 9, 2006
Messages
3,516
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 13
Joined
Jul 2, 2015
Messages
872
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
 
Level 13
Joined
Jul 2, 2015
Messages
872
After pasting all of the code here for like 30min I then realized I just imported it wrong into the map and now I feel like committing the die.

Thanks for the help guys! Sorry for wastin'yer time.
 
Status
Not open for further replies.
Top