• 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.

Prevent player to hire another hero

Status
Not open for further replies.
Level 24
Joined
Jun 26, 2020
Messages
1,928
Hello, I'm making a multiplayer map where you can choose a hero (by hiring it), but the place where is choosed is reachable for the normal units, so instead of make it unreachable I wanna know I can make it impossible to hire another one just for that player. I tried adding techtree requiriments and limit the number of heros but it didn't work.
 
You need to set limit of hero to 1 AND add the hero to gameplay constant. Since the constant is limited to 52 heroes (you can delete entries there, but the limit is hard-coded IIRC), create a dummy 'Hero' unit and make all heroes have techtree equivalent to it.
 
Level 24
Joined
Jun 26, 2020
Messages
1,928
you could add a trigger that detects when you try to buy a hero, and cancels the order (and shows error text) when the player already has one.
It could be, but if I use the "Sells a unit event" I can't remove the unit sound, and with the "Issues an order event" how can I refer to the buying player? Because the triggering unit is the shop.
You need to set limit of hero to 1 AND add the hero to gameplay constant. Since the constant is limited to 52 heroes (you can delete entries there, but the limit is hard-coded IIRC), create a dummy 'Hero' unit and make all heroes have techtree equivalent to it.
I followed the instructions, but didn't work.
 
Last edited:
Level 10
Joined
Mar 25, 2008
Messages
339
You can make a simple Integer, array it to as many players as there are in the game so 12/24?
Add a trigger when they hire the hero their integer (player number of owner of buying unit) or whatever +1 or = true if you use a boolean

And in that same trigger you could add it so if its already =1 or =True it just auto-deletes the hero that was just purchased.
 
Level 10
Joined
Mar 25, 2008
Messages
339
1657464756032.png

1657464771212.png

1657464806005.png
 
Level 24
Joined
Jun 26, 2020
Messages
1,928
You can make a simple Integer, array it to as many players as there are in the game so 12/24?
Add a trigger when they hire the hero their integer (player number of owner of buying unit) or whatever +1 or = true if you use a boolean

And in that same trigger you could add it so if its already =1 or =True it just auto-deletes the hero that was just purchased.
Thank you but, this is what @Cheshire suggested me and I've already done this, and this is not my ideal solution because it still sounds the when I hire the hero.
 
Status
Not open for further replies.
Top