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

[Trigger] Upgrade System

Status
Not open for further replies.
Level 4
Joined
Aug 20, 2004
Messages
65
I'm trying to make an upgrade system for my map (think rival nations). I use a building that sells dummy units to heroes trying to upgrade their sides spawns. Here's what I have so far:

Upgrade Weapon
Events
Unit - A unit Sells a unit
Conditions
(Unit-type of (Sold unit)) Equal to Upgrade Weapons 1
(Owner of (Selling unit)) Equal to Player 1 (Red)
Actions
Player - Set the current research level of Iron Forged Swords to 1 for Player 1 (Red)
Neutral Building - Remove Upgrade Weapons 1 from Village Forge 0106 <gen>
Neutral Building - Add Upgrade Weapons 2 to Village Forge 0106 <gen> with 0 in stock and a max stock of 1

Except it doesn't work: the upgrade is researched alright, but the Village forge gets neither the upgrade 1 unit removed or the upgrade 2 unit added.
 
Level 4
Joined
Aug 20, 2004
Messages
65
If thats the problem, why does the upgrade work, but not the rest? Why would action #1 meet the conditions but action #1&#3 fail to work?

Also, I was a little unclear on who's who. Player 1(red) is a computor ally of players 2, 3, 4, and 5, who has a building that sells units like a mercenary camp. The map is an AoS map, so players 2 ---> 5 buy the upgrade dummy unit from the player 1(red) shop that has the "Sell" ability, like an arcane vault; allies can shop but enemies can't. So the building is "selling" a unit, not "training" one, right?
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Ok, I didn't really get what is the problem with your code BUT, you could always use the perfect thing for this (maybe it escaped your mind ? :p) and use upgrades instead of abilities.
This requires no dummy units, no triggers, nothing actually besides creating the upgrades levels and adding them to the building's Techtree - Reaserches Available :xxd:
 
  • Upgrade Weapon
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Sold unit)) Equal to Upgrade Weapons 1
      • (Owner of (Selling unit)) Equal to Neutral Passive (this is whoever owns the Forge)
    • Actions
      • Player - Set the current research level of Iron Forged Swords to 1 for (Owner of Buying Unit)
      • Player - Disable training of Upgrade Weapons 1 for (Owner of Selling Unit)
      • Player - Enable training of Upgrade Weapons 2 for (owner of selling unit)

At the start of the map you will need to disable training of Upgrade Weapons 2 (and any higher levels).
 
Status
Not open for further replies.
Top