• 🏆 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!

Just Another Harvesting Template v0.01

This bundle is marked as awaiting update. A staff member has requested changes to it before it can be approved.
The way workers gather from Gold Mines in the base game is quite ugly. Peons and Peasants phase in and out of existence, Wisps disappear into the Gold mine entirely and Acolytes just stand there chanting.

I wanted my workers to gather from Gold Mines just like peasants and peons gather from lumber from trees. I couldn't find a template of a system like this on the Hive, so I decided to make a crappy one in GUI myself. Even though it's quite bad, I guess it gets the job done and could help someone out who is looking to create something similar.


I've removed the creation of constant dummies and recycle them instead.
I no longer use custom values.
I've fixed issues related to gathering resources or orders not interrupting gathering.
The floating text now only shows to the player that owns the worker.

Currently I am not planning to make the system easily customisable for different unit types and gathering speeds.
Contents

Just Another Harvesting Template (Map)

Assets
Reviews
Tank-Commander
The floating text can be seen by all the players Store repeatedly used references (such as picked units) into a temporary variable There should be a configuration to permit different harvesting speeds and harvesting capacities - hard coding data isn't...
streetpunk
Allright, so I'll post here what I posted on the other resource (double created?) Really nice system, it has some issues but you probably can fix it! Here are some things I noticed! 1 - The main thing I noticed is that you use dummy units with...
Level 7
Joined
Jul 21, 2016
Messages
49
I put the important triggers in the description for people to check out. I don't think there's a point to posting an in-game screenshot, as there is nothing really to see. It's just peons chopping away at a gold mine just like peons would chop away at trees.

The biggest problem with the triggers is probably the fact that I create dummies with a generic timer attached to them instead of timers per se to repeatedly add 1 gold to the amount peons are carrying.
This means that for every 1 gold that is gathered a dummy is created.
I just wouldn't know how to make it work with timers in GUI.
 
Last edited by a moderator:
Level 5
Joined
May 2, 2015
Messages
109
[No multiple reply please]

It's just peons chopping away at a gold mine just like peons would chop away at trees.
In-game, zoom in peons then find nice angle > Screenshot > Crop > Use as treat icon > Done. :)

The biggest problem with the triggers is probably the fact that I create dummies with a generic timer attached to them instead of timers per se to repeatedly add 1 gold to the amount peons are carrying.
This means that for every 1 gold that is gathered a dummy is created.
I just wouldn't know how to make it work with timers in GUI.

You can use that method, just clear the leak (remove the dummy from the game when it dies)
But for me, I will just create a new trigger with 0.10 or 0.03 timer interval then do the countdown in it.

Like this (I don't have Wc3 with me right now, so... hope you can understand :D )
Event
Every 0.10 second
Action
if delay[index] greater than 0.00 then
set delay[index] = delay[index] - 0.10
else
add Player(1) gold by 1
---- you can add actions here ---
set delay[index] = harvestDelay[index] <--- reset the delay
endif



About the code, I'll review when we done harvest delay issue. :)
 
The floating text can be seen by all the players
Store repeatedly used references (such as picked units) into a temporary variable
There should be a configuration to permit different harvesting speeds and harvesting capacities - hard coding data isn't generally good
In extension it would be good if the system could support multiple units types which also can each have different mining capabilities (think goblin shredder but for gold)
The system shouldn't rely on custom unit values as mentioned by Daffa - Linked lists, dynamic array or hashtable would be my recommended solution
place update old submissions instead of uploading duplicates (when things need to be moved, contacting a moderator is better than uploading it again)
Also please attach a version number to your submission or map so that we can keep track of what versions we're reviewing - makes the moderation process eaiser
 
Level 11
Joined
Oct 9, 2015
Messages
721
Allright, so I'll post here what I posted on the other resource (double created?)

Really nice system, it has some issues but you probably can fix it!

Here are some things I noticed!

1 - The main thing I noticed is that you use dummy units with expiration timer to simulate countdown timers. I used to do it that way too, now I use countdown timers, which I recommend you do to improve performance of your map as of every dummy unit you create (doesn't matter if it dies or is removed) some memory is permanently leaked, you can use a dummy recycler too but I think countdown timers is more recommended.

2 - Another issue is that if I order the unit to harvest from the source it will immeadtly recieve the "Harvesting" buff and also starts the animation, this will happen even if I order the unit with something else in the process (like stop for example), they will begin to mine on the air, not to mention the gold source will be damaged in the process.

3 - If a unit is mining and is ordered to stop or hold position, it won't stop it's animation or the whole mining process.

4 - The value of gold returned vary if the unit is ordered to do something else in the process (sometimes I get 47 gold from a single peon, others I got 135).

5 - You should use a unit indexer to make unit's custom value unique.

I hope you see this as a constructive critic to help improve this project
 
Top