Down System Revive Trigger Help

Uszi

New Member
Reaction score
5
Howdy.

So I'm using a "Down" system in my map. When a Player's unit dies, the unit is replaced with a neutral counterpart and is paused at it's death animation.

A teammate can then run up and revive them with a spell I've given everyone called Defibrillate.

When all teammates are down, you lose the game.

Trigger one: You die, create a neutral "corpse." This works fine.

Trigger:
  • Down
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Dying unit) Equal to PlayerUnit[(Player number of (Owner of (Dying unit)))]
    • Actions
      • Set TempUnit = (Dying unit)
      • Set TempPoint = (Position of (Dying unit))
      • Set PlayerDead = (PlayerDead + 1)
      • Set PlayerDeadBool[(Player number of (Owner of (Dying unit)))] = True
      • Set Downs[(Player number of (Owner of (Dying unit)))] = (Downs[(Player number of (Owner of (Dying unit)))] + 1)
      • -------- --------------------------------------- --------
      • Unit Group - Pick every unit in (Units owned by (Owner of TempUnit)) and do (Unit - Kill (Picked unit))
      • Visibility - Create an initially Enabled visibility modifier for (Owner of TempUnit) emitting Visibility from TempPoint to a radius of 400.00
      • Set Vis[(Player number of (Owner of (Dying unit)))] = (Last created visibility modifier)
      • Hero - Instantly revive TempUnit at TempPoint, Hide revival graphics
      • Cinematic - Ping minimap for (All players) at TempPoint for 1.00 seconds
      • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Set ExclamationPoint = (Last created special effect)
      • Game - Display to (All players) for 10.00 seconds the text: ((Name of (Owner of TempUnit)) + is down! Someone revive him!)
      • Game - Display to (Player group((Owner of TempUnit))) for 10.00 seconds the text: You have been incap...
      • Custom script: call RemoveLocation( udg_TempPoint )
      • -------- --------------------------------------- --------
      • Unit - Change ownership of TempUnit to Neutral Passive and Retain color
      • Hero - Disable experience gain for TempUnit
      • Unit - Remove All buffs from TempUnit
      • Unit - Pause TempUnit
      • Animation - Change TempUnit's vertex coloring to (75.00%, 75.00%, 75.00%) with 15.00% transparency
      • Unit - Set life of TempUnit to 1.00
      • Unit - Set mana of TempUnit to 1.00
      • Unit - Make TempUnit Invulnerable
      • Animation - Play TempUnit's death animation
      • Trigger - Run Sort Multiboard <gen> (ignoring conditions)


Now, the revive system. Here I have some bugs. Right now, reviving one player revives EVERY downed player. But the exclamation mark is only removed from the targeted player. All the other players retain their exclamation marks indefinitely.

Trigger:
  • Defibulate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Defribillator
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set TempPoint = (Position of (Triggering unit))
          • Set TempUnit = PlayerUnit[(Integer A)]
          • Special Effect - Create a special effect at (Position of TempUnit) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Destroy ExclamationPoint
          • Unit - Change ownership of TempUnit to (Player((Integer A))) and Retain color
          • Unit - Make TempUnit Vulnerable
          • Unit - Unpause TempUnit
          • Selection - Select TempUnit for (Owner of TempUnit)
          • Unit - Remove All buffs from TempUnit
          • Animation - Play TempUnit's stand animation
          • Hero - Enable experience gain for TempUnit
          • Animation - Change TempUnit's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
          • Unit - Set life of TempUnit to 70.00%
          • Unit - Set mana of TempUnit to 30.00%
          • Unit - Turn collision for TempUnit On
          • Set PlayerDead = (PlayerDead - 1)
          • Set PlayerDeadBool[(Integer A)] = False
          • Set Defibs[(Player number of (Owner of (Casting unit)))] = (Defibs[(Player number of (Owner of (Casting unit)))] + 1)
          • Visibility - Destroy Vis[(Integer A)]
      • Custom script: call RemoveLocation( udg_TempPoint )
      • Trigger - Run Sort Multiboard <gen> (ignoring conditions)


I imagine it has something to do with my Foor Loop Integer A. I don't really know how to use those very well, but I suspect it's the problem.

Finally, the defeat trigger: This trigger has some bugs too. For one reason or another, sometimes it doesn't fire. It bugged out with two players, where the game never ended. That doesn't happen all the time tough.

Trigger:
  • Defeat
    • Events
      • Time - Every 1.50 seconds of game time
    • Conditions
      • PlayerDead Equal to NumPlayersPlaying
    • Actions
      • Visibility - Destroy Vis[1]
      • Visibility - Destroy Vis[2]
      • Visibility - Destroy Vis[3]
      • Visibility - Destroy Vis[4]
      • Visibility - Destroy Vis[5]
      • Visibility - Destroy Vis[6]
      • Trigger - Turn off Periodic Run <gen>
      • Trigger - Turn off Timer <gen>
      • Cinematic - Fade out over 2.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Game - Defeat (Picked player) with the message: (Defeat! You survived until round + (String(NumRound)))


Thanks for any help!

Er, I should also mention, that I'm trying to keep track of Downs (deaths) and Defibs preformed in a multiboard.
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
>Defilibrate
Isn't that from Zomg on Gaia?

I assume the problem is that you're not storing the effect in a array for each player sorting each array by their player number.
 

Uszi

New Member
Reaction score
5
For the special effect? Should I make the variable ExclamationPoint an array 1-Max Players, and use ExclamationPoint[Int A] or ExclamationPoint[Player Number]?

Also the spell is also reviving all down players, everywhere. Which it isn't supposed to. It's supposed to only revive the player you targeted.
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Post the revive trigger, you showed the death trigger twice.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top