• 🏆 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!

Randomly selected spawn system.

Status
Not open for further replies.
Level 7
Joined
Jan 17, 2019
Messages
163
Hello, so in my map 4 players play as random hero monsters. From a pool of 10 initially but an 11th mini-boss is added to the pool later. I'm trying but I cant seem to get the randomly selected trigger to work. Should be fairly simple, when their monster dies 30 seconds later a random monster that is not the one they just had spawns for them and the one that died is returned to the gallery (Imgur). I can't do random integer 1-10 because it could select one of the other players controlled monsters from the same pool.

Here is what I've cooked up but I am either missing something or doing it wrong. Any help would be greatly appreciated.

  • Heretic Rez
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) is in HereticSelectorVariable[0].) Equal to True
        • Then - Actions
          • Game - Display to (All players controlled by a ((Owner of (Dying unit)) controller) player) the text: |cff800080You will ...
          • Wait 30.00 seconds
          • Unit Group - Pick every unit in (Random 1 units from HereticSelectorVariable[0]) and do (Actions)
            • Loop - Actions
              • Unit Group - Remove (Picked unit) from HereticSelectorVariable[0].
              • Unit - Move (Picked unit) instantly to (Random point in Region 155 <gen>)
              • Unit - Change ownership of (Picked unit) to (Owner of (Dying unit)) and Change color
              • Unit - Make (Picked unit) Vulnerable
              • Game - Display to (All players controlled by a ((Owner of (Dying unit)) controller) player) the text: |cff800080Your new ...
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Equal to Prince of Agony 0007 <gen>
                • Then - Actions
                  • Game - Display to (All players) the text: |cff800080THE PRINC...
                  • Sound - Play QuestFailed <gen>
                • Else - Actions
                  • Do nothing
          • Wait 30.00 seconds
          • Unit Group - Add (Dying unit) to HereticSelectorVariable[0]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to Crypt Guard 0083 <gen>
            • Then - Actions
              • Hero - Instantly revive Crypt Guard 0083 <gen> at (Center of Region 891 <gen>), Show revival graphics
              • Unit - Change ownership of Crypt Guard 0083 <gen> to Neutral Passive and Change color
              • Unit - Make Crypt Guard 0083 <gen> Invulnerable
              • Unit - Make Crypt Guard 0083 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to Potion Master 0016 <gen>
            • Then - Actions
              • Hero - Instantly revive Potion Master 0016 <gen> at (Center of Region 891 Copy <gen>), Show revival graphics
              • Unit - Change ownership of Potion Master 0016 <gen> to Neutral Passive and Change color
              • Unit - Make Potion Master 0016 <gen> Invulnerable
              • Unit - Make Crypt Guard 0083 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to Heretic 0039 <gen>
            • Then - Actions
              • Hero - Instantly revive Heretic 0039 <gen> at (Center of Region 891 Copy 2 <gen>), Show revival graphics
              • Unit - Change ownership of Heretic 0039 <gen> to Neutral Passive and Change color
              • Unit - Make Heretic 0039 <gen> Invulnerable
              • Unit - Make Heretic 0039 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to Feast Bringer 0000 <gen>
            • Then - Actions
              • Hero - Instantly revive Feast Bringer 0000 <gen> at (Center of Region 891 Copy 3 <gen>), Show revival graphics
              • Unit - Change ownership of Feast Bringer 0000 <gen> to Neutral Passive and Change color
              • Unit - Make Feast Bringer 0000 <gen> Invulnerable
              • Unit - Make Feast Bringer 0000 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to Bride of Lament 0102 <gen>
            • Then - Actions
              • Hero - Instantly revive Bride of Lament 0102 <gen> at (Center of Region 891 Copy 4 <gen>), Show revival graphics
              • Unit - Change ownership of Bride of Lament 0102 <gen> to Neutral Passive and Change color
              • Unit - Make Bride of Lament 0102 <gen> Invulnerable
              • Unit - Make Bride of Lament 0102 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to Black Mass 0231 <gen>
            • Then - Actions
              • Hero - Instantly revive Black Mass 0231 <gen> at (Center of Region 891 Copy 5 <gen>), Show revival graphics
              • Unit - Change ownership of Black Mass 0231 <gen> to Neutral Passive and Change color
              • Unit - Make Black Mass 0231 <gen> Invulnerable
              • Unit - Make Black Mass 0231 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to Shade Sister 0803 <gen>
            • Then - Actions
              • Hero - Instantly revive Shade Sister 0803 <gen> at (Center of Region 891 Copy 6 <gen>), Show revival graphics
              • Unit - Change ownership of Shade Sister 0803 <gen> to Neutral Passive and Change color
              • Unit - Make Shade Sister 0803 <gen> Invulnerable
              • Unit - Make Shade Sister 0803 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to Blade Dancer 0443 <gen>
            • Then - Actions
              • Hero - Instantly revive Blade Dancer 0443 <gen> at (Center of Region 891 Copy 7 <gen>), Show revival graphics
              • Unit - Change ownership of Blade Dancer 0443 <gen> to Neutral Passive and Change color
              • Unit - Make Blade Dancer 0443 <gen> Invulnerable
              • Unit - Make Blade Dancer 0443 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to Bone Caller 0127 <gen>
            • Then - Actions
              • Hero - Instantly revive Bone Caller 0127 <gen> at (Center of Region 891 Copy 8 <gen>), Show revival graphics
              • Unit - Change ownership of Bone Caller 0127 <gen> to Neutral Passive and Change color
              • Unit - Make Bone Caller 0127 <gen> Invulnerable
              • Unit - Make Bone Caller 0127 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to Flesh Hound 0056 <gen>
            • Then - Actions
              • Hero - Instantly revive Flesh Hound 0056 <gen> at (Center of Region 891 Copy 9 <gen>), Show revival graphics
              • Unit - Change ownership of Flesh Hound 0056 <gen> to Neutral Passive and Change color
              • Unit - Make Flesh Hound 0056 <gen> Invulnerable
              • Unit - Make Flesh Hound 0056 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to Prince of Agony 0007 <gen>
            • Then - Actions
              • Hero - Instantly revive Prince of Agony 0007 <gen> at (Center of Region 891 Copy 10 <gen>), Show revival graphics
              • Unit - Change ownership of Prince of Agony 0007 <gen> to Neutral Passive and Change color
              • Unit - Make Prince of Agony 0007 <gen> Invulnerable
              • Unit - Make Prince of Agony 0007 <gen> face 270.00
              • Unit Group - Remove Prince of Agony 0007 <gen> from HereticSelectorVariable[0].
              • Wait 180.00 seconds
              • Unit Group - Add Prince of Agony 0007 <gen> to HereticSelectorVariable[0]
            • Else - Actions
        • Else - Actions
          • Do nothing
 
