• 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] Duell System feedback

Status
Not open for further replies.
Hello people! :)

I need some feedback at a duel system I've created, I want to know if there's anyway I can make this more simple or in anyway better.

At the moment I think there's to much actions and that it could be done in a much easier way? It's for an AoS map.

A little about the system itself is that it's randomly selects one players hero in each team (there's two teams) and instantly moves them up to the duel area, there they fight until one of them kills eachother.

Here are the triggers I've got for my system now, it works and has no errors or issues, I just want to know if I can do this more simple or in anyway better.

Thanks!


  • Duel New System
    • Events
      • Time - Every 720.00 seconds of game time
    • Conditions
    • Actions
      • Game - Display to (All players) for 10.00 seconds the text: |cff008080Game|r: |...
      • Countdown Timer - Start DuelTimer as a One-shot timer that will expire in 180.00 seconds
      • Set DuelTimer = (Last started timer)
      • Countdown Timer - Create a timer window for DuelTimer with title Duel Ends:
      • Set DuelTimerWindow = (Last created timer window)
      • Countdown Timer - Show DuelTimerWindow
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set ReviveTimer[(Integer A)] = 0
          • Set HeroIsDead[(Integer A)] = False
          • Set temp_point = ((Player((Integer A))) start location)
          • Hero - Instantly revive Hero[(Integer A)] at temp_point, Show revival graphics
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of Hero[(Integer A)]) Equal to Pain
            • Then - Actions
              • Hero - Instantly revive Pain_FirstPerson[(Integer A)] at temp_point, Show revival graphics
              • Hero - Instantly revive Pain_SecondPerson[(Integer A)] at temp_point, Show revival graphics
              • Hero - Instantly revive Pain_ThirdPerson[(Integer A)] at temp_point, Show revival graphics
            • Else - Actions
          • Camera - Pan camera for (Player((Integer A))) to temp_point over 0.00 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of Hero[(Integer A)]) Equal to Death Dragon
            • Then - Actions
              • Animation - Change Hero[(Integer A)]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
              • Animation - Change Hero[(Integer A)]'s vertex coloring to (100.00%, 100.00%, 100.00%) with (31.00 x (Real((Level of Ghost Evasion for Hero[(Integer A)]))))% transparency
            • Else - Actions
          • Custom script: call RemoveLocation(udg_temp_point)
      • -------- ---- --------
      • Unit - Pause all units
      • -------- ---- --------
      • Trigger - Run CheckHero1 <gen> (checking conditions)
      • -------- ---- --------
      • Trigger - Run CheckHero2 <gen> (checking conditions)
      • -------- ---- --------
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set temp_point = (Center of DuellArea <gen>)
          • Camera - Pan camera for (Player((Integer A))) to temp_point over 0.00 seconds
          • Custom script: call RemoveLocation(udg_temp_point)
      • -------- ---- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • dd_duelinghero[1] Not equal to No unit
              • dd_duelinghero[2] Not equal to No unit
        • Then - Actions
          • Set Duel_Active = True
          • Trigger - Turn off SpawnUnitsSystem <gen>
          • Set temp_point = (Center of Team1DuellSpawn <gen>)
          • Unit - Move dd_duelinghero[1] instantly to temp_point
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of dd_duelinghero[1]) Equal to Pain
            • Then - Actions
              • Unit - Move Pain_FirstPerson[(Player number of (Owner of dd_duelinghero[1]))] instantly to temp_point
              • Unit - Move Pain_SecondPerson[(Player number of (Owner of dd_duelinghero[1]))] instantly to temp_point
              • Unit - Move Pain_ThirdPerson[(Player number of (Owner of dd_duelinghero[1]))] instantly to temp_point
            • Else - Actions
          • Custom script: call RemoveLocation(udg_temp_point)
          • -------- - - - --------
          • Set temp_point = (Center of Team2DuellSpawn <gen>)
          • Unit - Move dd_duelinghero[2] instantly to temp_point
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of dd_duelinghero[2]) Equal to Pain
            • Then - Actions
              • Unit - Move Pain_FirstPerson[(Player number of (Owner of dd_duelinghero[2]))] instantly to temp_point
              • Unit - Move Pain_SecondPerson[(Player number of (Owner of dd_duelinghero[2]))] instantly to temp_point
              • Unit - Move Pain_ThirdPerson[(Player number of (Owner of dd_duelinghero[2]))] instantly to temp_point
            • Else - Actions
          • Custom script: call RemoveLocation(udg_temp_point)
          • Game - Display to (All players) for 10.00 seconds the text: |cff008080Game|r: |...
          • Wait 3.00 seconds
          • For each (Integer A) from 1 to 2, do (Actions)
            • Loop - Actions
              • Unit - Remove All buffs from dd_duelinghero[(Integer A)]
              • Unit - Unpause dd_duelinghero[(Integer A)]
              • Unit - Set life of dd_duelinghero[(Integer A)] to 100.00%
              • Unit - Set mana of dd_duelinghero[(Integer A)] to 100.00%
              • Unit - Reset ability cooldowns for dd_duelinghero[(Integer A)]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of dd_duelinghero[(Integer A)]) Equal to Pain
                • Then - Actions
                  • Unit - Unpause Pain_FirstPerson[(Integer A)]
                  • Unit - Unpause Pain_SecondPerson[(Integer A)]
                  • Unit - Unpause Pain_ThirdPerson[(Integer A)]
                • Else - Actions
          • Game - Display to (All players) for 10.00 seconds the text: |cff008080Game|r: |...
        • Else - Actions
          • Game - Display to (All players) for 10.00 seconds the text: |cff008080Game|r: |...
          • Countdown Timer - Destroy DuelTimerWindow
          • Countdown Timer - Pause DuelTimer
          • Set Duel_Active = False
          • Trigger - Turn on SpawnUnitsSystem <gen>
          • -------- ---- --------
          • Unit - Unpause all units
          • -------- ---- --------
          • For each (Integer A) from 1 to 2, do (Actions)
            • Loop - Actions
              • Unit - Move dd_duelinghero[(Integer A)] instantly to dd_duelheropointbefore[(Integer A)]
          • Custom script: call RemoveLocation(udg_dd_duellheropointbefore[1])
          • Custom script: call RemoveLocation(udg_dd_duellheropointbefore[2])
          • Custom script: set udg_dd_duellinghero[1] = null
          • Custom script: set udg_dd_duellinghero[2] = null



  • CheckHero1
    • Events
    • Conditions
    • Actions
      • Set i = (Random integer number between 1 and 5)
      • Set dd_duelinghero[1] = Hero[i]
      • Set dd_duelheropointbefore[1] = (Position of Hero[i])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • dd_duelinghero[1] Equal to No unit
        • Then - Actions
          • Trigger - Run (This trigger) (checking conditions)
        • Else - Actions
  • CheckHero2
    • Events
    • Conditions
    • Actions
      • Set i = (Random integer number between 7 and 11)
      • Set dd_duelinghero[2] = Hero[i]
      • Set dd_duelheropointbefore[2] = (Position of Hero[i])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • dd_duelinghero[2] Equal to No unit
        • Then - Actions
          • Trigger - Run (This trigger) (checking conditions)
        • Else - Actions



  • DuelTimerEnds
    • Events
      • Time - DuelTimer expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy DuelTimerWindow
      • Countdown Timer - Pause DuelTimer
      • Game - Display to (All players) for 10.00 seconds the text: |cff008080Game|r: |...
      • Set Duel_Active = False
      • Unit - Move dd_duelinghero[1] instantly to dd_duelheropointbefore[1]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of dd_duelinghero[1]) Equal to Pain
        • Then - Actions
          • Unit - Move Pain_FirstPerson[(Player number of (Owner of dd_duelinghero[1]))] instantly to dd_duelheropointbefore[1]
          • Unit - Move Pain_SecondPerson[(Player number of (Owner of dd_duelinghero[1]))] instantly to dd_duelheropointbefore[1]
          • Unit - Move Pain_ThirdPerson[(Player number of (Owner of dd_duelinghero[1]))] instantly to dd_duelheropointbefore[1]
        • Else - Actions
      • Unit - Move dd_duelinghero[2] instantly to dd_duelheropointbefore[2]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of dd_duelinghero[2]) Equal to Pain
        • Then - Actions
          • Unit - Move Pain_FirstPerson[(Player number of (Owner of dd_duelinghero[2]))] instantly to dd_duelheropointbefore[2]
          • Unit - Move Pain_SecondPerson[(Player number of (Owner of dd_duelinghero[2]))] instantly to dd_duelheropointbefore[2]
          • Unit - Move Pain_ThirdPerson[(Player number of (Owner of dd_duelinghero[2]))] instantly to dd_duelheropointbefore[2]
        • Else - Actions
      • Custom script: call RemoveLocation(udg_dd_duellheropointbefore[1])
      • Custom script: call RemoveLocation(udg_dd_duellheropointbefore[2])
      • Custom script: set udg_dd_duellinghero[1] = null
      • Custom script: set udg_dd_duellinghero[2] = null
      • Trigger - Turn on SpawnUnitsSystem <gen>
      • Unit - Unpause all units



  • WinTheDuel
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to dd_duelinghero[1]
          • (Triggering unit) Equal to dd_duelinghero[2]
    • Actions
      • Set Duel_Active = False
      • Game - Display to (All players) for 10.00 seconds the text: (|cff008080Game|r: + (Color[(Player number of (Owner of (Killing unit)))] + (PlayerName[(Player number of (Owner of (Killing unit)))] + |cffFF8000won the duell!|r (|cffffcc00+200 gold|r (|cffffcc00+100 gold/teammate|r)))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to dd_duelinghero[1]
        • Then - Actions
          • For each (Integer A) from 7 to 11, do (Actions)
            • Loop - Actions
              • Player - Add 100 to (Player((Integer A))) Current gold
          • Player - Add 100 to (Owner of (Killing unit)) Current gold
          • Unit - Move dd_duelinghero[2] instantly to dd_duelheropointbefore[2]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to dd_duelinghero[2]
        • Then - Actions
          • For each (Integer A) from 1 to 5, do (Actions)
            • Loop - Actions
              • Player - Add 100 to (Player((Integer A))) Current gold
          • Player - Add 100 to (Owner of (Killing unit)) Current gold
          • Unit - Move dd_duelinghero[1] instantly to dd_duelheropointbefore[1]
        • Else - Actions
      • Custom script: call RemoveLocation(udg_dd_duellheropointbefore[1])
      • Custom script: call RemoveLocation(udg_dd_duellheropointbefore[2])
      • Custom script: set udg_dd_duellinghero[1] = null
      • Custom script: set udg_dd_duellinghero[2] = null
      • Countdown Timer - Pause DuelTimer
      • Countdown Timer - Destroy DuelTimerWindow
      • -------- // Unpause all Units --------
      • Trigger - Turn on SpawnUnitsSystem <gen>
      • Unit - Unpause all units


Just a notice, I think I'll recreate this hero: "Pain". Recreate all systems this hero uses and make him require less actions, but that will I change after time.
 
Last edited:
Level 19
Joined
Feb 25, 2009
Messages
2,004
  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
    • Loop - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Unit-type of (Picked unit)) Not equal to Random Recipe (Shop)
    • Then - Actions
    • Unit - Unpause (Picked unit)
    • Else - Actions
Change this with
  • Unit - Pause all units
 
  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
    • Loop - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Unit-type of (Picked unit)) Not equal to Random Recipe (Shop)
    • Then - Actions
    • Unit - Unpause (Picked unit)
    • Else - Actions
