HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Removing a sold unit

01-16-2006, 05:48 AM#1
AnarkiNet
I can't seem to find the proper trigger action to completely remove a sold unit, not the unit itself, but the icon on the "selling unit".

What I'm trying to do is have each tower in my TD able to individually purchase up to 6 item slots, one at a time. The entire process works flawlessly, except I cant get rid of the sold unit icon on the tower's command card. I've tried the Neutral Buidling - Remove Unit-Type from Marketplace, as well as Unit - Remove (Sell Units), and neither seems to work.

The other option would be to use an ability and then remove the ability, but that won't show the little number which shows how many are left to purchase like the sold-unit method.
01-16-2006, 05:57 AM#2
SmileyJeff
You must add the unit in to your shop by triggers. After that "Neutral Building - Remove Footman from (Triggering unit)" will work. I forgot about the gameplay constants, i remember someone said something about that. But the triggers will do.
01-16-2006, 06:07 AM#3
AnarkiNet
Hmm, that doesn't seem to be working. Here's the trigger:
Trigger:
Unit Buying
Collapse Events
Unit - A unit Sells a unit
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Unit-type of (Sold unit)) Equal to Add Inventory Slot
Collapse Then - Actions
Unit - Remove (Sold unit) from the game
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Level of Unit Inventory (Human) for (Selling unit)) Greater than or equal to 6
Collapse Then - Actions
Neutral Building - Remove Add Inventory Slot from (Selling unit)
Game - Display to (All players) the text: Removed "Add Invent...
Skip remaining actions
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Level of Unit Inventory (Human) for (Selling unit)) Equal to 0
Collapse Then - Actions
Unit - Add Unit Inventory (Human) to (Selling unit)
Collapse Else - Actions
Unit - Increase level of Unit Inventory (Human) for (Selling unit)
Collapse Else - Actions
Unit - Order (Sold unit) to Night Elf Ancients - Uproot
Unit - Move (Sold unit) instantly to PlayerBases[(Player number of (Owner of (Sold unit)))]
Neutral Building - Add Add Inventory Slot to (Sold unit) with 6 in stock and a max stock of 6

Edit: You can find the development version of the map in the Subversion repository located here: http://svn.game-advance.net/wc3/Development/
The currently-being-developed version is 13.
01-16-2006, 07:23 AM#4
Panto
Like SmileyJeff said, the "remove" actions only work if the thing that you're removing was also "add"ed with a similar action. If it's part of the object data, it can't be removed this way.
01-16-2006, 08:00 AM#5
Extrarius
It seems like it'd be better to use the "Charge Gold and Lumber" ability anyways, since that's effectively what you're trying to recreate.
01-16-2006, 01:20 PM#6
Blade.dk
Also, the units needs to have the sell units ability to enable adding and removal of units it can sell.
01-16-2006, 03:00 PM#7
qwertyui
^ What he said.
Make sure your towers have "sell units" ability.
If they don't the trigger actions won't apply to them :)

P.S: Oh, another entry for quirks thread ^^