Taverns with Random Heroes

Status
Not open for further replies.
Level 2
Joined
Mar 2, 2010
Messages
6
For a small project I would like to make taverns, eight in total and each only usable by a single player, have individual and exclusive random heroes that are random with each new game. For example:

Eight players begin in the game, each in control of a single tavern for their individual character selection. In each tavern there are, lets say eight heroes: one Villager, one Human, one Undead, one High Elf, one Blood Elf, one Orc, one Forest Troll, and one Night Elf. Overall there are eight Heroes for each race, however each player will only have access to one Hero from each race, randomly selected at the beginning of the game, and no other player will be able to select the same Hero of the same race, such as:

[Game One]

Player 1 Human Hero - Adrian Guildman
Player 2 Human Hero - Theodore Bannister
Player 3 Human Hero - James Algaladin
Player 4 Human Hero - Kent Laraby
Player 5 Human Hero - Jefferson Monte
Player 6 Human Hero - Francis Griswald
Player 7 Human Hero - Parsley Davis
Player 8 Human Hero - Gael Henriksson

[Game Two]

Player 1 Human Hero - Jefferson Monte
Player 2 Human Hero - James Algaladin
Player 3 Human Hero - Theodore Bannister
Player 4 Human Hero - Gael Henriksson
Player 5 Human Hero - Parsley Davis
Player 6 Human Hero - Kent Laraby
Player 7 Human Hero - Adrian Guildman
Player 8 Human Hero - Francis Griswald

Given my limited experience in something such as this any help would be appreciated.
 
Level 12
Joined
May 22, 2015
Messages
1,051
I remember seeing some stuff about "Neutral Building - ..." triggers - the context was for adding items dynamically. There may be one for adding heroes to a tavern (I don't know for sure, but worth a check). Then you can make an array with all of your heroes and randomly choose a bunch of them and add them to a tavern. Repeat for each tavern.

I don't know how to make them only work for one player, though.

Another thing that might work is if you disable construction of those units (like in the campaign how you can only build certain types of units / research certain things - I think there are triggers to modify these things). Basically, you would have a building with ALL of your heroes in it and then remove random heroes until there are only enough left to fill the tavern. Then you can give one to each player or something.
 
Level 21
Joined
Nov 4, 2013
Messages
2,016
This is not hard. We'll be working on a command called Player - Set Training/Construction Availability Of Unit, no items and no neutral building triggers. An example is this:

  • Player - Make Beastmaster Unavailable for training/construction by Player(RandomInteger)
In this case, the Beastmaster is removed from the options of the Tavern for player 1 only. Now we build on this to create what you want. I will suggest a solution later, now I am not free.
 
Last edited:
Level 2
Joined
Jun 28, 2015
Messages
20
Could this not be achived with this action:
  • Actions
    • Set array = (Random integer number between 1 and 10)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • array Equal to 1
      • Then - Actions
  • -------- Hero Stuff Here --------
    • Else - Actions
and then add hero's to the tavern based on each value?
 
Level 12
Joined
May 22, 2015
Messages
1,051
I think it's more the adding part that is not as clear. That and making it so each player has their own set and can't buy from other peoples' taverns.
 
Level 2
Joined
Jun 28, 2015
Messages
20
as shadow fury pointed out, you can make specific units unavailable for each player.
just add ALL of the hero's to the tavern and then make some unavailable.
 
Level 12
Joined
May 22, 2015
Messages
1,051
Ya that was also one of my suggestions :p I think we're basically waiting on the OP to get back to see if there are still problems.
 
Level 2
Joined
Mar 2, 2010
Messages
6
Alright, I have the trigger working. It was exactly what I was looking for. There are a few small issues but I was throwing it together quickly so it was bound to happen. Still, nothing that I can't fix on my own.

Thank you everyone.
 
Status
Not open for further replies.
Top