Level 2
Joined
Mar 31, 2020
Messages
12
Create 4 global variables, one for each player, and set them to 0 as a default value.
Create 1 global boolean variable, unlockedflag

Loop, for each player

Generate a random integer 1-11

If (whatever conditions for miniboss are NOT met) and random integer == 11 then
set unlockedflag to false.
else
set unlockedflag to true
end if
If unlocked flag is false and random integer does not equal the other players then
start checking next player
end ifs

end loop when all 4 players are generated.

This is basically what you want to do in puesdocode. You'll probably want to make an array for the random numbers each player is being assigned to, should make coding the loop easier. Make sure to re-initialize (set to 0) the variables before you use this function a second time.
 
Last edited:
Level 14
Joined
Feb 7, 2020
Messages
387
Which part of it isn't working? Does it create the wrong unit?

I may be wrong, but I think GetDyingUnit() doesn't survive wait steps. I believe only GetTriggerUnit() (in GUI, this is 'Triggering Unit') does. Therefore, I would assume it's always going to grab the wrong player based on whatever the most recent unit that died 30 sec later etc. Try changing that to Triggering Unit.

I only really know Lua but if you wanted to clean this trigger up there's probably a way to condense it into a hashtable based on unit type. Basically, on start up save all of the applicable regions in a hashtable with unit type as the key and their "gallery" point as the value. When a unit dies, fetch their "gallery" location based on the dying unit type. A JASSer might be able to help suggest how that would look in GUI. It would be much smaller and more controllable (and easier to read for you in the future). Developing a unit new then becomes much easier, too, as you just add the region and the unit type to your hashtable initialization.
 
