[Solved] Sell Random Hero/Control Neutral Unit Availability

Status
Not open for further replies.
Level 7
Joined
Sep 4, 2016
Messages
116
I'm trying to implement a -purchase random hero- option in a standard tavern-like building, and to do this with the tier limitations, I needed to disable and enable purchase of units via triggers. I'm trying to use 'Remove <unit> from (Triggering unit)' and 'Add <unit> to (Triggering unit) with 1 in stock and a max stock of 1', where I have confirmed that 'Triggering unit' is my custom Tavern building. Unfortunately, it seems to be having no effect.

I've tried looking around for answers to this issue elsewhere and didn't find anything directly. If I did just miss it, please direct me to it. All I did find was about items in neutral buildings, that you can only remove something through triggers that was added through triggers. I have tried that with these units, but it isn't working. Does anyone know why it may not be working for me?
 
Level 7
Joined
Sep 4, 2016
Messages
116
I switched to trying to use 'Make <unit> Un/available for training/construction by (Triggering player)', which seems to work on Hero units but not normal units. This produces different problems with dealing with standard tier hero limitations. Any ideas, please let me know.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
You can make certain units or heroes have a techtree requirement of another particular unit that can’t be actively built by the player. When you want them to have access to these units/heroes you make one of the required units for them somewhere on the map and hide it. This will then enable the purchase/construction/training of whatever units require that ‘dummy’ one.
 
Level 7
Joined
Sep 4, 2016
Messages
116
Thank you @Pyrogasm, I was thinking of doing something like that but with upgrades.
What ended up working was that I created a hero that wasn't in the gameplay constant and an icon and description matching the random hero choice. I gave that hero the standard hero techtree tier requirements. I have a trigger for replacing him. And I make sure all heroes he can be replaced with are in the 'hero' set in Gameplay Constants.

Appears to be working so far, and is a lot simpler than I had expected. Thanks everyone.
 
Status
Not open for further replies.
Top