Hi, I'm Versae. I'm currently working a hero-survival type map (not very original, I know, although you'll see once it's finished ) and I have a small question.
This is the trigger I currently have for all random mode. This trigger has no events as it is being activated by another trigger, but I don't think that should matter:
I have a few more actions in there but they are not relevant, as for example, one of them is just telling everyone that "(Picked player) has randomed (Last created unit)."
Here are the variables I have which are relevant to this question:
Hero_Random - An integer.
Hero[] - A unit-type array.
And to decide what each array number of Hero[] is equal to I have this:
And this list goes through 24 values, as I have 24 heroes available in my map in total.
However, here is my small problem:
Whenever I test this trigger by running the map and selecting all random mode, I always seem to be getting the same hero. I am always getting hero #19 on my list (Tinker), and I have run this test over 15 times now.
I have not tested whether every single player would get tinker, as I have only been testing alone so far, so I should probably do that, but for now there is still the issue as to why I am always getting the same hero.
Have I set up my trigger wrong?
This is the trigger I currently have for all random mode. This trigger has no events as it is being activated by another trigger, but I don't think that should matter:
Trigger:
- Hero Randomizer
- Events
- Conditions
- Actions
- Player Group - Pick every player in (All players matching (((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing))) and do (Actions)
- Set Hero_Random = (Random Integer between 1 and 24)
- Unit - Create 1 Hero[Hero_Random] for (Picked player) at (Center of Select Hero <gen>) facing Default building facing degrees
- Player Group - Pick every player in (All players matching (((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing))) and do (Actions)
I have a few more actions in there but they are not relevant, as for example, one of them is just telling everyone that "(Picked player) has randomed (Last created unit)."
Here are the variables I have which are relevant to this question:
Hero_Random - An integer.
Hero[] - A unit-type array.
And to decide what each array number of Hero[] is equal to I have this:
Trigger:
- Heroes Available
- Events
- Map Initialization
- Conditions
- Actions
- Set Hero[1] = Paladin
- Set Hero[2] = Demon Hunter
- Set Hero[3] = Archmage
- ...
- Set Hero[24] = Pit Lord
- Events
And this list goes through 24 values, as I have 24 heroes available in my map in total.
However, here is my small problem:
Whenever I test this trigger by running the map and selecting all random mode, I always seem to be getting the same hero. I am always getting hero #19 on my list (Tinker), and I have run this test over 15 times now.
I have not tested whether every single player would get tinker, as I have only been testing alone so far, so I should probably do that, but for now there is still the issue as to why I am always getting the same hero.
Have I set up my trigger wrong?