Level 7
Joined
Jan 17, 2019
Messages
163
I tried a different approach with a unit variable but again I am having no luck. I honestly don't understand... They don't spawn/trigger at all. Unfortunately I don't know anything about hashtables. I might need direct help on this one.

So here is the puzzle:
A single unit must be selected from a group of 10 neutrals
Once selected and moved into action for the controlled player they are removed from said unit group temporarily
After they die they are revived as neutral once more and added back to the group to be picked again (with a delay so they are not repicked immediately)
A new single unit is selected for a player after a respawn timer that is not the last picked
After 50% of the bosses in the game are defeated the unit group has a mini-boss added making it 11 possible choices

Failed trigger:

  • Heretic Start Copy
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Wait 3.00 seconds
      • Set VariableSet HereticRandomUnit = (Random unit from HereticSelectorVariable[0])
      • Unit Group - Remove HereticRandomUnit from HereticSelectorVariable[0].
      • Unit - Move HereticRandomUnit instantly to (Random point in Region 155 <gen>)
      • Unit - Change ownership of HereticRandomUnit to Player 2 (Blue) and Change color
      • Camera - Pan camera for Player 2 (Blue) to (Center of Region 155 <gen>) over 2.00 seconds
      • Selection - Select HereticRandomUnit for Player 2 (Blue)
      • Unit - Make HereticRandomUnit Vulnerable
 
