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

[Trigger] Help fix Unsummon trigger..

Status
Not open for further replies.
Level 6
Joined
Jan 2, 2015
Messages
171
Hey guys, i made summon/unsummon pet system for my map which already works for 1 type of summon ( I have fire, water, earth, and wind). Fire, Water, Earth summon spells are work fine except my Wind spells which is special because it comes with 3 spirit. First, i have 1 summon wind spirit spell which will summon trio spirit. My problem is in unsummon part or dead spirit. Example, if 1 of 3 wind spirit or 2 of 3 wind spirit dies. I want whenever i resummon wind spirit again they will only summon surviving spirit instead resummon 3 spirit again. I tested my trigger, when i let 1 of 3 wind spirit died then tried to use summon wind spirit spell..all 3 wind spirit appear again along with 2 surviving wind spirits..How do i fix this??

Here is my trigger, I made 6 wind summon triggers, 6 wind unsummon triggers, 1 dead triggers. I made 6 triggers to make sure games check every conditions for example (A dead, B Alive, C Alive or A dead, B dead, C Alive) so i assume this 6 triggers as 6 different cases on whoever died or still alive.

So at first, i made 2 value for Summon Trigger which is dead (value 0) and alive (value 1). I set all 3 wind spirit variable to value 1 on Initialization trigger. And i set Life Value for each three wind spirit base on their object data (Example: Valkyr HP at object editor is 4200 so i set Life Value of Valkyr at 4200 on Initialization. I made this Life Value variable to ensure the summon dont dead on first time casting it. Another reason to make this Life Value was to save current wind spirit HP data before we re-summon the wind spirit again with same current life.

Here i will post 6 trigger of summon and unsummon, 1 initialization and 1 dead summon. I also attach test map(spirit name and health value is different because i copied this trigger from my main map). Thanks guys. I appreciate any help

Summon Trigger (just ignore Turn Off Dead Summon because its for fire water wind..we focus on wind)

Initialization

  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ValkyrHp = 3400.00
      • Set ValkyrHp_Copy = 3400.00
      • Set ValkyrHp_Copy_2 = 4200.00
      • Set ValkyrLife = 1.00
      • Set ValkyrLife_Copy = 1.00
      • Set ValkyrLife_Copy_2 = 1.00
  • Summoning Initial
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Summon Wind Spirit
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Summon[(Player number of (Owner of (Casting unit)))] Equal to False
              • ValkyrLife Equal to 1.00
              • ValkyrLife_Copy Equal to 1.00
              • ValkyrLife_Copy_2 Equal to 1.00
            • Then - Actions
              • Trigger - Turn off Dead Summon <gen>
              • Trigger - Turn on Dead Summon Wind <gen>
              • Set Place = (Position of (Casting unit))
              • Set Player[(Player number of (Owner of (Casting unit)))] = (Owner of (Casting unit))
              • Set Summon[(Player number of (Owner of (Casting unit)))] = True
              • Unit - Create 1 Dark Vakyr for Player[(Player number of (Owner of (Casting unit)))] at (Place offset by (Random real number between 200.00 and 500.00) towards (Random angle) degrees) facing Default building facing degrees
              • Unit - Set life of (Last created unit) to ValkyrHp
              • Set MonsterUnit[(Player number of (Owner of (Casting unit)))] = (Last created unit)
              • Set TempValkyr = (Last created unit)
              • Unit - Create 1 White Vakyr for Player[(Player number of (Owner of (Casting unit)))] at (Place offset by (Random real number between 200.00 and 500.00) towards (Random angle) degrees) facing Default building facing degrees
              • Unit - Set life of (Last created unit) to ValkyrHp_Copy
              • Set MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] = (Last created unit)
              • Set TempValkyr_Copy = (Last created unit)
              • Unit - Create 1 Valkyrie for Player[(Player number of (Owner of (Casting unit)))] at (Place offset by (Random real number between 200.00 and 500.00) towards (Random angle) degrees) facing Default building facing degrees
              • Unit - Set life of (Last created unit) to ValkyrHp_Copy_2
              • Set MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] = (Last created unit)
              • Set TempValkyr_Copy_2 = (Last created unit)
              • Custom script: call RemoveLocation(udg_Place)
            • Else - Actions
              • Game - Display to (Player group((Owner of (Casting unit)))) the text: Your spirit is alre...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Summon Wind Spirit
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Summon[(Player number of (Owner of (Casting unit)))] Equal to False
              • ValkyrLife Equal to 0.00
              • ValkyrLife_Copy Equal to 1.00
              • ValkyrLife_Copy_2 Equal to 1.00
            • Then - Actions
              • Trigger - Turn off Dead Summon <gen>
              • Trigger - Turn on Dead Summon Wind <gen>
              • Set Place = (Position of (Casting unit))
              • Set Player[(Player number of (Owner of (Casting unit)))] = (Owner of (Casting unit))
              • Set Summon[(Player number of (Owner of (Casting unit)))] = True
              • Unit - Create 1 White Vakyr for Player[(Player number of (Owner of (Casting unit)))] at (Place offset by (Random real number between 200.00 and 500.00) towards (Random angle) degrees) facing Default building facing degrees
              • Unit - Set life of (Last created unit) to ValkyrHp_Copy
              • Set MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] = (Last created unit)
              • Set TempValkyr_Copy = (Last created unit)
              • Unit - Create 1 Valkyrie for Player[(Player number of (Owner of (Casting unit)))] at (Place offset by (Random real number between 200.00 and 500.00) towards (Random angle) degrees) facing Default building facing degrees
              • Unit - Set life of (Last created unit) to ValkyrHp_Copy_2
              • Set MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] = (Last created unit)
              • Set TempValkyr_Copy_2 = (Last created unit)
              • Custom script: call RemoveLocation(udg_Place)
            • Else - Actions
              • Game - Display to (Player group((Owner of (Casting unit)))) the text: Your spirit is alre...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Summon Wind Spirit
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Summon[(Player number of (Owner of (Casting unit)))] Equal to False
              • ValkyrLife Equal to 1.00
              • ValkyrLife_Copy Equal to 0.00
              • ValkyrLife_Copy_2 Equal to 0.00
            • Then - Actions
              • Trigger - Turn off Dead Summon <gen>
              • Trigger - Turn on Dead Summon Wind <gen>
              • Set Place = (Position of (Casting unit))
              • Set Player[(Player number of (Owner of (Casting unit)))] = (Owner of (Casting unit))
              • Set Summon[(Player number of (Owner of (Casting unit)))] = True
              • Unit - Create 1 Dark Vakyr for Player[(Player number of (Owner of (Casting unit)))] at (Place offset by (Random real number between 200.00 and 500.00) towards (Random angle) degrees) facing Default building facing degrees
              • Unit - Set life of (Last created unit) to ValkyrHp
              • Set MonsterUnit[(Player number of (Owner of (Casting unit)))] = (Last created unit)
              • Set TempValkyr = (Last created unit)
              • Custom script: call RemoveLocation(udg_Place)
            • Else - Actions
              • Game - Display to (Player group((Owner of (Casting unit)))) the text: Your spirit is alre...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Summon Wind Spirit
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Summon[(Player number of (Owner of (Casting unit)))] Equal to False
              • ValkyrLife Equal to 0.00
              • ValkyrLife_Copy Equal to 0.00
              • ValkyrLife_Copy_2 Equal to 1.00
            • Then - Actions
              • Trigger - Turn off Dead Summon <gen>
              • Trigger - Turn on Dead Summon Wind <gen>
              • Set Place = (Position of (Casting unit))
              • Set Player[(Player number of (Owner of (Casting unit)))] = (Owner of (Casting unit))
              • Set Summon[(Player number of (Owner of (Casting unit)))] = True
              • Unit - Create 1 Valkyrie for Player[(Player number of (Owner of (Casting unit)))] at (Place offset by (Random real number between 200.00 and 500.00) towards (Random angle) degrees) facing Default building facing degrees
              • Unit - Set life of (Last created unit) to ValkyrHp_Copy_2
              • Set MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] = (Last created unit)
              • Set TempValkyr_Copy_2 = (Last created unit)
              • Custom script: call RemoveLocation(udg_Place)
            • Else - Actions
              • Game - Display to (Player group((Owner of (Casting unit)))) the text: Your spirit is alre...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Summon Wind Spirit
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Summon[(Player number of (Owner of (Casting unit)))] Equal to False
              • ValkyrLife Equal to 1.00
              • ValkyrLife_Copy Equal to 0.00
              • ValkyrLife_Copy_2 Equal to 1.00
            • Then - Actions
              • Trigger - Turn off Dead Summon <gen>
              • Trigger - Turn on Dead Summon Wind <gen>
              • Set Place = (Position of (Casting unit))
              • Set Player[(Player number of (Owner of (Casting unit)))] = (Owner of (Casting unit))
              • Set Summon[(Player number of (Owner of (Casting unit)))] = True
              • Unit - Create 1 Dark Vakyr for Player[(Player number of (Owner of (Casting unit)))] at (Place offset by (Random real number between 200.00 and 500.00) towards (Random angle) degrees) facing Default building facing degrees
              • Unit - Set life of (Last created unit) to ValkyrHp
              • Set MonsterUnit[(Player number of (Owner of (Casting unit)))] = (Last created unit)
              • Set TempValkyr = (Last created unit)
              • Unit - Create 1 Valkyrie for Player[(Player number of (Owner of (Casting unit)))] at (Place offset by (Random real number between 200.00 and 500.00) towards (Random angle) degrees) facing Default building facing degrees
              • Unit - Set life of (Last created unit) to ValkyrHp_Copy_2
              • Set MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] = (Last created unit)
              • Set TempValkyr_Copy_2 = (Last created unit)
              • Custom script: call RemoveLocation(udg_Place)
            • Else - Actions
              • Game - Display to (Player group((Owner of (Casting unit)))) the text: Your spirit is alre...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Summon Wind Spirit
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Summon[(Player number of (Owner of (Casting unit)))] Equal to False
              • ValkyrLife Equal to 0.00
              • ValkyrLife_Copy Equal to 1.00
              • ValkyrLife_Copy_2 Equal to 0.00
            • Then - Actions
              • Trigger - Turn off Dead Summon <gen>
              • Trigger - Turn on Dead Summon Wind <gen>
              • Set Place = (Position of (Casting unit))
              • Set Player[(Player number of (Owner of (Casting unit)))] = (Owner of (Casting unit))
              • Set Summon[(Player number of (Owner of (Casting unit)))] = True
              • Unit - Create 1 White Vakyr for Player[(Player number of (Owner of (Casting unit)))] at (Place offset by (Random real number between 200.00 and 500.00) towards (Random angle) degrees) facing Default building facing degrees
              • Unit - Set life of (Last created unit) to ValkyrHp_Copy
              • Set MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] = (Last created unit)
              • Set TempValkyr_Copy = (Last created unit)
              • Custom script: call RemoveLocation(udg_Place)
            • Else - Actions
              • Game - Display to (Player group((Owner of (Casting unit)))) the text: Your spirit is alre...
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Summon Wind Spirit
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Summon[(Player number of (Owner of (Casting unit)))] Equal to False
              • ValkyrLife Equal to 1.00
              • ValkyrLife_Copy Equal to 1.00
              • ValkyrLife_Copy_2 Equal to 0.00
            • Then - Actions
              • Trigger - Turn off Dead Summon <gen>
              • Trigger - Turn on Dead Summon Wind <gen>
              • Set Place = (Position of (Casting unit))
              • Set Player[(Player number of (Owner of (Casting unit)))] = (Owner of (Casting unit))
              • Set Summon[(Player number of (Owner of (Casting unit)))] = True
              • Unit - Create 1 Dark Vakyr for Player[(Player number of (Owner of (Casting unit)))] at (Place offset by (Random real number between 200.00 and 500.00) towards (Random angle) degrees) facing Default building facing degrees
              • Unit - Set life of (Last created unit) to ValkyrHp
              • Set MonsterUnit[(Player number of (Owner of (Casting unit)))] = (Last created unit)
              • Set TempValkyr = (Last created unit)
              • Unit - Create 1 White Vakyr for Player[(Player number of (Owner of (Casting unit)))] at (Place offset by (Random real number between 200.00 and 500.00) towards (Random angle) degrees) facing Default building facing degrees
              • Unit - Set life of (Last created unit) to ValkyrHp_Copy
              • Set MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] = (Last created unit)
              • Set TempValkyr_Copy = (Last created unit)
              • Custom script: call RemoveLocation(udg_Place)
            • Else - Actions
              • Game - Display to (Player group((Owner of (Casting unit)))) the text: Your spirit is alre...
        • Else - Actions