Change this with
  • Unit - Pause all units

Hm, how could I've missed that action? Thanks, now it's a little smaller GUI code, but still I need to know if there's anyway to make it even simplier! :)

+rep


*Updating first post*
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
  • Set i = (Random integer number between 1 and 5)
    • Set dd_duelinghero[1] = Hero[i]
    • Set dd_duelheropointbefore[1] = (Position of Hero[i])
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • dd_duelinghero[1] Equal to No unit
    • Then - Actions
    • Trigger - Run (This trigger) (checking conditions)
    • Else - Actions
You could use a For each Integer A for a fast loop, so the "i" integer won't return same value twice.
It would be
  • For each (Integer A) from 1 to 5 do (Actions)
    • Set dd_duelinghero[1] = Hero[Integer A]
    • Set dd_duelheropointbefore[1] = (Position of Hero[Integer A])
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • dd_duelinghero[1] Equal to No unit
    • Then - Actions
    • - Any actions
    • Else - Actions
With this it should loop faster and preventing the integer to return the same value.
For 3/5 trigger use "For each (Integer A) from 7 to 11 do (Actions)" using Integer A as a array value, or Integer B to prevent overriting the Integer A.

  • Unit - Reset ability cooldowns for dd_duelinghero[(Integer A)]
This will be realy unfair here... I can use my lets say, 200 second cooldown to kill someone before the duel and in the deul I will have it again .. Also you are missing the "Unit - Unpause all units" in the Duel Trigger 1/5.

