HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

how to remove an unit from an tarvern

11-16-2006, 05:05 AM#1
Av3n
Well im just confused about how to remove units from an tarvern when it is bought? Any ideas? This ithe trigger i use right now

Trigger:
Remove
Collapse Events
Unit - A unit enters Teleportation <gen>
Collapse Conditions
((Triggering unit) is A Hero) Equal to True
Collapse Actions
Neutral Building - Remove (Unit-type of (Triggering unit)) from Dalaran Tarven 0000 <gen>
Neutral Building - Remove (Unit-type of (Triggering unit)) from Nexus 0054 <gen>

If it is not, I'll +rep anyone who could.

-Av3n
11-16-2006, 04:04 PM#2
Matarael
Pick (every player) and do:
Make (triggering unit) unavailable for (picked player)
11-16-2006, 04:50 PM#3
The_AwaKening
Units can only be removed from a shop by trigger if they were initially added to the shop via trigger. You'll have to put all the heros in your shop in your map initialization trigger, then they can be removed.
11-16-2006, 04:52 PM#4
moyack
The solution could be like this:
Trigger:
Collapse Events
Unit - A unit Sells a unit
Collapse Conditions
((Sold unit) is A Hero) Equal to True
Collapse Actions
Collapse Player Group - Pick every player in (All players) and do (Actions)
Collapse Loop - Actions
Player - Make (Unit-type of (Sold unit)) Unavailable for training/construction by (Picked player)
Game - Display to (All players) the text: (A player has chosen + (Name of (Sold unit)))
Selection - Select (Sold unit) for (Owner of (Sold unit))

I've taken this trigger from this tutorial

EDIT: Yess!! The_AwaKening is right, you have to take this in account.
11-16-2006, 11:03 PM#5
[VDM]Amn
can't u just set how much units of that type are sold by the tavern?
11-17-2006, 02:51 AM#6
Av3n
well does the tutorial way works?

-Av3n

+rep for moyack(This is going to take awhile can't give rep to you yet) and The Awaking, I'll take these things into account.
Okay I'm thinking that The Awakening way is the best and do I just to do same trigger if I was to remove them?
11-17-2006, 04:14 PM#7
The_AwaKening
The same trigger you used should work just fine as long as they were added to the shop by trigger. You might want to consider chaning the event to sold unit and match that in your actions, but this depends on how you want it to work.
Trigger:
Collapse Events
Unit - A unit Sells a unit
Collapse Conditions
((Sold unit) is A Hero) Equal to True
Collapse Actions
Neutral Building - Remove (Unit-type of (Sold unit)) from Dalaran Tarven 0000 <gen>
Neutral Building - Remove (Unit-type of (Sold unit)) from Nexus 0054 <gen>
11-17-2006, 05:45 PM#8
Av3n
Well in my map inititalization should it end up like this?

Trigger:
Map Initialization
Collapse Events
Map initialization
Conditions
Collapse Actions
Sound - Play Sad Mystery
Set Combine_Charged_Items = True
Set Combine_Charges_Max = 15
Game - Display to (All players) for 10.00 seconds the text: Welcome to Dalaran ...
Collapse Player Group - Pick every player in (All players) and do (Actions)
Collapse Loop - Actions
Player - Set (Picked player) Current gold to 500
Player - Set (Picked player) Food cap to 5
Player - Set (Picked player) Available free Heroes to 0
Player - Set (Picked player) Food max to 5
Player - Limit training of Heroes to 1 for (Picked player)
Player - Turn Gives bounty On for (Picked player)
Game - Hide creep camps on the minimap
Neutral Building - Add Geomancer to Dalaran Tarven 0000 <gen> with 1 in stock and a max stock of 1
Neutral Building - Add Dream Eater to Dalaran Tarven 0000 <gen> with 1 in stock and a max stock of 1
Neutral Building - Add Bionic Knight to Dalaran Tarven 0000 <gen> with 1 in stock and a max stock of 1
Neutral Building - Add Dark Renevant to Dalaran Tarven 0000 <gen> with 1 in stock and a max stock of 1
Neutral Building - Add Magical Vanguard to Dalaran Tarven 0000 <gen> with 1 in stock and a max stock of 1
Neutral Building - Add Demon Mistress to Dalaran Tarven 0000 <gen> with 1 in stock and a max stock of 1
Neutral Building - Add Skeletal Mage to Dalaran Tarven 0000 <gen> with 1 in stock and a max stock of 1
Neutral Building - Add Dragon King to Dalaran Tarven 0000 <gen> with 1 in stock and a max stock of 1
Neutral Building - Add Black Assassin to Dalaran Tarven 0000 <gen> with 1 in stock and a max stock of 1
Neutral Building - Add Dark Blade to Dalaran Tarven 0000 <gen> with 1 in stock and a max stock of 1
Neutral Building - Add Death Shooter to Dalaran Tarven 0000 <gen> with 1 in stock and a max stock of 1
Neutral Building - Add Holy Maiden to Dalaran Tarven 0000 <gen> with 1 in stock and a max stock of 1
Custom script: call DestroyTrigger(GetTriggeringTrigger())

Then I use the some old trigger for removing correct

-Av3n
11-17-2006, 10:48 PM#9
The_AwaKening
You've got it !
11-18-2006, 02:15 AM#10
[VDM]Amn
if max is 1 u dont have to do that trigger to disable the unit's sell.
11-18-2006, 03:54 PM#11
The_AwaKening
Yes you do. I use that method in my map and the heros stay there. I do believe for items though that it takes them out after purchased. Not sure why units don't do the same.