• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

Custom Gold Mine(Rich Gold Mine)

Status
Not open for further replies.
Level 1
Joined
Oct 30, 2016
Messages
3
Hello friends, so I want to create a custom gold mine, which workers will mine 25 gold per trip from it, while keeping the 10 gold per trip standard mine, similar to Starcraft's rich mineral patches and I need some help.

So I copied the mine into another unit. And I also copied the abilities Havest(Gold and Lumber) and Gold mine ability into new custom ones, changing the custom Harvest to 25 gold per trip. Now my question is how do I make the custom mine and workers harvesting at the custom use the custom harvest and gold mine abilities at 25 gold per trip, while keeping the standard gold mine at 10 gold, as it seems they overlap and they harvest 10 + 25 gold?
 
Level 44
Joined
Feb 27, 2007
Messages
5,572
I think workers break if you remove and re-add their harvesting abilities, but it could be worth trying to remove the +10 one and add the +25 one. If that works you'll have to decide on some logic for when to replace the ability. I would check when a worker gets near a mine and replace the ability then. If they get near a regular mine, remove the new and re-add the old.
it seems they overlap and they harvest 10 + 25 gold?
They successfully harvest 35g from the mine every trip? If that's the case then just change it to 15 bonus gold so 15+10=25.
 
Level 1
Joined
Oct 30, 2016
Messages
3
I think workers break if you remove and re-add their harvesting abilities, but it could be worth trying to remove the +10 one and add the +25 one. If that works you'll have to decide on some logic for when to replace the ability. I would check when a worker gets near a mine and replace the ability then. If they get near a regular mine, remove the new and re-add the old.

They successfully harvest 35g from the mine every trip? If that's the case then just change it to 15 bonus gold so 15+10=25.

Wait how would I check if he is near a "Rich Gold Mine" and a regular one? And they are farming 10 + 25 on both types of mines that's the problem.
 
Level 44
Joined
Feb 27, 2007
Messages
5,572
Daffa's solution sounds way better than triggering it. Rudimentary but something like this would work:
  • Events
    • Time - Elapsed Game-time is 0.50 seconds
    • --------- too many things at map init can crash the map init thread ---------
  • Conditions
  • Actions
    • -------- create 2 ability variables RegHarvest & RichHarvest, replace the xxxxes with the rawcodes for your 2 harvesting abilities --------
    • Custom script: set udg_RegHarvest = 'xxxx'
    • Custom script: set udg_RichHarvest = 'xxxx'
    • Custom script: set bj_wantDestroyGroup = true
    • --------- there might be a "pick all units of type X" action too I don't remember --------
    • Unit Group - Pick every unit in (playable map area) matching (Unit-type of (Matching Unit) equal to Rich Gold Mine)) and do (Actions)
    • Loop - Actions
      • Trigger - Add to OtherTrigger1 <gen> the action (A unit comes within XX range of (Picked Unit))
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (playable map area) matching (Unit-type of (Matching Unit) equal to Gold Mine)) and do (Actions)
    • Loop - Actions
      • Trigger - Add to OtherTrigger2 <gen> the action (A unit comes within XX range of (Picked Unit))
  • -------- other trigger 1 --------
  • Events
  • Conditions
    • ((Triggering Unit) is a worker) equal to true)
  • Actions
    • Set TempU = Triggering Unit
    • If (All conditions are true) then do (then actions) else do (else actions)
      • If - Conditions
        • (Level of RegHarvest) for TempU greater than 1
      • Then - Actions
        • Unit - Remove RegHarvest from TempU
        • Unit - Add RichHarvest to TempU
  • -------- other trigger 2 --------
  • Events
  • Conditions
    • ((Triggering Unit) is a worker) equal to true)
  • Actions
    • Set TempU = Triggering Unit
    • If (All conditions are true) then do (then actions) else do (else actions)
      • If - Conditions
        • (Level of Richarvest) for TempU greater than 1
      • Then - Actions
        • Unit - Remove RichHarvest from TempU
        • Unit - Add RegHarvest to TempU
There are ways to break this trigger but it would probably be pretty good. I would pick a range for the mines that is JUST bigger than the radius at which workers disappear inside it so they only trigger it right before starting to harvest.
 
Status
Not open for further replies.
Top