EDIT: Im going back to sleep.
 
  • Set i = (Random integer number between 1 and 5)
    • Set dd_duelinghero[1] = Hero[i]
    • Set dd_duelheropointbefore[1] = (Position of Hero[i])
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • dd_duelinghero[1] Equal to No unit
    • Then - Actions
    • Trigger - Run (This trigger) (checking conditions)
    • Else - Actions
You could use a For each Integer A for a fast loop, so the "i" integer won't return same value twice.
It would be
  • For loop (Integer A) from 1 to 5 do (Actions)
    • Set dd_duelinghero[1] = Hero[Integer A]
    • Set dd_duelheropointbefore[1] = (Position of Hero[Integer A])
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • dd_duelinghero[1] Equal to No unit
    • Then - Actions
    • - Any actions
    • Else - Actions

Yeah, but it's one problem with that. The arrays will always be 5, because the loop always wants to reach 5 in this case and then the variables arrays will be 5. :)
 
*bump*

  • [trigger]Unit - Reset ability cooldowns for dd_duelinghero[(Integer A)]
This will be realy unfair here... I can use my lets say, 200 second cooldown to kill someone before the duel and in the deul I will have it again .. Also you are missing the "Unit - Unpause all units" in the Duel Trigger 1/5.

EDIT: Im going back to sleep.

Hm, didn't see that edit, but overall, I'll leave it in that way, because else may the duel be unfair, if a hero haven't used any of his spells and got no cooldown and if the other hero has used all his spells and got cooldowns. :)


And I think someone more than you want to take a look at this, and I appreciate your help so far. :]
 
Status
Not open for further replies.
Top