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!
A system made at the request of the Naga Fans group (Specifically Misha) To act a remake of the Slave Miner from C&C RA2 YR and acts as automatic lumber miner which will seek out the closest trees on the map in proximity to the wagon
Basic system explaination:
1. Slave Wagon is trained
2. Slave Wagon find the closest tree and go towards it and stops nearby
3. Slave Wagon Produces Mur'gul slaves who will mine the targeted tree
4. When the tree is cut the Slave Wagon finds the next closest tree and retargets
5. Slaves Follow Wagon around
6. Overriding Comands for the automation
7. When a Slave dies the Wagon replaces the slave after a given interval
8. When the Slave Wagon dies all the Slaves die too
Information
Speeding up Import (Import order)
Trouble Shooting
Basic Modification Explaination
Examples of more complex modification
WaitTime: Multiply the Value of this setting by 0.09 and that is how many seconds will be between the production of each slave
AmountProducedAtATime: This is how many Slaves will be produced at each interval (WaitTime)
OrderRange: How far away the Wagon must be before it moves closer to the tree it is harvesting
DistanceRange: How close the Wagon will move to the tree it is harvesting (if it's further away than OrderRange)
MurgulDistance: How far away from the Wagon the Mur'gul will move when issued a move command in formation (150 minimum)
SearchRangeGrowth: How fast the search range for trees will grow (divide by 0.09 for how much range per second it grows)
MurgulMax: Number of Mur'gul Slaves
Setup
Events
Time - Elapsed game time is 1.00 seconds
Conditions
Actions
-------- Creates a hashtable --------
Hashtable - Create a hashtable
-------- Sets the variable to the last created hashtable --------
Set WagonHash = (Last created hashtable)
-------- Adds pre-placed Wagons to the group --------
Set SlaveWagons = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Slave Wagon))
-------- Configurables --------
-------- Wait time between production (WaitTime * 0.09 seconds) --------
Set WaitTime = 50
-------- Production at a time --------
Set AmountProducedAtATime = 1
-------- Move Order Issue Range --------
Set OrderRange = 600.00
-------- Move Distance Range --------
Set DistanceRange = 500.00
-------- Mur'gul Distance --------
Set MurgulDistance = 200.00
-------- Search Range Growth Speed --------
Set SearchRangeGrowthSpeed = 30.00
-------- Mur'gul Count --------
Set MurgulMax = 4
Set TempPoint1 = (Point(0.00, 0.00))
Unit - Create 1 Peasant for Neutral Passive at TempPoint1 facing Default building facing degrees
If (((Load 10 of PickedUnit in WagonHash) is dead) Equal to True) then do (Hashtable - Save ((Load 7 of PickedUnit from WagonHash) + SearchRangeGrowthSpeed) as 7 of PickedUnit in WagonHash) else do (Do nothing)
Destructible - Pick every destructible within (Load 7 of PickedUnit from WagonHash) of TempPoint1 and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked destructible) is alive) Equal to True
((Load 10 of PickedUnit in WagonHash) is dead) Equal to True
Then - Actions
Unit - Order TreeChecker to Harvest (Picked destructible)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Current order of TreeChecker) Equal to (Order(harvest))
Then - Actions
Unit - Order TreeChecker to Stop
Unit - Order Unit to Night Elf Huntress - Sentinel (Picked destructible)
Else - Actions
Else - Actions
Destructible - Pick every destructible within DistanceRange of TempPoint1 and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Picked destructible) Equal to (Load 10 of PickedUnit in WagonHash)
Or - Any (Conditions) are true
Conditions
(Current order of Unit) Equal to (Order(move))
Then - Actions
Unit - Order Unit to Stop
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Load 6 of PickedUnit from WagonHash) Greater than or equal to WaitTime
Then - Actions
Hashtable - Save 0 as 6 of PickedUnit in WagonHash
Hashtable - Save AmountProducedAtATime as 9 of PickedUnit in WagonHash
For each (Integer Debug) from 20 to (MurgulMax + 19), do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Load Debug of PickedUnit in WagonHash) is dead) Equal to True
(Load 9 of PickedUnit from WagonHash) Greater than 0
Then - Actions
Hashtable - Save ((Load 9 of PickedUnit from WagonHash) - 1) as 9 of PickedUnit in WagonHash
Unit - Create 1 Mur'gul Slave for (Owner of Unit) at TempPoint1 facing Default building facing degrees
Set Unit = (Last created unit)
Hashtable - Save Handle OfUnit as Debug of PickedUnit in WagonHash
Unit - Order Unit to Harvest (Load 10 of PickedUnit in WagonHash)
-=V1.0=-
- Initial Upload
-=V1.1=-
- Modified Adding unit to unit groups
- Cleared hashtables on death
-=V1.2=-
- Changed PickedUnit into an Integer
- Added Tree Checking using a peasant
- Strung along If statements in Activation
-=V1.3=-
- Changed Config Variable to non-arrayed presets with appropriate names
- TempPoint variable non-arrayed/changed to seperate variables
-=V1.4=-
- Reduced amount of Location Variables and removed redunancies
- Increased Interval Timer to 0.09 (changed to this to maintain accuracy)
- Corrected a line to use WagonHash instead of Last created hashtable
- Corrected a non-working line to null a hashtable value
- Corrected a few errors in the help on the map and in the description
if you find any errors in the script or if it is not functioning as described please contact me via PM so that it can be corrected.
Approved. Neat system, I like it.
-0.03 seconds is too low for this system
-Use less point variables
-Last created hash:Unit - Order (Load Debug of PickedUnit in (Last created hashtable)) to Right-Click (Load 10 of PickedUnit in WagonHash)...
2) When a Wagon dies and you remove it from the Unit Group, clear every hashtable value.
3) In the activation trigger, you might want to use "GetTriggerEventId()", to check which event fired the trigger and by extension save the engine some checks.
4) What's the difference between these two variables?
Set PickedUnit = (Triggering unit)
Set Unit = (Triggering unit)
You have set them one under another.
5) You might want to use "Unit - A unit enters (Playable map area)" as an event, instead of the "Finishes training a unit". This way, reanimated units or resurrected ones will be taken into account.
In the Activation trigger, merge all your if/then's into one long chain, as in put them into the others else sections, so it doesn't have to run the check even it if already comes up as a yes.
The importing instructions do not mention that one must set the ability correctly in the triggers. I recommed you create a variable for the ability, so it only needs to be set in the init trigger.
Picked unit handle variable is pretty useless. Create an integer variable and use this:
Custom script: set udg_variable = GetHandleId(udg_Unit)
The tree type check is unneeded. Just have a hidden peasant ordering harvest and if the order is harvest then stop it and you will know that it's a tree.
In the game, the slaves will be "free" when the mine is destroyed. Maybe make it similiar?
although in RA2YR slaves become tiny melees for the player who killed the unit that sends them to work, but that would be too complicated and .. really not usable..
1
although in RA2YR slaves become tiny melees for the player who killed the unit that sends them to work,
2
but that would be too complicated and .. really not usable..
Well this is certainly interesting. Though would prefer if ability was activated by right clicking.
Though this will stop slaves for being repairmen and construction, but will cut back on pain of purchasing slaves. Guess Naga worker will do repairs and all constructions.
It looks very nice, It does start to lag when you have a lot of them. but that could also be my wooden pc. and how does it react if there is an unreachable tree close by. "say on a unreachable cliff." And there is harvest able trees far away. what will it do? try to reach the unreachable or continue?
in that cercumstance you'd need to use the override to make it stop going for the unreachable, that's one of the reasons for it's existences as it's not really that feasable to make the unit check to see if it can actually get to the tree or not, I /would/ advise anyone using the system to not place inaccessible trees for that reason.
in that cercumstance you'd need to use the override to make it stop going for the unreachable, that's one of the reasons for it's existences as it's not really that feasable to make the unit check to see if it can actually get to the tree or not, I /would/ advise anyone using the system to not place inaccessible trees for that reason.
Yes you can change the theme to any race - that's all object data so long as the names are the same, and it is possible to change it to other worker tasks, but that'd have to be done by you yourself as the system isn't made to support them as standard.
as far as which ones it can do: you can change it to mining/repairing as well as the lumber gathering but not building structures provided you have the know-how to check for toher things, for instance repairing you'd need to find the closest damaged structure, and for gold mining you'd have to find the closest gold mine (although both would be quite simple modifications really, but you'd need good knowledge on GUI if you wanted to do it yourself because you'd have to modify the hashtables to save the target structure/goldmine as well as modify/change the override ability.
Sorry for the necro-post, but just had this pointed out to me by Kam...
Man this looks cool. Most importantly I love when people create ideas in Wc3 that existed in other games; it's that twist of creativity & ingenuity I love.
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.