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

Upgrading a unit to another unit in Melee maps.

Status
Not open for further replies.
Level 3
Joined
Sep 29, 2012
Messages
18
So, basically, this is the problem:

You know how in Melee maps, in the human race, you get to upgrade the Siege Engine to Siege Engine(Barrage) which changes its model slightly, etc, basically the upgrade turns all purchased Siege Engines into Siege Engine(Barrages) and no longer allows you to purchase Siege Engine, but allows you to purchase Siege Engine(Barrage), instead. Right?

Now, I'm trying to do practically the same with the Rifleman, who I want to turn into a Sniper(custom unit).

What I did was make a copy of the Siege Engine(Barrage) upgrade, tweaked it so that it turns the Rifleman to the Sniper, removed the Long Rifles upgrade from the Barracks and replaced it with my upgrade(let's call it Sniper Upgrade), made the Rifleman "use" the upgrade in the Editor, made it so that the Riflemen are replaced with Snipers, and that the Barracks spawns Snipers instead of Riflemen after the upgrade, etc.

Now, the problem is, when I open the Barracks, I'm already able to purchase both the Rifleman and the Sniper without purchasing the upgrade, and when I do purchase the upgrade, the Rifleman isn't turned into a Sniper(he should be, as said), and I can still purchase both units, so all in all it's a total mess.

Anybody have any idea how to fix this? I'm getting desperate. Thanks in advance!
 
GUI :

  • Upgrade
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
      • (Researched tech-type) Equal to YourUpgrade
    • Actions
      • Set Temp_Group = (Units owned by (Owner of (Triggering unit)) of type YourUnit)
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Replace (Picked unit) with a YourUpgradedUnit using The old unit's relative life and mana
In Addition use Berseker Upgrade, this Trigger is to pick all unit that is already available since the Upgrade don't replace already made unit with new unit type from the Upgrade.
 
Level 10
Joined
Mar 17, 2012
Messages
579
GUI :

  • Upgrade
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
      • (Researched tech-type) Equal to YourUpgrade
    • Actions
      • Set Temp_Group = (Units owned by (Owner of (Triggering unit)) of type YourUnit)
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Replace (Picked unit) with a YourUpgradedUnit using The old unit's relative life and mana
In Addition use Berseker Upgrade, this Trigger is to pick all unit that is already available since the Upgrade don't replace already made unit with new unit type from the Upgrade.

I don't think that he needs triggers for such a simple problem ;) He needs some experiments...
 
I don't think that he needs triggers for such a simple problem ;) He needs some experiments...

Well he need the trigger to upgrade all the normal unit, I think it's Warcraft bug since I made map with using unit upgraded like his and ALL unit that is already available which will be upgraded didn't upgrade after the upgrade finished researching.
 
Last edited:
Level 3
Joined
Mar 19, 2010
Messages
35
Trigger not necessary.

Give an customized 'Berserker-Upgrade' ability to the unit that will get upgraded so already existing of that type will change in the field when tech is researched.
Also put 'Dependancy-Equivelant' as unit to be upgraded to at old unit.
Be sure that only the old unit actually uses the upgrade.
Open Scenario->Tech-Tree->Tick the use custom blahblah box. Find your new unit and untick its box so its not available from begin before researching the upgrade.
 
Status
Not open for further replies.
Top