Unsummon Trigger

  • Unsummon Wind
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Unsummon
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Summon[(Player number of (Owner of (Casting unit)))] Equal to True
          • (MonsterUnit[(Player number of (Owner of (Casting unit)))] is alive) Equal to True
          • (MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] is alive) Equal to True
          • (MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] is alive) Equal to True
        • Then - Actions
          • Set ValkyrHp = (Life of TempValkyr)
          • Set ValkyrHp_Copy = (Life of TempValkyr_Copy)
          • Set ValkyrHp_Copy_2 = (Life of TempValkyr_Copy_2)
          • Set ValkyrLife = 1.00
          • Set ValkyrLife_Copy = 1.00
          • Set ValkyrLife_Copy_2 = 1.00
          • Unit - Remove MonsterUnit[(Player number of (Owner of (Casting unit)))] from the game
          • Unit - Remove MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] from the game
          • Unit - Remove MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] from the game
          • Set Summon[(Player number of (Owner of (Casting unit)))] = False
          • Set MonsterUnit[(Player number of (Owner of (Casting unit)))] = No unit
          • Set MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] = No unit
          • Set MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] = No unit
          • Trigger - Turn on Dead Summon <gen>
          • Trigger - Turn off Dead Summon Wind <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Summon[(Player number of (Owner of (Casting unit)))] Equal to True
          • (MonsterUnit[(Player number of (Owner of (Casting unit)))] is alive) Equal to False
          • (MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] is alive) Equal to True
          • (MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] is alive) Equal to True
        • Then - Actions
          • Set ValkyrHp_Copy = (Life of TempValkyr_Copy)
          • Set ValkyrHp_Copy_2 = (Life of TempValkyr_Copy_2)
          • Set ValkyrLife = 0.00
          • Set ValkyrLife_Copy = 1.00
          • Set ValkyrLife_Copy_2 = 1.00
          • Unit - Remove MonsterUnit[(Player number of (Owner of (Casting unit)))] from the game
          • Unit - Remove MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] from the game
          • Unit - Remove MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] from the game
          • Set Summon[(Player number of (Owner of (Casting unit)))] = False
          • Set MonsterUnit[(Player number of (Owner of (Casting unit)))] = No unit
          • Set MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] = No unit
          • Set MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] = No unit
          • Trigger - Turn on Dead Summon <gen>
          • Trigger - Turn off Dead Summon Wind <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Summon[(Player number of (Owner of (Casting unit)))] Equal to True
          • (MonsterUnit[(Player number of (Owner of (Casting unit)))] is alive) Equal to True
          • (MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] is alive) Equal to False
          • (MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] is alive) Equal to True
        • Then - Actions
          • Set ValkyrHp = (Life of TempValkyr)
          • Set ValkyrHp_Copy_2 = (Life of TempValkyr_Copy_2)
          • Set ValkyrLife = 1.00
          • Set ValkyrLife_Copy = 0.00
          • Set ValkyrLife_Copy_2 = 1.00
          • Unit - Remove MonsterUnit[(Player number of (Owner of (Casting unit)))] from the game
          • Unit - Remove MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] from the game
          • Unit - Remove MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] from the game
          • Set Summon[(Player number of (Owner of (Casting unit)))] = False
          • Set MonsterUnit[(Player number of (Owner of (Casting unit)))] = No unit
          • Set MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] = No unit
          • Set MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] = No unit
          • Trigger - Turn on Dead Summon <gen>
          • Trigger - Turn off Dead Summon Wind <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Summon[(Player number of (Owner of (Casting unit)))] Equal to True
          • (MonsterUnit[(Player number of (Owner of (Casting unit)))] is alive) Equal to True
          • (MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] is alive) Equal to True
          • (MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] is alive) Equal to False
        • Then - Actions
          • Set ValkyrHp = (Life of TempValkyr)
          • Set ValkyrHp_Copy = (Life of TempValkyr_Copy)
          • Set ValkyrLife = 1.00
          • Set ValkyrLife_Copy = 1.00
          • Set ValkyrLife_Copy_2 = 0.00
          • Unit - Remove MonsterUnit[(Player number of (Owner of (Casting unit)))] from the game
          • Unit - Remove MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] from the game
          • Unit - Remove MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] from the game
          • Set Summon[(Player number of (Owner of (Casting unit)))] = False
          • Set MonsterUnit[(Player number of (Owner of (Casting unit)))] = No unit
          • Set MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] = No unit
          • Set MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] = No unit
          • Trigger - Turn on Dead Summon <gen>
          • Trigger - Turn off Dead Summon Wind <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Summon[(Player number of (Owner of (Casting unit)))] Equal to True
          • (MonsterUnit[(Player number of (Owner of (Casting unit)))] is alive) Equal to False
          • (MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] is alive) Equal to False
          • (MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] is alive) Equal to True
        • Then - Actions
          • Set ValkyrHp_Copy_2 = (Life of TempValkyr_Copy_2)
          • Set ValkyrLife = 0.00
          • Set ValkyrLife_Copy = 0.00
          • Set ValkyrLife_Copy_2 = 1.00
          • Unit - Remove MonsterUnit[(Player number of (Owner of (Casting unit)))] from the game
          • Unit - Remove MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] from the game
          • Unit - Remove MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] from the game
          • Set Summon[(Player number of (Owner of (Casting unit)))] = False
          • Set MonsterUnit[(Player number of (Owner of (Casting unit)))] = No unit
          • Set MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] = No unit
          • Set MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] = No unit
          • Trigger - Turn on Dead Summon <gen>
          • Trigger - Turn off Dead Summon Wind <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Summon[(Player number of (Owner of (Casting unit)))] Equal to True
          • (MonsterUnit[(Player number of (Owner of (Casting unit)))] is alive) Equal to False
          • (MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] is alive) Equal to True
          • (MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] is alive) Equal to False
        • Then - Actions
          • Set ValkyrHp_Copy = (Life of TempValkyr_Copy)
          • Set ValkyrLife = 0.00
          • Set ValkyrLife_Copy = 1.00
          • Set ValkyrLife_Copy_2 = 0.00
          • Unit - Remove MonsterUnit[(Player number of (Owner of (Casting unit)))] from the game
          • Unit - Remove MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] from the game
          • Unit - Remove MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] from the game
          • Set Summon[(Player number of (Owner of (Casting unit)))] = False
          • Set MonsterUnit[(Player number of (Owner of (Casting unit)))] = No unit
          • Set MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] = No unit
          • Set MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] = No unit
          • Trigger - Turn on Dead Summon <gen>
          • Trigger - Turn off Dead Summon Wind <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Summon[(Player number of (Owner of (Casting unit)))] Equal to True
          • (MonsterUnit[(Player number of (Owner of (Casting unit)))] is alive) Equal to True
          • (MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] is alive) Equal to False
          • (MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] is alive) Equal to False
        • Then - Actions
          • Set ValkyrHp_Copy = (Life of TempValkyr)
          • Set ValkyrLife = 1.00
          • Set ValkyrLife_Copy = 0.00
          • Set ValkyrLife_Copy_2 = 0.00
          • Unit - Remove MonsterUnit[(Player number of (Owner of (Casting unit)))] from the game
          • Unit - Remove MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] from the game
          • Unit - Remove MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] from the game
          • Set Summon[(Player number of (Owner of (Casting unit)))] = False
          • Set MonsterUnit[(Player number of (Owner of (Casting unit)))] = No unit
          • Set MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] = No unit
          • Set MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] = No unit
          • Trigger - Turn on Dead Summon <gen>
          • Trigger - Turn off Dead Summon Wind <gen>
        • Else - Actions
