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

Harvesting Gold in the same manner as Lumber

Status
Not open for further replies.
Level 15
Joined
Apr 6, 2004
Messages
230
Hey there,

I'm working on a map idea set beneath the earth, where you have to harvest Stone (a replacement for lumber) and Ore (a gold replacement). I can easily change lumber to stone, that is no issue at all as it's little more than a few model and text changes, but it is gold that I'm having some issues with. I want to have the Ore scattered in among the stone, making Ore a rarer resource to uncover. However, Harvesting gold means that the unit (if based on Peasants or Peons) enters into the Ore rather than hacking away at it with a pick like they do with Stone (Lumber).

Is there a method of getting it so both gold and lumber are harvested in the same way while remaining two separate resources?

Note: I've done a search for this but I struggled to find a complete answer.
 
Level 8
Joined
Jan 28, 2016
Messages
486
I think I may have stumbled upon a solution. It's a little bit crazy but it just might work. I haven't tested this in any great detail and it doesn't completely solve your problem at the moment but I might be able to make something out of it soon. I'll probably update this post after some more tests.

X

Pillage

Dummy Gold Mine

Worker Unit

Result

Create a custom Pillage ability to add to your Worker unit. If you're not going to use ladder Pillage in your map, you can just modify it instead and save some space on your map's Object Data. In the data fields of the ability, set both Accumulation Step and Salvage Cost Ratio to 1; also set Techtree - Check Dependencies to false. I don't fully understand the Accumulation Step either but it took a lot of trial and error for this whole thing to work for me so just go with it for now. This along with the changes that are going to be made to your Dummy Gold Mine unit will make it so that whenever your worker attacks, it will grant you 1 gold per attack.
What you need is a dummy unit to act as the resource. I based mine off of the Human Scout Tower because it can't attack by default and then set its gold and lumber costs to 100 and 0 respectively, gave it 0 unarmoured-type armour and set Hide Minimap Display to true. Make sure that you base the dummy unit off a building; otherwise set its base movement speed to zero. When placed in the map, set the owner of the dummy to the Neutral Passive player so that units won't attack it automatically when it's in range.
This is a bit tricky because Peasants and Peons use their second attacks to target trees so if you want or need to keep the Worker's first attack, this won't work. I might be able to find a solution to this later though. In the meantime you can try this out; set the Worker's second attack (or first if it's unused) damage to 5 by setting the Damage Base to 4 and both the Damage Number of Dice and Damage Sides per Die to 1. For testing purposes, edit the first attack's Targets Allowed to not include structures and instead make the second attack only target structures. As for attack type, I used Chaos in my test as it deals 100% to all armour types (even though I had the dummy with Unarmoured, which does the same thing).
Now whenever your Worker attacks a Dummy Gold Mine (or any structure technically), it will "harvest" 1 gold per attack. Obviously there needs to be some further trial and error to be done, and some checks to make it only work on Dummy Gold Mines as opposed to any building, but I reckon I can work something out.
 
Last edited:
Level 9
Joined
Jul 3, 2008
Messages
495
Im not sure if there exists such an event or system to detect (Years since I played with the editor).
But my thoughts goes like this:

1: When an unit enter the goldmine (Ore), create a dummy unit outside the mine, and play the "work lumber" animation.
2: When the unit leave the mine then remove the dummy unit.

I think it will be a tricky system to create, and it might need a lot of calibration to look nice and flawless.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
I would take it from a different approach.
Use a resource system that works separately from the WC3 resource system.
Then you can make 2 resources (stone and ore) and convert them to gold and lumber.
(This will probably be set up by workers attacking certain destructables, but it depends on which system you use.)
There should be one in the spell section.
 
Level 8
Joined
Jan 28, 2016
Messages
486
Lumber isnt gathered on the spot, its hauled back to nearest drop-off structure.

Touché. I tried to make an alternative based on actually harvesting trees and I was quite successful in creating the basis of the harvesting mechanic but didn't get around to including drop-off or resource tracking systems. Nevertheless if anyone is interested, try my map.

I would take it from a different approach.
Use a resource system that works separately from the WC3 resource system.
Then you can make 2 resources (stone and ore) and convert them to gold and lumber.
(This will probably be set up by workers attacking certain destructables, but it depends on which system you use.)
There should be one in the spell section.

This would probably be a better idea though. There's rulerofiron99's Custom Resource Harvesting System that should do what you're after. With some adjustments of course.

P.S.: Is this considered a necro? :eek:
 

Attachments

  • Dummy Gold Mine.w3x
    15.5 KB · Views: 53
Level 8
Joined
Jan 28, 2016
Messages
486
Cool, thanks Wietlol.

By the way, I tried to find some other resource systems that you could try PaulH but all I could find was system I posted above. It should be more than good enough to pull off what you're after.
 
Status
Not open for further replies.
Top