• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Improving and Removing Leaks

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
3,213
EDIT 1: Leaks removed
EDIT 2: More fixing.
EDIT 3: Creep Spawn added

Hi!

I made this trigger for a combat system i'm making for a RPG map.

  • Combat System
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • -------- Wood Group --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 8
          • (Number of units in Wood_Group) Greater than 0
        • Then - Actions
          • Unit Group - Pick every unit in Wood_Group and do (Actions)
            • Loop - Actions
              • Camera - Lock camera target for (Owner of (Picked unit)) to (Picked unit), offset by (0.00, 0.00) using Default rotation
              • Set Temp_HeroPos[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
              • Set Temp_RandomHeroSpawn[(Player number of (Owner of (Picked unit)))] = (Random point in WoodHeroSpawn <gen>)
              • Cinematic - Fade out over 0.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
              • Unit - Move (Picked unit) instantly to Temp_RandomHeroSpawn[(Player number of (Owner of (Picked unit)))]
              • Cinematic - Fade in over 1.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
              • Custom script: call RemoveLocation(udg_Temp_RandomHeroSpawn[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
              • Unit Group - Add (Picked unit) to WoodCombat
              • Unit Group - Remove (Picked unit) from Wood_Group
          • Set Int_WC = ((Number of units in WoodCombat) x 2)
          • Set Int_RWC = (Random integer number between 1 and Int_WC)
          • For each (Integer A) from 1 to Int_RWC, do (Actions)
            • Loop - Actions
              • Set Temp_Point = (Random point in WoodCreepSpawn <gen>)
              • Unit - Create 1 WoodCreeps[(Random integer number between 1 and 9)] for Neutral Hostile at Temp_Point facing Default building facing degrees
              • Custom script: call RemoveLocation(udg_Temp_Point)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in WoodEscape <gen>)) Equal to (Number of units in WoodCombat)
        • Then - Actions
          • Unit Group - Pick every unit in WoodCombat and do (Actions)
            • Loop - Actions
              • Cinematic - Fade out over 0.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
              • Unit - Move (Picked unit) instantly to Temp_HeroPos[(Player number of (Owner of (Picked unit)))]
              • Cinematic - Fade in over 1.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
              • Custom script: call RemoveLocation(udg_Temp_HeroPos[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
              • Unit Group - Remove (Picked unit) from WoodCombat
              • Unit Group - Add (Picked unit) to Wood_Group
        • Else - Actions
How i expect it to work:

1) In another trigger:
1a) When a unit enters/leave the Wood, they're added/removed to/from "Wood_Group".
1b) When the hero dies it's removed from the WoodGroup or WoodCombat.

2) There's a 8% Chance to engage combat inside Wood_Group
  • (Random integer number between 1 and 100) Less than or equal to 8
3) If Combat is engaged:
3a) The position of the hero is saved
  • Set Temp_HeroPos[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
3b) The hero is moved to a random point in a Hero Spawn Area. (Where the heroes appear in the combat area)
  • Set Temp_RandomHeroSpawn[(Player number of (Owner of (Picked unit)))] = (Random point in WoodHeroSpawn <gen>)
3c) There's a different random point for each hero
3d) The hero is removed from Wood_Group and added to WoodCombat.
  • Unit Group - Add (Picked unit) to WoodCombat
  • Unit Group - Remove (Picked unit) from Wood_Group
4) If all the heroes in wood combat stand at WoodExit:
  • (Number of units in (Units in WoodEscape <gen>)) Equal to (Number of units in WoodCombat)
4a) They're all restored to their original positions (Temp_HeroPos)
  • Unit - Move (Picked unit) instantly to Temp_HeroPos[(Player number of (Owner of (Picked unit)))]
4b) They are added again to the Wood_Group and removed from WoodCombat
  • Unit Group - Remove (Picked unit) from WoodCombat
  • Unit Group - Add (Picked unit) to Wood_Group
 