Dead Summon Trigger
  • Dead Summon Wind
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Dying unit) Equal to MonsterUnit[(Player number of (Owner of (Casting unit)))]
          • (Dying unit) Equal to MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))]
          • (Dying unit) Equal to MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))]
    • Actions
      • Set ValkyrLife = 1.00
      • Set ValkyrLife_Copy = 1.00
      • Set ValkyrLife_Copy_2 = 1.00
      • Set Summon[(Player number of (Owner of (Casting unit)))] = False
      • Set MonsterUnit[(Player number of (Owner of (Casting unit)))] = No unit
      • Set MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] = No unit
      • Set MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] = No unit
      • Trigger - Turn on Dead Summon <gen>
      • Trigger - Turn off Dead Summon Wind <gen>
 

Attachments

  • UnsummonTrigger.w3x
    27.8 KB · Views: 24
Level 4
Joined
Jul 26, 2016
Messages
88
[/TRIGGER]
Dead Summon Trigger
  • Dead Summon Wind
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Dying unit) Equal to MonsterUnit[(Player number of (Owner of (Casting unit)))]
          • (Dying unit) Equal to MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))]
          • (Dying unit) Equal to MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))]
    • Actions
      • Set ValkyrLife = 1.00
      • Set ValkyrLife_Copy = 1.00
      • Set ValkyrLife_Copy_2 = 1.00
      • Set Summon[(Player number of (Owner of (Casting unit)))] = False
      • Set MonsterUnit[(Player number of (Owner of (Casting unit)))] = No unit
      • Set MonsterUnit_Copy[(Player number of (Owner of (Casting unit)))] = No unit
      • Set MonsterUnit_Copy_2[(Player number of (Owner of (Casting unit)))] = No unit
      • Trigger - Turn on Dead Summon <gen>
      • Trigger - Turn off Dead Summon Wind <gen>