Level 7
Joined
Jan 17, 2019
Messages
163
So following your advice the initial spawn of the Heretic monsters now happens, but I still can't get the respawn system to work to do anything at all. Posting updating triggers:

  • Heretic Rez
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in HereticSelectorVariable[0].) Equal to True
        • Then - Actions
          • Game - Display to (All players controlled by a ((Owner of (Triggering unit)) controller) player) the text: |cff800080You will ...
          • Wait 30.00 seconds
          • Unit Group - Pick every unit in (Random 1 units from HereticSelectorVariable[0]) and do (Actions)
            • Loop - Actions
              • Unit Group - Remove (Picked unit) from HereticSelectorVariable[0].
              • Unit - Move (Picked unit) instantly to (Random point in Region 155 <gen>)
              • Unit - Change ownership of (Picked unit) to (Owner of (Triggering unit)) and Change color
              • Unit - Make (Picked unit) Vulnerable
              • Game - Display to (All players controlled by a ((Owner of (Triggering unit)) controller) player) the text: |cff800080Your new ...
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Equal to Prince of Agony 0007 <gen>
                • Then - Actions
                  • Game - Display to (All players) the text: |cff800080THE PRINC...
                  • Sound - Play QuestFailed <gen>
                • Else - Actions
                  • Do nothing
          • Wait 30.00 seconds
          • Unit Group - Add (Triggering unit) to HereticSelectorVariable[0]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Crypt Guard 0083 <gen>
            • Then - Actions
              • Hero - Instantly revive Crypt Guard 0083 <gen> at (Center of Region 891 <gen>), Show revival graphics
              • Unit - Change ownership of Crypt Guard 0083 <gen> to Player 9 (Gray) and Change color
              • Unit - Make Crypt Guard 0083 <gen> Invulnerable
              • Unit - Make Crypt Guard 0083 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Potion Master 0016 <gen>
            • Then - Actions
              • Hero - Instantly revive Potion Master 0016 <gen> at (Center of Region 891 Copy <gen>), Show revival graphics
              • Unit - Change ownership of Potion Master 0016 <gen> to Player 9 (Gray) and Change color
              • Unit - Make Potion Master 0016 <gen> Invulnerable
              • Unit - Make Crypt Guard 0083 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Heretic 0039 <gen>
            • Then - Actions
              • Hero - Instantly revive Heretic 0039 <gen> at (Center of Region 891 Copy 2 <gen>), Show revival graphics
              • Unit - Change ownership of Heretic 0039 <gen> to Player 9 (Gray) and Change color
              • Unit - Make Heretic 0039 <gen> Invulnerable
              • Unit - Make Heretic 0039 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Feast Bringer 0000 <gen>
            • Then - Actions
              • Hero - Instantly revive Feast Bringer 0000 <gen> at (Center of Region 891 Copy 3 <gen>), Show revival graphics
              • Unit - Change ownership of Feast Bringer 0000 <gen> to Player 9 (Gray) and Change color
              • Unit - Make Feast Bringer 0000 <gen> Invulnerable
              • Unit - Make Feast Bringer 0000 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Bride of Lament 0102 <gen>
            • Then - Actions
              • Hero - Instantly revive Bride of Lament 0102 <gen> at (Center of Region 891 Copy 4 <gen>), Show revival graphics
              • Unit - Change ownership of Bride of Lament 0102 <gen> to Player 9 (Gray) and Change color
              • Unit - Make Bride of Lament 0102 <gen> Invulnerable
              • Unit - Make Bride of Lament 0102 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Black Mass 0231 <gen>
            • Then - Actions
              • Hero - Instantly revive Black Mass 0231 <gen> at (Center of Region 891 Copy 5 <gen>), Show revival graphics
              • Unit - Change ownership of Black Mass 0231 <gen> to Player 9 (Gray) and Change color
              • Unit - Make Black Mass 0231 <gen> Invulnerable
              • Unit - Make Black Mass 0231 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Shade Sister 0803 <gen>
            • Then - Actions
              • Hero - Instantly revive Shade Sister 0803 <gen> at (Center of Region 891 Copy 6 <gen>), Show revival graphics
              • Unit - Change ownership of Shade Sister 0803 <gen> to Player 9 (Gray) and Change color
              • Unit - Make Shade Sister 0803 <gen> Invulnerable
              • Unit - Make Shade Sister 0803 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Blade Dancer 0443 <gen>
            • Then - Actions
              • Hero - Instantly revive Blade Dancer 0443 <gen> at (Center of Region 891 Copy 7 <gen>), Show revival graphics
              • Unit - Change ownership of Blade Dancer 0443 <gen> to Player 9 (Gray) and Change color
              • Unit - Make Blade Dancer 0443 <gen> Invulnerable
              • Unit - Make Blade Dancer 0443 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Bone Caller 0127 <gen>
            • Then - Actions
              • Hero - Instantly revive Bone Caller 0127 <gen> at (Center of Region 891 Copy 8 <gen>), Show revival graphics
              • Unit - Change ownership of Bone Caller 0127 <gen> to Player 9 (Gray) and Change color
              • Unit - Make Bone Caller 0127 <gen> Invulnerable
              • Unit - Make Bone Caller 0127 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Flesh Hound 0056 <gen>
            • Then - Actions
              • Hero - Instantly revive Flesh Hound 0056 <gen> at (Center of Region 891 Copy 9 <gen>), Show revival graphics
              • Unit - Change ownership of Flesh Hound 0056 <gen> to Player 9 (Gray) and Change color
              • Unit - Make Flesh Hound 0056 <gen> Invulnerable
              • Unit - Make Flesh Hound 0056 <gen> face 270.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Prince of Agony 0007 <gen>
            • Then - Actions
              • Hero - Instantly revive Prince of Agony 0007 <gen> at (Center of Region 891 Copy 10 <gen>), Show revival graphics
              • Unit - Change ownership of Prince of Agony 0007 <gen> to Player 9 (Gray) and Change color
              • Unit - Make Prince of Agony 0007 <gen> Invulnerable
              • Unit - Make Prince of Agony 0007 <gen> face 270.00
              • Unit Group - Remove Prince of Agony 0007 <gen> from HereticSelectorVariable[0].
              • Wait 180.00 seconds
              • Unit Group - Add Prince of Agony 0007 <gen> to HereticSelectorVariable[0]
            • Else - Actions
        • Else - Actions
          • Do nothing
  • Heretic Variable Initial
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in Region 901 <gen>) and do (Unit Group - Add (Picked unit) to HereticSelectorVariable[0])
      • Unit Group - Pick every unit in (Units in Region 901 <gen>) and do (Unit - Make (Picked unit) Invulnerable)
      • Unit - Make Prince of Agony 0007 <gen> Invulnerable
 
