• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Random spawn

Status
Not open for further replies.
Level 4
Joined
Mar 20, 2010
Messages
107
I'm not quite sure what you meant, but if it is what I believe then you should be able to use a simple trigger, no?

  • Events
  • Unit - Yourboss <gen> Takes damage
  • Conditions
  • Actions
  • Unit - Create 1 (Unit-type of (Random unit from YourBossAddGroup)) for Neutral Hostile at (Center of (Playable map area)) facing 90.00 degrees
  • Unit - Create 1 (Unit-type of (Random unit from YourBossAddGroup)) for Neutral Hostile at (Center of (Playable map area)) facing 90.00 degrees
  • Unit - Create 1 (Unit-type of (Random unit from YourBossAddGroup)) for Neutral Hostile at (Center of (Playable map area)) facing 90.00 degrees
  • Unit - Create 1 (Unit-type of (Random unit from YourBossAddGroup)) for Neutral Hostile at (Center of (Playable map area)) facing 90.00 degrees
That would give you 4 random units from the 6 units you added to the "YourBossAddGroup". But, I don't know if you want all 4 to be different, or if some can be of same type. And that's why my simple trigger might not work :p In worst case: You can use this trigger 'till someone more skilled tells you a lot better one :smile:

(and sorry for the sucky TRIGGER wraping around text, imma newbie on hives forums :xxd: )
Good luck with your boss!
 
do like this do a integer variable set it 20 then you do event every 20 seconds of game

and then if then else. Random number between 1-100 (Integer)

then you do the same but the if then else should be on the else i hope you know what i mean. I guess that works.
Don't forget to turn off the trigger if its true on the then action.
what? this doesn't even make sense -

You have to do a UNIT TYPE variable array. NOT INTEGER variable! My goodness. And not 20! Six! And why an if ?? Did you even read the post?


  • Init
    • Events
      • Event - Map Initialization
    • Conditions
    • Actions
      • Set Type[1] = Footman
      • Set Type[2] = Grunt
      • Set Type[3] = Tauren
      • Set Type[4] = Raider
      • Set Type[5] = Dragonhawk
      • Set Type[6] = Frost Wyrm
  • Make4
    • Events
      • -------- For events do whatever works for you --------
    • Conditions
    • Actions
      • For each Integer A from 0 - 3, do Loop - Actions
        • Loop - Actions
          • Set Point = Position of Boss
          • Unit - Create 1 Type[(Math - Random Integer between 1 and 6)] for Player at (Point)
          • Custom script: call RemoveLocation( udg_Point )
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Bribe's trigger can generate two units of the same type as far as I can tell.

This creates only one unit of every type:

  • Untitled Trigger 001
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set Unit_Type_Array[0] = Paladin
      • Set Unit_Type_Array[1] = Archmage
      • Set Unit_Type_Array[2] = Mountain King
      • Set Unit_Type_Array[3] = Blood Mage
      • Set Unit_Type_Array[4] = Blademaster
      • Set Unit_Type_Array[5] = Far Seer
  • Untitled Trigger 002
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • For each (Integer A) from 0 to 5, do (Actions)
        • Loop - Actions
          • Set Temp_Loc_1 = (Random point in Region 000 <gen>)
          • Unit - Create 1 Unit_Type_Array[(Integer A)] for Player 1 (Red) at Temp_Loc_1 facing Default building facing degrees
          • Unit Group - Add (Last created unit) to Temp_Group_1
          • Custom script: call RemoveLocation(udg_Temp_Loc_1)
      • For each (Integer B) from 1 to 2, do (Actions)
        • Loop - Actions
          • Unit - Remove (Random unit from Temp_Group_1) from the game
      • Unit Group - Remove all units from Temp_Group_1
 
Status
Not open for further replies.
Top