What is this Casting Unit you are referring to. Unit is triggering not casting.

edit: also, unsummon will not work if even one of your units from your summoned units has died. not sure if it is by design?

Yeah, you're missing a check here, when you summon a unit its corresponding valkyrlife should be set to 0, so as to avoid ressummoning it. I'm honestly not even sure if the trigger function 100% as you intended anymore, but it is slightly confusing, and i think it still functions ok this way, here I'll pass you the map.

In a bit perplexed by how you handle summon deaths. If a summon dies, then becomes unsummoned, it does not respawn later. Your call how you want to handle this. I understand you need it to function that way because you want your summon HP to be more important, so the player considers what they are doing instead of throwing the summons around, so we can't just respawn them gratuitously every time. Your call how you want the player to revive his summons (by setting the corresponding valkyrlife to 1).

TBH I don't quite understand the design choices, they seem to clash a bit in my mind.

Anyways, here's the slapdash solution I came up with. Do note there are more elegant solutions, notably using hashtables.
 

Attachments

  • UnsummonTriggerF.w3x
    27.9 KB · Views: 25
Last edited:
Level 6
Joined
Jan 2, 2015
Messages
171
What is this Casting Unit you are referring to. Unit is triggering not casting.

edit: also, unsummon will not work if even one of your units from your summoned units has died. not sure if it is by design?

