All Random Help

Scary Nachos

Castro flashing Gang Signs!
Reaction score
45
Hello! I need help with random stuff, ok so... when you buy a hero, named "Random Hero" I wish to get rid of the hero, and spawn a random hero in its place, but.... its not exactly working. I have random seed check off.
Here is my code

Trigger:
  • HumanRandom
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Selling unit)) Equal to Random Hero (Human)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Buying unit)) is an ally of Player 11 (Dark Green)) Equal to True
        • Then - Actions
          • Unit - Create 1 Random Hero for (Owner of (Sold unit)) at (Center of Random Hero 1 <gen>) facing Default building facing degrees
          • Unit - Remove (Sold unit) from the game
        • Else - Actions
          • Unit - Create 1 Random_Heros[(Random integer number between 1 and 96)] for (Owner of (Sold unit)) at (Center of Random Hero 1 <gen>) facing Default building facing degrees


I am using regular WE if that helps
and here are my random heros

Trigger:
  • Human Random
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Random_Heros[1] = Paladin (+)
      • Set Random_Heros[2] = Archmage (+)
      • Set Random_Heros[3] = Mountain King (+)
      • Set Random_Heros[4] = Blood Mage (+)
      • Set Random_Heros[5] = Keeper of the Grove (+)
      • Set Random_Heros[6] = Priestess of the Moon (+)
      • Set Random_Heros[7] = Demon Hunter (+)
      • Set Random_Heros[8] = Warden (+)
      • Set Random_Heros[9] = Alchemist (+)
      • Set Random_Heros[10] = Naga Sea Witch (+)
      • Set Random_Heros[11] = Tinker (+)
      • Set Random_Heros[12] = Beastmaster (+)


It goes up to 96 heros
 

WarToast

Active Member
Reaction score
3
(Unit-type of (Selling unit)) Equal to Random Hero (Human)
selling unit = the unit selling something, so unless your shop is this "Random Hero" then you should probably change that.
 

95blojoe

New Member
Reaction score
7
Hello! I need help with random stuff, ok so... when you buy a hero, named "Random Hero" I wish to get rid of the hero, and spawn a random hero in its place, but.... its not exactly working. I have random seed check off.
Here is my code

Trigger:
  • HumanRandom
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Selling unit)) Equal to Random Hero (Human)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Buying unit)) is an ally of Player 11 (Dark Green)) Equal to True
        • Then - Actions
          • Unit - Create 1 Random Hero for (Owner of (Sold unit)) at (Center of Random Hero 1 <gen>) facing Default building facing degrees
          • Unit - Remove (Sold unit) from the game
        • Else - Actions
          • Unit - Create 1 Random_Heros[(Random integer number between 1 and 96)] for (Owner of (Sold unit)) at (Center of Random Hero 1 <gen>) facing Default building facing degrees


I am using regular WE if that helps
and here are my random heros

Trigger:
  • Human Random
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Random_Heros[1] = Paladin (+)
      • Set Random_Heros[2] = Archmage (+)
      • Set Random_Heros[3] = Mountain King (+)
      • Set Random_Heros[4] = Blood Mage (+)
      • Set Random_Heros[5] = Keeper of the Grove (+)
      • Set Random_Heros[6] = Priestess of the Moon (+)
      • Set Random_Heros[7] = Demon Hunter (+)
      • Set Random_Heros[8] = Warden (+)
      • Set Random_Heros[9] = Alchemist (+)
      • Set Random_Heros[10] = Naga Sea Witch (+)
      • Set Random_Heros[11] = Tinker (+)
      • Set Random_Heros[12] = Beastmaster (+)


It goes up to 96 heros

When you set the variables how do you choose the hero as a the value? Oo
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top