Level 14
Joined
Feb 7, 2020
Messages
387
I think you're running into problems with wait steps. Ambiguous polled waits are a bit dangerous.

Attached what I came up with using a hashtable that would probably be more reliable. It would also let you streamline development of new units (simply plop new heroes into the eligible units region).

It might have bugs or be janky, and you'll have to customize it to your liking for special conditions (e.g. your Prince of Agony increased spawn timer) but I encourage you to read some tutorials if hashtables are confusing (e.g. Hashtables and MUI).

I added the config stuff up top so you can paste into your map to test it out. If you boot it up, kill the first unit then run around for 10 sec to allow the next unit to respawn (it's on a short timer for testing).

edit: for others to give suggestions or catch things I missed, attached the GUI for reference:
edit 2: found a few bugs, attached v2



  • Init Gallery
    • Events
      • Time - Elapsed game time is 0.33 seconds
    • Conditions
    • Actions
      • -------- config --------
      • Set VariableSet gallerySpawnRegion = SpawnReg <gen>
      • -------- -- --------
      • Custom script: set udg_galleryTable = InitHashtable()
      • Set VariableSet galleryIndexInt = 0
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in galleryUnits <gen>) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to galleryOwner
            • Then - Actions
              • Unit - Pause (Picked unit)
              • Unit - Make (Picked unit) Invulnerable
              • Set VariableSet galleryLoc[galleryIndexInt] = (Position of (Picked unit))
              • Hashtable - Save Handle Of(Picked unit) as 0 of galleryIndexInt in galleryTable.
              • Hashtable - Save Handle OfgalleryLoc[galleryIndexInt] as 1 of galleryIndexInt in galleryTable.
              • Unit Group - Add (Picked unit) to galleryPool
              • Set VariableSet galleryIndexInt = (galleryIndexInt + 1)
            • Else - Actions
  • Gallery Death
    • Events
      • Unit - A unit owned by Player 2 (Blue) Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set VariableSet galleryTimerInt = 0
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Gallery Timer <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Gallery Timer <gen>
        • Else - Actions
  • Gallery Timer
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set VariableSet galleryTimerInt = (galleryTimerInt + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • galleryTimerInt Equal to galleryDefeatTimer
        • Then - Actions
          • -------- when this time value is reached, spawn a new enemy --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (galleryPool is empty) Equal to True
            • Then - Actions
              • -------- if no units have respawned, start timer over --------
              • Set VariableSet galleryTimerInt = 0
            • Else - Actions
              • Trigger - Run Gallery Spawn Contender <gen> (checking conditions)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • galleryTimerInt Equal to galleryRespawnTimer
            • Then - Actions
              • -------- when this time value is reached, add the defeated units back to the eligible pool --------
              • For each (Integer galleryIndexLoop) from 0 to galleryIndexInt, do (Actions)
                • Loop - Actions
                  • Set VariableSet galleryTempUnit = (Load 0 of galleryIndexLoop in galleryTable.)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (galleryTempUnit is dead) Equal to True
                          • (Life of galleryTempUnit) Less than 0.41
                    • Then - Actions
                      • Hero - Instantly revive galleryTempUnit at (Load 1 of galleryIndexLoop in galleryTable.), Hide revival graphics
                      • Unit - Pause galleryTempUnit
                      • Unit - Make galleryTempUnit Invulnerable
                      • Unit - Make galleryTempUnit face 270.00 over 0.00 seconds
                      • Unit Group - Add galleryTempUnit to galleryPool
                    • Else - Actions
                  • Set VariableSet galleryTempUnit = No unit
              • Set VariableSet galleryTimerInt = 0
              • Trigger - Turn off (This trigger)
            • Else - Actions
  • Gallery Spawn Contender
    • Events
    • Conditions
    • Actions
      • -------- init vars --------
      • Set VariableSet galleryTempLoc = (Center of gallerySpawnRegion)
      • Set VariableSet galleryTempGroup = (Random 1 units from galleryPool)
      • Set VariableSet galleryTempUnit = (Random unit from galleryTempGroup)
      • -------- engage combat --------
      • Unit - Unpause galleryTempUnit
      • Unit - Make galleryTempUnit Vulnerable
      • Unit - Move galleryTempUnit instantly to galleryTempLoc
      • -------- effect on spawn --------
      • Special Effect - Create a special effect at galleryTempLoc using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • -------- no longer spawns as a random choice --------
      • Unit Group - Remove galleryTempUnit from galleryPool.
      • -------- cleanup --------
      • Set VariableSet galleryTempUnit = No unit
      • Custom script: call DestroyGroup(udg_galleryTempGroup)
      • Custom script: call RemoveLocation(udg_galleryTempLoc)
 

Attachments

  • gallery_hash.w3m
    17.9 KB · Views: 27
  • gallery_hash_v2.w3m
    18.4 KB · Views: 25
Last edited:
Level 7
Joined
Jan 17, 2019
Messages
163
Woah thanks for going through all the trouble to make this but wow this has sent my eyebrows into the cieling fan trying to understand it. Would you be up for adding it to my map yourself? Everything is in the top left corner of the map and I already have some hero units there to beat up anything that respawns for testing. I disabled all the triggers I was working on.

Heresy 30.30 (Heretic Respawn System HIVE).w3x

Welcome to poke around. Even two boss fights available if you move the solo Elena or Sir Bryant into them. Been working on the map 1.5 years with the full intent hoping it will go viral :)
 