Yeah, you're missing a check here, when you summon a unit its corresponding valkyrlife should be set to 0, so as to avoid ressummoning it. I'm honestly not even sure if the trigger function 100% as you intended anymore, but it is slightly confusing, and i think it still functions ok this way, here I'll pass you the map.

In a bit perplexed by how you handle summon deaths. If a summon dies, then becomes unsummoned, it does not respawn later. Your call how you want to handle this. I understand you need it to function that way because you want your summon HP to be more important, so the player considers what they are doing instead of throwing the summons around, so we can't just respawn them gratuitously every time. Your call how you want the player to revive his summons (by setting the corresponding valkyrlife to 1).

TBH I don't quite understand the design choices, they seem to clash a bit in my mind.

Anyways, here's the slapdash solution I came up with. Do note there are more elegant solutions, notably using hashtables.

Ew. This is some ugly coding, really inefficient as well.
I suggest scraping your current approach.

Hi, thanks for trying to help. To be honest, i only want my trio summon to not get all of them summoned again on next battle in case one of them dies and will only summon 2 surviving spirit until player use restoration skill. My ugly inefficient coding still works on single type spirit but not on trio one because it require some advanced editor skills. I am sure there's advanced member here who can help to solved this problem because i really cant handle it.
 
Status
Not open for further replies.
Top