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

Upgrade that switches weapon of a unit?

Status
Not open for further replies.
Level 10
Joined
Nov 5, 2008
Messages
536
I have created an upgrade that is supposed to change the weapon of a unit. I have created two different weapons; one which the unit uses from the start and a new one that REPLACES the old weapon once upgraded.

I have read tutorials, created behaviours and lots of stuff, but I can´t get this to work. T_T

Can some helpful person write a fairly detailed description of how this can be done?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
You give the unit both weapons. The weapon which needs the upgrade is set to be hidden (a flag in the Options field for the weapon entry) while the other weapon is not hidden. The upgrade then changes the hidden flags of the weapons setting the new weapon hidden flag to disabled while the old weapon hidden flag to enabled. Repeat with the "Disabled" option flag which controls if the weapon is active. The upgrade will now hide and disable the old weapon and then enable and reveal the new weapon. Remember to add the unit to the Affected Unit Array so the upgrade gets applied properly.

Alternativly you could use a buff class behaviour which is hidden and requires the upgrade (requirement) that disables one weapon and enables the other.

The Missle Turret from the WoL campaign demonstrates this to some extent with it enabling hellstorm missles.
 
Level 10
Joined
Nov 5, 2008
Messages
536
You give the unit both weapons. The weapon which needs the upgrade is set to be hidden (a flag in the Options field for the weapon entry) while the other weapon is not hidden. The upgrade then changes the hidden flags of the weapons setting the new weapon hidden flag to disabled while the old weapon hidden flag to enabled. Repeat with the "Disabled" option flag which controls if the weapon is active. The upgrade will now hide and disable the old weapon and then enable and reveal the new weapon. Remember to add the unit to the Affected Unit Array so the upgrade gets applied properly.

Alternativly you could use a buff class behaviour which is hidden and requires the upgrade (requirement) that disables one weapon and enables the other.

The Missle Turret from the WoL campaign demonstrates this to some extent with it enabling hellstorm missles.

Thanks. I will try the first way you describe. But how do I get the upgrade to change weapon?
 
Last edited:
Level 10
Joined
Nov 5, 2008
Messages
536
Thanks. It works now! I created my upgrade and choosed "weapon" in the drop down menu in upgrade effects +. I added four effects. Two of them to disable "hidden" and "disable" of the new weapon. Two of them to disable and hide the old one.
 
Status
Not open for further replies.
Top