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

[General] Making power-build require a research first

I have got this idea of making humans first requiring to research a tech upgrade for Peasants to enable their power-building.
So went and changed the human repair ability to have two levels, with the intention being the base ability would allow only a single worker to work on the site and the upgrade would level the ability up to enable multiple builders.

The issue is that when the power-build related fields of the human repair ability get changed the construction stops working alltogether as it seems to depend on those being greather than 0 in order to function.
Hereby would like to ask for if there are any potential workarounds for this issue, maybe something like issuing the base peasant the orc repair ability and then morphing the unit into a copy with human repair when the upgrade gets researched could function ?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,546
Add both the Human and Orc Repair abilities to the Peasant and then using triggers Disable the Human variant for each Player. Upon researching the upgrade, Enable the Human variant and Disable the Orc variant for that Player:
  • Player - Disable X ability for (Triggering player)
If this somehow fails, you can rely on triggers to Add the Human ability/Remove the Orc ability rather than relying on Disabling/Enabling.

A unit enters map -> Unit-type equal to Peasant and Research X is upgraded -> Remove Repair (Orc) and Add Repair (Human)

A unit finishes research -> Research equal to X -> Pick every unit owned by player of type Peasant and Remove Repair (Orc) and Add Repair (Human)
 
Top