• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Custom Gold Mining 2025 like in AOE 2

Level 13
Joined
Sep 11, 2013
Messages
467
Greetings!
This is an old post, but I need to do the exact same thing in my map in 2025 and I don't know how..

I have a Problem and i wonder if there is a solution in the World Editor.

I really liked this Model
http://www.hiveworkshop.com/forums/models-530/goldore-90703/?prev=search=gold%20ore&d=list&r=20

And so i decided to make an Advanced Goldmining for my Map. - Like in Age of Empire 2 or Empire Earth I -

I want that workers to be able to harvest this gold ore like trees. ( not with the normal gold mine ability because i dont want the workers to run in the ore and i want the workers to Hit against the ore several times(10) before going back to the Mainbuilding.)

So, when i placed a doodad with this model and made it a tree i have the problem that it gives me wood.

Is there a way to give me Gold instead?

Other Problem i have is that the worker is carrying Lumeber back from the Goldore and i want him to Carry Gold....(I searched something like changing the Model animation from wood to gold but i wasnt succesfull.)

The help will be appreaciated!:peasant-work-work::peasant-sad::peasant-bowing:

- - - - - >>>

EDIT: Thank you everyone for your help, but i abandoned the idea, it's way too hard and too many bugs appear.
 
Last edited:
Level 30
Joined
Aug 29, 2012
Messages
1,383
The problem with changing the harvesting system is that it's very rigid and doesn't give many tools to work with, you'll need to get into super advanced stuff because even something like detecting when a worker deposits gold/lumber in a town hall requires a lot of workarounds

The easiest way that comes to my mind is turning the gold pile into an unit, that way you can detect when it's hit by a worker very easily. You'd only need to trigger the back-and-forth movement after they've collected X stacks, which is a bit of a pain but still more approachable than with the tree variant IMO
 
Level 12
Joined
Nov 13, 2010
Messages
277
this is just an idea i came up with but iam not a 100 % on it and some of it may be wrong but is something like this you need to make !

first Create a custom destructible based on a tree
Stats - Is a Tree to True
Stats - Hit Pointes to 10
Stats - Gold Capacity 0
Art - Model File make the tree on to a gold ore

make use the worker has the Harvest (Gold and Lumber)
and then Change the Stats- gold capacity how much gold is carried per trip

then first trigger
  • Event:
    • - Unit - A unit is issued an order targeting an object
  • Condition:
    • - (Issued order) Equal to (Order(harvest))
    • - (Destructible-type of (Target destructible of issued order)) Equal to Gold Ore
  • Action:
    • - Set WorkerHitCounter[(Triggering unit)] = 0
    • - Order (Triggering unit) to "attack" (Target destructible of issued order)
then we need to retrun him

  • Event:
    • - Unit - A unit attacks
  • Condition:
    • - (Destructible-type of (Attacked destructible)) Equal to Gold Ore
    • - (Unit-type of (Attacking unit)) Equal to Peasant
  • Action:
    • - Set WorkerHitCounter[(Attacking unit)] = WorkerHitCounter[(Attacking unit)] + 1
    • - If (WorkerHitCounter[(Attacking unit)] Equal to 10)
      • Then
        • Unit - Order (Attacking unit) to move to (Position of townhall)
        • Set WorkerHitCounter[(Attacking unit)] = 0
and then we need to get some gold and return him to work

  • Event:
    • - Unit - A unit enters (Region containing town hall)
  • Condition:
    • - (Unit-type of (Triggering unit)) Equal to Peasant
    • - Order (Triggering unit) to "harvest" (Gold Ore)
and if you like we can respawn the gold ore

  • Event:
    • - Destructible - A destructible dies
  • Condition:
    • - (Destructible-type of (Dying destructible)) Equal to Gold Ore
  • Action:
    • - Wait 10.00 seconds
    • - Destructible - Create a Gold Ore at (Position of (Dying destructible)) with max life
    • - Set GoldOreHits[(Custom value of (Last created destructible))] = 0
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,873
this is just an idea i came up with but iam not a 100 % on it and some of it may be wrong but is something like this you need to make !
You cannot detect when a Destructible takes damage since it's not a Unit -> Unit - A unit Takes damage.

But if you replace the Destructible with a Unit then it'll work (for the most part).

I've created stuff similar to this for people in the past:
I can't promise that any of it works without issues.

Then you have existing systems which may work:
 
Level 12
Joined
Nov 13, 2010
Messages
277
when i think this will work instead
  • Event:
    • - Unit - A unit attacks
  • Condition:
    • - (Destructible-type of (Attacked destructible)) Equal to Gold Ore
    • - (Unit-type of (Attacking unit)) Equal to Peasant
  • Action:
    • - Set WorkerHitCounter[(Attacking unit)] = WorkerHitCounter[(Attacking unit)] + 1
    • - If (WorkerHitCounter[(Attacking unit)] Equal to 10)
      • Then
        • Unit - Order (Attacking unit) to move to (Position of townhall)
        • Set WorkerHitCounter[(Attacking unit)] = 0
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,873
when i think this will work instead
  • Event:
    • - Unit - A unit attacks
  • Condition:
    • - (Destructible-type of (Attacked destructible)) Equal to Gold Ore
    • - (Unit-type of (Attacking unit)) Equal to Peasant
  • Action:
    • - Set WorkerHitCounter[(Attacking unit)] = WorkerHitCounter[(Attacking unit)] + 1
    • - If (WorkerHitCounter[(Attacking unit)] Equal to 10)
      • Then
        • Unit - Order (Attacking unit) to move to (Position of townhall)
        • Set WorkerHitCounter[(Attacking unit)] = 0
Unfortunately that Event occurs at the beginning phase of an Attack, before the Unit has even begun to play it's Attack animation. This is bad for many reasons and can be easily abused by spamming Orders -> Stop, Attack, Stop, Attack, etc... And again, it's referring to UNITS not Destructibles.
 
Top