Last edited:
Level 17
Joined
Feb 11, 2011
Messages
1,860
About removing the locations that you don't know how to do:

  • Custom script: call RemoveLocation(udg_Temp_RandomHeroSpawn[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
  • Custom script: call RemoveLocation(udg_Temp_HeroPos[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
EDIT:

  • Trigger
    • Events
    • Conditions
    • Actions
      • Set int = ((Number of units in Wood_Combat) x 2)
      • Set int = (Random integer number between 1 and int)
      • For each (Integer A) from 1 to int, do (Actions)
        • Loop - Actions
          • Set Temp_Point = (Random point in (Wood_Spawn <gen>))
          • Unit - Create 1 [your creep] for Neutral Hostile at Temp_Point facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_Temp_Point)
This isn't complete because I don't quite understand what you mean by:

3) I need to pick the creeps available for combat from a WoodCreeps Group
3a) One random creep selection (from the group) for each Creep.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Explaining:

I mean, I added a bunch of units to "WoodCreeps" in the Map Init. Bears, Wolves, etc...
If the Hero is in "Wood Group", And the Battle is in a WoodTheme, I want to spawn "WoodCreeps"

If the system sets that 3 creeps will be spawned, I want to make a random pick for each one of them, from the units in the WoodCreep group.

Example:
1 Wolf, 1 Bear, 1 Stag / instead of / 3 Wolves, or 3 Bears, or 3 Stags.

I want to prevent what I said in the main post:
PD: I tried to do this before, but all the creeps spawned at the same point, and they were all of the same type.
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
If I understand you correctly, you will need to add each type of your creep to a unit-type variable at map initialization. Example:

  • Set WoodCreeps[1] = Wolf
  • Set WoodCreeps[2] = Bear
  • Set WoodCreeps[3] = Stag
Also, where do you want to spawn these creeps?

Still not sure what you mean by

One random creep selection (from the group) for each Creep
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Oh... me neither. I don't know why I said that xD

Ok, what you say about including the creeps into the WoodCreeps array seems fine to me. I think that's the solution.

How would be the complete system?

If three creeps are selected for spawned, there has to be a random spawn point (inside the CreepSpawn region) for creep1, creep2, creep 3. And each one of these creeps would have to be a random number inside WoodCreep[Index]
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
Okay! I think I understand now :smile:

  • Trigger
    • Events
    • Conditions
    • Actions
      • Set int = ((Number of units in Wood_Combat) x 2)
      • Set int = (Random integer number between 1 and int)
      • For each (Integer A) from 1 to int, do (Actions)
        • Loop - Actions
          • Set Temp_Point = (Random point in (CreepSpawn <gen>))
          • Unit - Create 1 WoodCreeps[(Random integer number between 1 and 10)] for Neutral Hostile at Temp_Point facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_Temp_Point)


