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

Increase lumber gather speed?

Status
Not open for further replies.
Level 12
Joined
Dec 2, 2016
Messages
733
Probably an easy change, but can't seem to find out how. I'm currently using an upgrade that increases lumber capacity for workers. And they use an ability that lets them harvest trees for lumber. But can't seem to figure out how to increase their gather speed (and if possible from an upgrade)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Check it does not couple to attack speed.

One could use a resource event system to detect the lumber income. After the upgrade is complete one could give some bonus lumber for each income of lumber from the worker. One can filter for amounts equal to the lumber carried to base to rule out bundles of wood another other sources of lumber.
 
Seems like harvest hit rate is somehow:
combat - attack 1: damage point + backswing (ignoring attackspeed) (ghul ignored changes to attack 2, which can hit trees wierd)
cooldown between each hit is equal to the value field "duration normal" inside the obtained harvest-ability.

Harvest supports multiple levels therefore you could increase the level of the harvest-ability your works have after researching that research.
 
Level 11
Joined
Nov 23, 2013
Messages
665
Peasants have 2 attacks, the second one only targets trees. I never tried it, but I guess you can increase the damage done to trees and/or attack speed of attack 2.

Edit: Oops, Tasyen got there first ;)

Tasyen said:
cooldown between each hit is equal to the value field "duration normal" inside the obtained harvest-ability.
You sure? In my WE, normal duration default value for the lumber harvest ability is set to 0.

Edit 2: Nevermind, I was looking at the wrong ability!
 
Last edited:
Level 12
Joined
Dec 2, 2016
Messages
733
So I was gonna increase the ability level so lvl 2 does more damage to the tree. But there is only one field that is techtree requirements. I don't know how to add an upgrade to that list for the 2nd level of dmg to the tree.
 
Level 10
Joined
Apr 4, 2010
Messages
286
So I was gonna increase the ability level so lvl 2 does more damage to the tree. But there is only one field that is techtree requirements. I don't know how to add an upgrade to that list for the 2nd level of dmg to the tree.

I don't know if there's a better way, but you can always do it with triggers.

  • Events
    • Unit finishes research
  • Conditions
    • Tech-type of researched tech equal to Wood Upgrade
    • Current level of Wood Upgrade for (Owner of researching unit) = X
  • Actions
    • Pick all units owned by (Owner of researching unit) of type Peon and do Actions:
      • Set level of (Wood ability) for Picked unit to Y
Won't look like this exactly but you get the idea
 
Level 13
Joined
May 10, 2009
Messages
868
There's also Chaos ability, which would make things easier for you. No need to worry about triggers at all:

- Create a new worker based on the existing one;
- Create a better Harvest ability, and give it to the new worker;
- Now make an ability based on Chaos, and change its Unit Type field to the new worker;
- Change its "Techtree - Requirement" to your "Wood Upgrade".
- Give Chaos ability to the old worker.


As soon as a player researches "Wood Upgrade", chaos will be able to turn your old workers into the new ones. Well, I can't say this is the best choice, but I don't think anything bad could happen with common units such as workers; It's up to you.
 
Level 12
Joined
Dec 2, 2016
Messages
733
So I have this

  • Hatchets finished
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
      • (Researched tech-type) Equal to Sharpened Hatchets
    • Actions
      • Set HatchetsResearch[(Player number of (Owner of (Triggering unit)))] = True
and

  • Worker spawn
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HatchetsResearch[(Player number of (Owner of (Triggering unit)))] Equal to True
          • (Unit-type of (Triggering unit)) Equal to Worker
        • Then - Actions
          • Unit - Increase level of Worker Harvest (Gold and Lumber) for (Triggering unit)
        • Else - Actions
This is the ability I'm changing.
Gyazo - 53bb1540186bef4ebf22b8beecd5ce01.png
before you ask I created the worker after the final research is researched.
But even after the final upgrade worker harvests the same amount of wood at the same rate.

Edit: realized it was a research not an upgrade. So that's working, but the workers still do the same damage to the tree even though the damage is set to 2 dmg per hit for the abilities second lvl.
 
Last edited:
Level 13
Joined
May 10, 2009
Messages
868
I bet that's because you are creating a bunch of workers, ordering them to gather resources, and then researching that upgrade. Currently, your trigger takes into account only future workers, the existent ones will still have their ability as level 1. In order to fix that problem, you need an Unit Group function which enumerates through all existing workers and improve their ability.
 
Level 12
Joined
Dec 2, 2016
Messages
733
I bet that's because you are creating a bunch of workers, ordering them to gather resources, and then researching that upgrade. That trigger counts only for future workers, the existent ones will still have their ability as level 1. In order to fix that problem, you need an Unit Group function which enumerates through all existing workers and improve their ability.

"before you ask I created the worker after the final research is researched."
 
Level 10
Joined
Apr 4, 2010
Messages
286
So I have this

  • Hatchets finished
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
      • (Researched tech-type) Equal to Sharpened Hatchets
    • Actions
      • Set HatchetsResearch[(Player number of (Owner of (Triggering unit)))] = True
and

  • Worker spawn
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HatchetsResearch[(Player number of (Owner of (Triggering unit)))] Equal to True
          • (Unit-type of (Triggering unit)) Equal to Worker
        • Then - Actions
          • Unit - Increase level of Worker Harvest (Gold and Lumber) for (Triggering unit)
        • Else - Actions
This is the ability I'm changing.
Gyazo - 53bb1540186bef4ebf22b8beecd5ce01.png
before you ask I created the worker after the final research is researched.
But even after the final upgrade worker harvests the same amount of wood at the same rate.

Edit: realized it was a research not an upgrade. So that's working, but the workers still do the same damage to the tree even though the damage is set to 2 dmg per hit for the abilities second lvl.

Are these the only two triggers?

Looks like this is only affecting workers trained after the research, not any that were around before. You probably want a "pick all and do actions" somewhere for when the research is done.

Separately, I've heard horror stories about "A unit enters (Entire map)" especially if it will trigger more than once. There's probably a better way to do that - "A unit finishes training a unit" maybe?

Edit: Nevermind, I missed the whole second page of the thread. Ignore me
 
Level 18
Joined
Nov 21, 2012
Messages
835
First: you cannot use multilevel ability based on harvest 'Ahar'. You have to create 2nd ability with increased "damage to the tree" as faster harvesting ability.
My suggestion is: grab GUI Unit Event v2.4.0.0
Then use 2 triggers, second one is Initialy OFF. Don't use 'Unit enters map area' event. Use Bribe event instead.
  • work
    • Events
      • Unit - A unit Finishes research
    • Conditions
      • (Researched tech-type) Equal to Improved Lumber Harvesting
    • Actions
      • Trigger - Turn on workerEnters <gen>
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Peasant
            • Then - Actions
              • Unit - Remove Harvest (Gold and Lumber) from (Picked unit)
              • Unit - Add Harvest 2 (Gold and Lumber) to (Picked unit)
              • Animation - Remove the lumber animation tag to (Picked unit)
            • Else - Actions
  • workerEnters
    • Events
      • Game - UnitIndexEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of UDexUnits[UDex]) Equal to Peasant
    • Actions
      • Unit - Remove Harvest (Gold and Lumber) from UDexUnits[UDex]
      • Unit - Add Harvest 2 (Gold and Lumber) to UDexUnits[UDex]
 
Status
Not open for further replies.
Top