• 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.

Need to clean up trigger + have unit selected

Status
Not open for further replies.
Level 14
Joined
Mar 27, 2008
Messages
1,003
So I have this trigger here.

  • Resurrect Red
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
      • (Survivor 0010 <gen> is dead) Equal to True
      • (Player 1 (Red) controller) Not equal to Computer
    • Actions
      • Unit - Remove Survivor 0010 <gen> from the game
      • Unit - Create 1 Haunted Spirit for Player 1 (Red) at (Random point in Dead Player Spirit Spawn <gen>) facing Default building facing degrees
      • Camera - Pan camera for Player 1 (Red) to (Position of (Last created unit)) over 3.00 seconds
      • Game - Display to Player Group - Player 1 (Red) the text: |cffff0000A player ...
      • Trigger - Turn off (This trigger)
Does it leak?
Also, I need to have it where the Spirit is automatically selected for the player when it spawns. (I have triggers like this for players 1 - 10 so I'm going to apply the changes to all of them.)
If anyone would help that would be great!
 
Those lines leak:
- (Random point in Dead Player Spirit Spawn <gen>)
- (Position of (Last created unit))
- Player Group - Player 1 (Red)

You need to set those to variables and remove leak manually. For example:
  • Set Loc1 = (Random point in Dead Player Spirit Spawn <gen>)
  • <...>
  • Custom script: call RemoveLocation(udg_Loc1)
And for player group:
  • Set PlayerGroup = (Player Group - Player 1 (Red))
  • <...>
  • Custom script: call DestroyForce(udg_PlayerGroup)
About selection - use Action -> Selection submenu.
  • Selection - Select (Last created unit) for Player 1 (Red)
 
Level 14
Joined
Mar 27, 2008
Messages
1,003
Those lines leak:
- (Random point in Dead Player Spirit Spawn <gen>)
- (Position of (Last created unit))
- Player Group - Player 1 (Red)

You need to set those to variables and remove leak manually. For example:
  • Set Loc1 = (Random point in Dead Player Spirit Spawn <gen>)
  • <...>
  • Custom script: call RemoveLocation(udg_Loc1)
And for player group:
  • Set PlayerGroup = (Player Group - Player 1 (Red))
  • <...>
  • Custom script: call DestroyForce(udg_PlayerGroup)
About selection - use Action -> Selection submenu.
  • Selection - Select (Last created unit) for Player 1 (Red)

Importing the fixes to my map right now! Thank you so much! + Rep
 
Status
Not open for further replies.
Top