All Random

FoxWizzy

New Member
Reaction score
3
Can any one help whit this trigger pls
Trigger:
  • INI
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set unit_type[1] = Paladin
      • Set unit_type[2] = Archmage
      • .....
      • Set hero_nr = 41


Trigger:
  • ar
    • Events
      • Player - Player 1 (Red) types a chat message containing -ar as An exact match
    • Conditions
    • Actions
      • Trigger - Run ar go <gen> (checking conditions)


Trigger:
  • ar go
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players matching ((((Matching player) controler) Equal to User and (((Matching player) slot status ) Equal to Is playing))) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 unit_type[(Random integer number between 1 and hero_nr)] for (Picked player) at (Center of start <gen>) facing Default building facing degrees


It give's me 2 units :(
Can you help me or give me a bether All Random Trigger please
 

inevit4ble

Well-Known Member
Reaction score
38
What if you try adding the units to a unit group variable instead of unit and spawn 1 random unit from unit group?
 

djb4cc1o94

TH.net Regular
Reaction score
5
Map Initialization
Code:
Map Initialization
    Events
        Map initialization
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Player - Set (Picked player) Current gold to 850
                Player - Set (Picked player) Current lumber to 350
                Camera - Pan camera for (Picked player) to (Position of Hero Tavern 0080 <gen>) over 0.00 seconds
                Player - Set (Picked player) Food cap to 5
        Set Total_Heroes = 9
        Set Random_Count = 9
        Set Hero_Array[1] = Ancient Gryphon
        Set Hero_Array[2] = Paladin
        Set Hero_Array[3] = Samuro Ninja
        Set Hero_Array[4] = Black Fury Knight
        Set Hero_Array[5] = Lich
        Set Hero_Array[6] = Sylvanas
        Set Hero_Array[7] = Priestess of the Moon
        Set Hero_Array[8] = Shandris
        Set Hero_Array[9] = Elektra
        For each (Integer A) from 1 to 9, do (Actions)
            Loop - Actions
                Set Random_Data[(Integer A)] = (Integer A)
All Random Command
Code:
All Random Command
    Events
        Player - Player 1 (Red) types a chat message containing -ar as An exact match
    Conditions
    Actions
        Game - Display to (All players) the text: Set game mode to ar...
        For each (Integer A) from 1 to 10, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Player((Integer A))) slot status) Equal to Is playing
                    Then - Actions
                        Set Random_Hero = (Random integer number between 1 and Random_Count)
                        Unit - Create 1 Hero_Array[Random_Data[Random_Hero]] for (Player((Integer A))) at ((Player((Integer A))) start location) facing Default building facing degrees
                        Selection - Select (Last created unit) for (Owner of (Last created unit))
                        Game - Display to (All players) the text: (A player has randomed  + (Name of (Last created unit)))
                        Player - Add -50 to (Player((Integer A))) Current gold
                        Set Random_Data[Random_Hero] = Random_Count
                        Set Random_Count = (Random_Count - 1)
                    Else - Actions
                        Trigger - Turn off (This trigger)
 

rinside

New Member
Reaction score
0
ja, I have the same problem.

To fix it put the heroes (30 heroes) in a region

Random AI
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
Set UnitGroup = (Units in PickRandom <gen>)
Unit Group - Pick every unit in UnitGroup and do (Unit - Move (Picked unit) instantly to (Random point in ReRandom <gen>))
Custom script: call DestroyGroup (udg_UnitGroup)

Jajjaja JAJAJ

and

Random AI
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
Set UnitGroup = (Units in PickRandom <gen>)
Unit Group - Pick every unit in UnitGroup and do (Unit - Move (Picked unit) instantly to (Random point in ReRandom <gen>))
Custom script: call DestroyGroup (udg_UnitGroup)

Command -Random (single player).

Only you get the same hero if you type the command hero at the exact moment in each game, this is because the first trigger always makes changes location in the same frequency. xD
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top