Note:
Change 10 (in "Create 1 WoodCreeps[(Random integer number between 1 and 10)]) to how many creep types you have in the variable array. If you have wolf, bear and stag in the variable array, change 10 to 3.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Great! Now my dumbness takes place:

There must be a better way to do this:
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set RandomPointInMap = (Random point in (Playable map area))
      • Unit - Create 1 Rabbit (Black Spider) for Neutral Hostile at RandomPointInMap facing Default building facing degrees
      • Set WoodCreeps[1] = (Last created unit)
      • Unit - Remove (Last created unit) from the game
      • Unit - Create 1 Raccoon (Black Spider) for Neutral Hostile at RandomPointInMap facing Default building facing degrees
      • Set WoodCreeps[2] = (Last created unit)
      • Unit - Remove (Last created unit) from the game
      • Unit - Create 1 Rat (Black Spider) for Neutral Hostile at RandomPointInMap facing Default building facing degrees
      • Set WoodCreeps[3] = (Last created unit)
  • Etc...
This would remove the lag when the unit is first created... but I guess there's a better way to add about 300 units to Unit Arrays xD... :p
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
  • Map Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
    • Set WoodCreeps[1] = Rabbit (Black Spider)
    • Set WoodCreeps[2] = Raccoon (Black Spider)
    • Set WoodCreeps[3] = Rat (Black Spider)
    • Set WoodCreeps[4] = Fox (Black Spider)
    • Set WoodCreeps[5] = Pig (Black Spider)
    • -------- And so on... --------
Remember, WoodCreeps is a Unit-Type array!
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Lol xD

So... this is it? (Edited the First Post)

Another thing: I made a region that covers all the combat areas. I'd like to change the music of the player who has a unit in combat to "Doom" as long as the unit remains in the area, and change it again to Human2 when unit leaves the area... Any idea about that?

And how do I create boundaries around each combat area to prevent units from blinking out of the region, or casting outside it? (They are one next to the other, separed by 2 squared of water)
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
  • Play Special Music
    • Events
      • Unit - A unit enters [your combat area]
    • Conditions
    • Actions
      • Custom script: if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
      • Sound - Play Doom <gen>
      • Custom script: endif
  • Stop Special Music
    • Events
      • Unit - A unit leaves [your combat area]
    • Conditions
    • Actions
      • Custom script: if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
      • Sound - Stop Last played music Immediately
      • Custom script: endif
I don't know much about music, I never fiddle with it. Someone else will have to help you :smile:
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Ok. No problem. That music lasts 1 Minute. That's more than enough to "feel" like you're in a battle :p

What about the terrain bundaries?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I forgot one important thing of the system: Removing creeps/items left behind.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of units in (Units in WoodEscape <gen>)) Equal to (Number of units in WoodCombat)
    • Then - Actions
      • Unit Group - Pick every unit in (Units in WoodCombat <gen> matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • Cinematic - Fade out over 0.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Unit - Move (Picked unit) instantly to Temp_HeroPos[(Player number of (Owner of (Picked unit)))]
          • Cinematic - Fade in over 1.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Custom script: call RemoveLocation(udg_Temp_HeroPos[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
          • Unit Group - Remove (Picked unit) from WoodCombat
          • Unit Group - Add (Picked unit) to Wood_Group
      • Unit Group - Pick every unit in (Units in WoodCombat <gen> owned by Neutral Hostile) and do (Actions) <- LEAK?
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Item - Pick every item in WoodCombat <gen> and do (Actions) <- LEAK?
        • Loop - Actions
          • Item - Remove (Picked item)
    • Else - Actions
How to remove those leaks?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
set bj_wantDestroyGroup = true - Will only destroy that group, and not the others?

I feel safer with this:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of units in (Units in WoodEscape <gen>)) Equal to (Number of units in WoodCombat)
    • Then - Actions
      • Unit Group - Pick every unit in (Units in WoodCombat <gen> matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • Cinematic - Fade out over 0.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Unit - Move (Picked unit) instantly to Temp_HeroPos[(Player number of (Owner of (Picked unit)))]
          • Cinematic - Fade in over 1.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Custom script: call RemoveLocation(udg_Temp_HeroPos[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
          • Unit Group - Remove (Picked unit) from WoodCombat
          • Unit Group - Add (Picked unit) to Wood_Group
      • Set WoodTemp_Group = (Units in WoodCombat <gen> owned by Neutral Hostile)
      • Unit Group - Pick every unit in WoodTemp_Group and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Custom script: call DestroyGroup(udg_WoodTemp_Group)
      • Item - Pick every item in WoodCombat <gen> and do (Actions)
        • Loop - Actions
          • Item - Remove (Picked item)
    • Else - Actions
 
Trigger leaks group a lot.
- (Number of units in (Units in WoodEscape <gen>)) leaks.
- Unit Group - Pick every unit in (Units in WoodCombat <gen> matching (((Matching unit) is A Hero) Equal to True)) and do (Actions) leaks.

I hope you set 'Temp_HeroPos[(Player number of (Owner of (Picked unit)))]' somewhere since I cant see that from that script.

Additionaly: setting the integer parameter to value of '(Player number of (Owner of (Picked unit)))' could make trigger a little smoother.

Fix the trigger with:
  • Custom script: set bj_wantDestroyGroup = true
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of units in (Units in WoodEscape <gen>)) Equal to (Number of units in WoodCombat)
    • Then - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in WoodCombat <gen> matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • Cinematic - Fade out over 0.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Custom script: set udg_i = GetPlayerId(GetOwningPlayer(GetEnumUnit()))
          • Unit - Move (Picked unit) instantly to Temp_HeroPos[i]
          • Cinematic - Fade in over 1.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Custom script: call RemoveLocation(udg_Temp_HeroPos[udg_i])
          • Unit Group - Remove (Picked unit) from WoodCombat
          • Unit Group - Add (Picked unit) to Wood_Group
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in WoodCombat <gen> owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Item - Pick every item in WoodCombat <gen> and do (Actions)
        • Loop - Actions
          • Item - Remove (Picked item)
    • Else - Actions
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213

This doesn't work. Creeps aren't removed.
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units in WoodCombat <gen> owned by Neutral Hostile) and do (Actions)
  • Loop - Actions
  • Unit - Remove (Picked unit) from the game
This works, and group leak is removed
  • Set WoodTemp_Group = (Units in WoodCombat <gen> owned by Neutral Hostile)
  • Unit Group - Pick every unit in WoodTemp_Group and do (Actions)
  • Loop - Actions
  • Unit - Remove (Picked unit) from the game
  • Custom script: call DestroyGroup(udg_WoodTemp_Group)

Spinnaker said:
I hope you set 'Temp_HeroPos[(Player number of (Owner of (Picked unit)))]' somewhere since I cant see that from that script.

It's in the trigger
  • Unit - Move (Picked unit) instantly to Temp_HeroPos[(Player number of (Owner of (Picked unit)))]
  • Custom script: call RemoveLocation(udg_Temp_HeroPos[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])


About the other things you say, I'm not sure. Seeing so much lines gets me a bit confused xD

This is the whole trigger so you see if there are leaks and help me to remove them. I made some small changes (Now Creeps and Heroes spawn in the same region, and chances are a bit moved).

Also, notice that "Wood_Group" is an static group I always need. Just like "Beach_Group" and others I Have just to add units that are inside those areas. I tested this trigger and seems to work fine, though I'm not sure if it has leaks, nor where they are :D

  • -------- Wood Group --------
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Random integer number between 1 and 100) Less than or equal to (Random integer number between 4 and 9)
      • (Number of units in (Units in WoodCombat <gen> matching (((Matching unit) is A Hero) Equal to True))) Equal to 0
    • Then - Actions
      • Unit Group - Pick every unit in Wood_Group and do (Actions)
        • Loop - Actions
          • Set Temp_HeroPos[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
          • Set Temp_RandomHeroSpawn[(Player number of (Owner of (Picked unit)))] = (Random point in WoodSpawn <gen>)
          • Camera - Lock camera target for (Owner of (Picked unit)) to (Picked unit), offset by (0.00, 0.00) using Default rotation
          • Cinematic - Fade out over 0.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Unit - Move (Picked unit) instantly to Temp_RandomHeroSpawn[(Player number of (Owner of (Picked unit)))]
          • Cinematic - Fade in over 1.00 seconds using texture White Mask and color ((Random real number between 0.00 and 100.00)%, (Random real number between 0.00 and 100.00)%, (Random real number between 0.00 and 100.00)%) with 0.00% transparency
          • Custom script: call RemoveLocation(udg_Temp_RandomHeroSpawn[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
          • Unit Group - Add (Picked unit) to WoodCombat
          • Unit Group - Remove (Picked unit) from Wood_Group
      • Set Int_WC = ((Number of units in WoodCombat) x 2)
      • Set Int_RWC = (Random integer number between 1 and Int_WC)
      • For each (Integer A) from 1 to Int_RWC, do (Actions)
        • Loop - Actions
          • Set Temp_Point[1] = (Random point in WoodSpawn <gen>)
          • Unit - Create 1 WoodCreeps[(Random integer number between 1 and 9)] for Neutral Hostile at Temp_Point[1] facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_Temp_Point[1])
    • Else - Actions
  • Custom script: set bj_wantDestroyGroup = true
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of units in (Units in WoodEscape <gen>)) Equal to (Number of units in WoodCombat)
    • Then - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in WoodCombat <gen> matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • Cinematic - Fade out over 0.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Unit - Move (Picked unit) instantly to Temp_HeroPos[(Player number of (Owner of (Picked unit)))]
          • Custom script: call RemoveLocation(udg_Temp_HeroPos[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
          • Cinematic - Fade in over 1.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Unit Group - Remove (Picked unit) from WoodCombat
          • Unit Group - Add (Picked unit) to Wood_Group
      • Set WoodTemp_Group = (Units in WoodCombat <gen> owned by Neutral Hostile)
      • Unit Group - Pick every unit in WoodTemp_Group and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Custom script: call DestroyGroup(udg_WoodTemp_Group)
      • Item - Pick every item in WoodCombat <gen> and do (Actions)
        • Loop - Actions
          • Item - Remove (Picked item)
    • Else - Actions
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Thanks! I'll do the id thing but, again:

If I use the 'set bj_wantDestroyGroup = true" the creeps aren't removed = Doesn't work. That's why I created the WoodTemp_Group =/ MAYBE... If I invert the positions...
  • Unit Group - Pick every unit in (Units in WoodCombat <gen> owned by Neutral Hostile) and do (Actions)
  • Loop - Actions
  • Unit - Remove (Picked unit) from the game
  • Custom script: set bj_wantDestroyGroup = true
Instead of
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units in WoodCombat <gen> owned by Neutral Hostile) and do (Actions)
  • Loop - Actions
  • Unit - Remove (Picked unit) from the game
But I don't know...

EDIT: JassHelper report: -
set udg_i=GetPlayerId(GetOwningPlayer(GetEnumUnit)) = Undeclared variable GetEnumUnit / Undeclared variable udg_i

EDIT: Its: GetPlayerId(GetOwningPlayer)(GetEnumUnit())) / udg_i remains undeclared.
EDIT: Created Interger Variable 'i' and it's done...

EDIT: Added some more leaks with the Floating Text xD I would reaaaaaally love to know how to solve all of them xD

  • Combat System
    • Events
      • Time - Every 1.20 seconds of game time
    • Conditions
    • Actions
      • -------- Wood Group --------
      • Floating Text - Create floating text that reads (Creeps Left: + (|cfffff700 + ((String((Number of units in (Units in WoodCombat <gen> matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) is in (Units owned by Neutral Hostile)) Equal to True)))))) + |r))) at (Center of WoodSpawn <gen>) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 1.20 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to (Random integer number between 4 and 9)
          • (Number of units in (Units in WoodCombat <gen> matching (((Matching unit) is A Hero) Equal to True))) Equal to 0
        • Then - Actions
          • Unit Group - Pick every unit in Wood_Group and do (Actions)
            • Loop - Actions
              • Set Temp_HeroPos[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
              • Set Temp_RandomHeroSpawn[(Player number of (Owner of (Picked unit)))] = (Random point in WoodSpawn <gen>)
              • Camera - Lock camera target for (Owner of (Picked unit)) to (Picked unit), offset by (0.00, 0.00) using Default rotation
              • Cinematic - Fade out over 0.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
              • Unit - Move (Picked unit) instantly to Temp_RandomHeroSpawn[(Player number of (Owner of (Picked unit)))]
              • Cinematic - Fade in over 1.00 seconds using texture White Mask and color ((Random real number between 0.00 and 100.00)%, (Random real number between 0.00 and 100.00)%, (Random real number between 0.00 and 100.00)%) with 0.00% transparency
              • Custom script: call RemoveLocation(udg_Temp_RandomHeroSpawn[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
              • Unit Group - Add (Picked unit) to WoodCombat
              • Unit Group - Remove (Picked unit) from Wood_Group
          • Set Int_WC = ((Number of units in WoodCombat) x 2)
          • Set Int_RWC = (Random integer number between 1 and Int_WC)
          • For each (Integer A) from 1 to Int_RWC, do (Actions)
            • Loop - Actions
              • Set Temp_Point[1] = (Random point in WoodSpawn <gen>)
              • Unit - Create 1 WoodCreeps[(Random integer number between 1 and 9)] for Neutral Hostile at Temp_Point[1] facing Default building facing degrees
              • Custom script: call RemoveLocation(udg_Temp_Point[1])
        • Else - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in WoodEscape <gen>)) Equal to (Number of units in WoodCombat)
        • Then - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in WoodCombat <gen> matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
            • Loop - Actions
              • Cinematic - Fade out over 0.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
              • Custom script: set udg_i = GetPlayerId(GetOwningPlayer(GetEnumUnit()))
              • Unit - Move (Picked unit) instantly to Temp_HeroPos[i]
              • Cinematic - Fade in over 1.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
              • Custom script: call RemoveLocation(udg_Temp_HeroPos[udg_i])
              • Unit Group - Remove (Picked unit) from WoodCombat
              • Unit Group - Add (Picked unit) to Wood_Group
          • Set WoodTemp_Group = (Units in WoodCombat <gen> owned by Neutral Hostile)
          • Unit Group - Pick every unit in WoodTemp_Group and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
          • Custom script: call DestroyGroup(udg_WoodTemp_Group)
          • Item - Pick every item in WoodCombat <gen> and do (Actions)
            • Loop - Actions
              • Item - Remove (Picked item)
        • Else - Actions
      • -------- Beach Group --------
      • Floating Text - Create floating text that reads (Creeps Left: + (|cfffff700 + ((String((Number of units in (Units in BeachCombat <gen> matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) is in (Units owned by Neutral Hostile)) Equal to True)))))) + |r))) at (Center of BeachSpawn <gen>) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 1.20 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to (Random integer number between 4 and 9)
          • (Number of units in (Units in BeachCombat <gen> matching (((Matching unit) is A Hero) Equal to True))) Equal to 0
        • Then - Actions
          • Unit Group - Pick every unit in Beach_Group and do (Actions)
            • Loop - Actions
              • Set Temp_HeroPos[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
              • Set Temp_RandomHeroSpawn[(Player number of (Owner of (Picked unit)))] = (Random point in BeachSpawn <gen>)
              • Camera - Lock camera target for (Owner of (Picked unit)) to (Picked unit), offset by (0.00, 0.00) using Default rotation
              • Cinematic - Fade out over 0.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
              • Unit - Move (Picked unit) instantly to Temp_RandomHeroSpawn[(Player number of (Owner of (Picked unit)))]
              • Cinematic - Fade in over 1.00 seconds using texture White Mask and color ((Random real number between 0.00 and 100.00)%, (Random real number between 0.00 and 100.00)%, (Random real number between 0.00 and 100.00)%) with 0.00% transparency
              • Custom script: call RemoveLocation(udg_Temp_RandomHeroSpawn[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
              • Unit Group - Add (Picked unit) to BeachCombat
              • Unit Group - Remove (Picked unit) from Beach_Group
          • Set Int_BC = ((Number of units in BeachCombat) x 2)
          • Set Int_RBC = (Random integer number between 1 and Int_WC)
          • For each (Integer A) from 1 to Int_RBC, do (Actions)
            • Loop - Actions
              • Set Temp_Point[2] = (Random point in BeachSpawn <gen>)
              • Unit - Create 1 BeachCreeps[(Random integer number between 1 and 7)] for Neutral Hostile at Temp_Point[2] facing Default building facing degrees
              • Custom script: call RemoveLocation(udg_Temp_Point[2])
        • Else - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in BeachEscape <gen>)) Equal to (Number of units in BeachCombat)
        • Then - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in BeachCombat <gen> matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
            • Loop - Actions
              • Cinematic - Fade out over 0.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
              • Unit - Move (Picked unit) instantly to Temp_HeroPos[(Player number of (Owner of (Picked unit)))]
              • Custom script: call RemoveLocation(udg_Temp_HeroPos[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
              • Cinematic - Fade in over 1.00 seconds using texture White Mask and color ((Random real number between 0.00 and 100.00)%, (Random real number between 0.00 and 100.00)%, (Random real number between 0.00 and 100.00)%) with 0.00% transparency
              • Unit Group - Remove (Picked unit) from BeachCombat
              • Unit Group - Add (Picked unit) to Beach_Group
          • Set BeachTemp_Group = (Units in BeachCombat <gen> owned by Neutral Hostile)
          • Unit Group - Pick every unit in BeachTemp_Group and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
          • Custom script: call DestroyGroup(udg_BeachTemp_Group)
          • Item - Pick every item in BeachCombat <gen> and do (Actions)
            • Loop - Actions
              • Item - Remove (Picked item)
        • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top