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!
First, A way to know how many units are in each detachments, perhaps like an item the leader has that goes up when you recruit units or goes down when soldiers in the detachments die.
Second, to add a secondary selection circle to all the soldiers when you select the leader of the detachment.
The creator of this system has been long since gone, I've tried reaching out to them.
I'm not too familiar with this type of Jass code using Structs and other systems, but it looks like you can create a new method under the Leader Struct which loops over the units of the Leader's squad:
vJASS:
method DoSomethingToTheSoldiers takes nothing returns nothing
local Soldier soldier = .first //Starting for first soldier in the list
loop
exitwhen soldier == 0 //When hitting the end of the list, the loop finishes
// Put code here for interacting with the soldier
// Put code here for interacting with the soldier
// Put code here for interacting with the soldier
set soldier = soldier.next
endloop
endmethod
Look at the method iterate1 for an example of this in action.
This appears to be the variable to get how many units are in a leader's squad:
vJASS:
integer memberCount = 0
Here's an example of displaying this number to Player 1 in a text message, I didn't test it but I think this works:
For your Item idea, you can probably find a method that runs when a unit is added to a Leader's squad, and adjust the Item's charges then. Keep an eye out for the memberCount variable since you know wherever it's getting increased/decreased would probably be a good place to adjust the Item Charges.
The Special Effects for the selection circles could be created in the above loop as well, although you'll need to store them somehow so that you can Destroy them later on, like when the units become unselected or die. There is a method called death which I imagine is where you would want to get rid of them if they die.
So I would read through the code and try to find the important methods for when a unit gets added/removed from a squad, those would most likely be where you want to inject your new code for the Item Charges and Special Effects.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.