View Full Version : Upgrade that switches weapon of a unit?
Kabel
01-18-2012, 11:10 PM
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
01-19-2012, 03:49 PM
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.
Kabel
01-19-2012, 04:29 PM
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?
Dr Super Good
01-19-2012, 05:25 PM
By following my instructions. You get the upgrade to hide and disable the old weapon and to also reveal and enable the new weapon. New weapon defaults to hidden and disabled. Old weapon defaults to revealed and enabled.
Kabel
01-19-2012, 06:24 PM
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.
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.
Search Engine Optimization by
vBSEO 3.5.1 PL2