View Full Version : [Trigger] Upgrade System
Black-Templar
11-10-2007, 10:06 PM
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.
GhostWolf
11-11-2007, 12:37 AM
The problem in your code is that your building isn't SELLING a unit, its TRAINING it so selling won't work for you.
Black-Templar
11-12-2007, 07:01 PM
If thats the problem, why does the upgrade work, but not the rest? Why would action #1 meet the conditions but action #1 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?
GhostWolf
11-12-2007, 09:11 PM
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:
Black-Templar
11-14-2007, 07:16 PM
Wouldn't that give the upgrade to the own of upgrading unit?
Pyritie
11-14-2007, 07:25 PM
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)1
At the start of the map you will need to disable training of Upgrade Weapons 2 (and any higher levels).
GhostWolf
11-14-2007, 07:39 PM
Black-Templar, thats what he wanted, say player 1 is alliance units, player 1 units will get the upgrade... not the heros right ? :wink:
And I think using upgrades is the best, no need to use triggers, isn't this what the are supposed to be for ? :grin:
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.
Search Engine Optimization by
vBSEO 3.5.1 PL2