Level 14
Joined
Feb 7, 2020
Messages
387
Woah thanks for going through all the trouble to make this but wow this has sent my eyebrows into the cieling fan trying to understand it. Would you be up for adding it to my map yourself? Everything is in the top left corner of the map and I already have some hero units there to beat up anything that respawns for testing. I disabled all the triggers I was working on.

Heresy 30.30 (Heretic Respawn System HIVE).w3x

Welcome to poke around. Even two boss fights available if you move the solo Elena or Sir Bryant into them. Been working on the map 1.5 years with the full intent hoping it will go viral :)

How are you going to learn and manage it if I do it
:peasant-wink:

I loaded up the map and there's a lot going on. What exactly is going on with the Heretic spawns? How is it supposed to work?
 
Level 7
Joined
Jan 17, 2019
Messages
163
Maps like 95% done, only thing left is the Heretic spawns and the final boss. Probably won't be making anymore maps after this since I want to get into the new Source VR engine. So learning advanced techniques at this point would be forgotten immediately after lol.

Player Blue, Purple, Green, and Brown play as the Heretics who are defending the dungeons from the Hunters. It's basically Left 4 Dead in a Castlevania like setting. The 10 possible Heretics they play as and the Prince of Agony mini boss are in the gallery, below them is a mini-map that tracks the Hunters positions, living bosses, and the runes are what they use to teleport around the dungeon. I just need a trigger so when a Heretic dies they will get a new random Heretic 30 seconds later in the open space above the mini-map, returning the previous Heretic that died to the gallery. What makes it tricky for me is it can't select the one they just played as OR the ones currently played by the other players. Also the Prince of Agony is added to the spawnable pool mid-game, with a much longer respawn timer when it dies.

Maybe instead of hash tables and variable there could be a simple way to select the new Heretics with a region trigger? No other units can enter the gallery and I could simply move the Prince into the region when ready/after the long respawn timer. Problem is I don't know how to randomly select units in the region, was my original first attempt but it wouldn't pick anything. That's when I tried adding all the Heretics to a variable and removing them when they are picked for play but I am still having trouble getting them to spawn from that as well. Really scratching my head on this one. Bet it's like one line of trigger off too...
 
Status
Not open for further replies.
Top