• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Hotkeys lost after AddUnitToStock

Status
Not open for further replies.
Level 11
Joined
Mar 6, 2008
Messages
898
Hey, I wanted to create a shop where I can dynamically add and remove units or change their quantity.
So far it worked very well, however, there is one huge problem with this approach which I couldn't easily solve.

If I add a unit via AddUnitToStock native its hotkey does not work and a player has to manually click on the icon the actually purchase the unit. This is really bad for what I am trying to do. I guess this is a Blizzard bug since adding those units in the object editor works fine, even for partial subsets of units in the shop.

Does anybody know a decent work around?
A work around involving mass copies of object editor entities is not something I am after - for example I could create an ability with the exact hotkey per unit and add it hidden inside a spellbook to the shop and later catch the ability casts. I have not checked if this actually works but I really am not interested in such hacky approaches to solve this simple problem.

If it is unsolvable for now I will simply go back to the static approach.
 
Level 11
Joined
Mar 6, 2008
Messages
898
You are free to bump this since I am still interested in a solution.
For my own project I stopped this experiment and concluded that there is currently no fix for it.
But in WarCraft III you basically can nearly always find a hack to do it - wearing hand gloves of course. ;)
 
Status
Not open for further replies.
Top