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

Peasant that don't damage the trees?

Status
Not open for further replies.
Hey, I've been trying to make the peasants not damage the trees when collecting lumber. Kind of like the wisps...

but the wisp's ability involves that it spins around the tree and it is hardcoded.

I tried kinda stupid idea to set the field "damage to tree" to 0, but they hit the tree forever

I created a trigger that aims to check if a peasant is chopping a tree and set its life to 100%, but it doesn't detect the spell Harvest (gold and lumber).
And it doesn't work with other abilities like Havest lumber(Ghoul) or harvest lumber(goblin shredder)

any ideas?
 
Level 3
Joined
Sep 23, 2021
Messages
19
Hey, I've been trying to make the peasants not damage the trees when collecting lumber.

I tried kinda stupid idea to set the field "damage to tree" to 0, but they hit the tree forever

May I ask why is the goal to not damage tree at all?

Normally the unit hit the tree 10 times and do the damage in the corresponding field (1 for peasant/ peon, 2 for ghul, etc...) to trees.
There is also a gather time which is 1 for gold and lumber, so if you reduce that they will gather faster (but gold too).

You can increase/ decrease the tree res. harvested both in the ability and with the upgrades. So for the same damage can harvest more or less tree as you desire. -> this can be a workaround depends on your goal (why not do damage to trees?)

Also note:
The same ability used by orc peons.
So the first step is most likely to add a separate ability for peasants and change only that. If damage is 0.1 that gives 10X lifetime for trees when "mined" by peasants.
Also can edit all the other tree harvesting damages (like for ghuls) and also the life of the tree types (lorderon summer, fall, felwood, etc...) and by then make the ratio change.

But to use it as upgrade?
Not sure you can replace an existing ability...
 
Level 3
Joined
Sep 23, 2021
Messages
19
I looked at the naga slave's harvest ability and 'damage to tree' there is also an integer. there is no "1.2" and "0.1" possible.

You are partly right.
In WE object editor that is true -> just tested.

I did look at:
MPQ/Units/AbilityData.slk -> row 347 and 348 (harvest / harvest naga) col 23 DataA1 (damage to tree).

Not the first time when pure game data in MPQ different from the object editor in WE.
Like footman defend:
in MPQ chance to deflect: 30 (also without touch it OE the same)
but when wish to modify it in object editor then 10 is the max.
At least in 1.26 patch.

So the question is:
In the end the game use it as presented in the object editor, or as it is in the AbilityData.slk?
 
Level 3
Joined
Sep 23, 2021
Messages
19
since I want this to be an upgrade, it has to be normal at first, and very low when upgraded.
That part is clear (what you wish to execute).
What I do not understand: why it is important to preserve trees when gathered by human peasants?

Example: I did give better health for trees in my mod, originally all were 50, became 60 - 100, so they last longer from 20-100% which also means more lumber can gathered from the same ammount of tree doads before the forrest cut down.
So
1. Execution was:
1.1: increase health of trees.

2. Goals was:
2.1: preserve trees longer, by that:
  • keep the gathering distance (units need to move to deliver gathered trees) for a longer time short around starting position
  • keep the tree walls longer around settlement to block attacks
  • increase possible ammount of tree res. what can be gathered
  • decrease the neccesity of relocation/ additional bases because of tree res. needs
2.2: make trees stronger to witstand attacks from artillery (and partly other attacks/ abilities)

Near that there are also a new upgrade which improves the ammount of wood gathered with +5 for humans, so with all upgrades they can deliver 35 instead of 30 (for the same damage to trees by the way). -> for that there is UpgradeMetadata, VS for damage tree there is not.

What are your goals (purpose)?
And reason why affect just humans?

I struggle myself much with abilities, see here: Basic (existing) abilities and spell modding (data fields) in MPQ

The problem is:
  • there are quite limited variety what upgrades can grant directly - stored in UpgradeMetadata.slk (damage to trees not among them)
  • even when you wish to add some of that you cannot WHEN that upgrade grants an ability (only ability added other data neglected)

In your case:
What you wish to change IS an ability, not an upgrade.
Upgrades can grant abilities, but all data called from the ability itself.

Problems:
  • have no clue abilities can be replaced or not with a different one via upgrades (90% chance to not)
  • there is not a single example when an unit ability have levels (opposed with hero abilities)

Possibility:
Triggers can disable abilities on the map level.
Probably can enable a different one (if you create a different ability first based on that) -> but have no clue how to bond it with an upgrade -> better to ask in the trigger section.
 
Status
Not open for further replies.
Top