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

Why this doesn't work?

Status
Not open for further replies.
Level 2
Joined
Dec 29, 2008
Messages
18
Hi :) I would like to seek help in some triggers for 3v3 duel where 6 heros fight against each other in 3 different places.Where 2 heros fight in an area.
There are 4 triggers for the duel but,the triggers only randomly selects 4 heros only and places them randomly between the three areas i specified in the trigger.Here are the triggers.
  • Duel Timers
  • Events:
    • Time - Elapsed game time is 0.00 seconds
  • Conditions:
  • Actions:
    • Countdown Timer - Start Duel_Timer as a One-shot timer that will expire in 300.00 seconds
    • Countdown Timer - Create a timer window for Duel_Timer with title Duel in
    • Countdown Timer - Show (Last created timer window)
    • Countdown Timer - Change the color of the title for (Last created timer window) for (Last created timer window) to (0.00%, 60.00%, 70.00%) with 40.00% transparency
  • Duel_Start
  • Events:
    • Time - Duel_Timer expires
  • Conditions:
  • Actions:
    • Set Player_Group[1] = (All allies of Player 1 (Red))
    • Set Player_Group[2] = (All allies of Player 7 (Green))
    • Set Duel_Unit_Group[1] = (Random 1 units from (Units owned by (Random player from Player_Group[1] matching (((Matching unit) is A Hero) Equal to True)))
    • Set Duel_Unit[1] = (Random 1 units from Duel_Unit_Group[1])
    • Set Duel_Unit_Group[2] = (Random 1 units from (Units owned by (Random player from Player_Group[1] matching (((Matching unit) is A Hero) Equal to True))) and ((Matching unit) Not equal to Duel_Unit[1]))))
    • Set Duel_Unit[2] = (Random 1 units from Duel_Unit_Group[2])
    • Set Duel_Unit_Group[3] = (Random 1 units from (Units owned by (Random player from Player_Group[1] matching (((Matching unit Not equal to Duel_Unit[2]))(((Matching unit) is A Hero) Equal to True))) and ((Matching unit) Not equal to Duel_Unit[1]))))
    • Set Duel_Unit_Group[4] = (Random 1 units from (Units owned by (Random player from Player_Group[2] matching (((Matching unit) is A Hero) Equal to True)))
    • Set Duel_Unit[3] = (Random unit from Duel_Unit_Group[4])
    • Set Duel_Unit_Group[5] = (Random 1 units from (Units owned by (Random player from Player_Group[2] matching (((Matching unit) is A Hero) Equal to True))) and ((Matching unit) Not Equal to Duel_Unit(3))))
    • Set Duel_Unit[4] = (Random unit from Duel_Unit_Group[5])
    • Set Duel_Unit_Group[6] = (Random 1 units from (Units owned by (Random player from Player_Group[2] matching (((Matching unit) is A Hero) Equal to True))) and ((Matching unit) Not Equal to Duel_Unit(3)))) and ((Matching unit) Not equal to Duel_Unit(4))))
    • Set Duel_Point_Leak[1] = (Center of Duel Region 1 <gen>)
    • Set Duel_Point_Leak[2] = (Center of Duel Region 2 <gen>)
    • Set Duel_Point_Leak[3] = (Center of Duel Region 4 <gen>)
    • Set Duel_Point_Leak[4] = (Center of Duel Region 5 <gen>)
    • Set Duel_Point_Leak[5] = (Center of Duel Region 7 <gen>)
    • Set Duel_Point_Leak[6] = (Center of Duel Region 8 <gen>)
    • Set Duel_Point_Leak[7] = (Center of After Duel 1 <gen>)
    • Set Duel_Point_Leak[8] = (Center of After Duel 2 <gen>)
    • Unit Group - Pick every unit in Duel_Unit_Group[1] and do (Actions)
      • Loop - Actions
        • Unit - Move (Picked unit) instantly to Duel_Point_Leak[1]
        • Unit Group - Add (Picked unit) to Duel_Group[1]
    • Unit Group - Pick every unit in Duel_Unit_Group[2] and do (Actions)
      • Loop - Actions
        • Move (Picked unit) instantly to Duel_Point_Leak[3]
        • Unit Group - Add (Picked unit) to Duel_Group[1]
    • Unit Group - Pick every unit in Duel_Unit_Group[3] and do (Actions)
      • Loop - Actions
        • Unit - Move (Picked unit) instantly to Duel_Point_Leak[5]
        • Unit Group - Add (Picked unit) to Duel_Group[1]
    • Unit Group - Pick every unit in Duel_Unit_Group[4] and do (Actions)
      • Loop - Actions
        • Unit - Move (Picked unit) instantly to Duel_Point_Leak[2]
        • Unit Group - Add (Picked unit) to Duel_Group[2]
    • Unit Group - Pick every unit in Duel_Unit_Group[5] and do (Actions)
      • Loop - Actions
        • Unit - Move (Picked unit) instantly to Duel_Point_Leak[4]
        • Unit Group - Add (Picked unit) to Duel_Group[2]
    • Unit Group - Pick every unit in Duel_Unit_Group[6] and do (Actions)
      • Loop - Actions
        • Unit - Move (Picked unit) instantly to Duel_Point_Leak[6]
        • Unit Group - Add (Picked unit) to Duel_Group[2]
    • Trigger - Turn on Duel End <gen>
    • Custom script: call RemoveLocation( udg_Duel_Point_Leak[1] )
    • Custom script: call RemoveLocation( udg_Duel_Point_Leak[2] )
    • Custom script: call RemoveLocation( udg_Duel_Point_Leak[3] )
    • Custom script: call RemoveLocation( udg_Duel_Point_Leak[4] )
    • Custom script: call RemoveLocation( udg_Duel_Point_Leak[5] )
    • Custom script: call RemoveLocation( udg_Duel_Point_Leak[6] )
    • Custom script: call DestroyGroup( udg_Duel_Unit_Group[1] )
    • Custom script: call DestroyGroup( udg_Duel_Unit_Group[2] )
    • Custom script: call DestroyGroup( udg_Duel_Unit_Group[3] )
    • Custom script: call DestroyGroup( udg_Duel_Unit_Group[4] )
    • Custom script: call DestroyGroup( udg_Duel_Unit_Group[5] )
    • Custom script: call DestroyGroup( udg_Duel_Unit_Group[6] )
    • Custom script: call DestroyForce(udg_Player_Group[1] )
    • Custom script: call DestroyForce(udg_Player_Group[2] )
    • Set Duel_Unit[1] = No unit
    • Set Duel_Unit[2] = No unit
    • Set Duel_Unit[3] = No unit
    • Set Duel_Unit[4] = No unit
  • Duel Hero
  • Events:
    • Unit - A unit Dies
  • Conditions
    • ((Dying unit) is A Hero) Equal to True
    • Or - Any (Conditions) are True
      • Conditions:
        • (Duel Region 3 <gen> contains (Dying unit) Equal to True
        • (Duel Region 6 <gen> contains (Dying unit) Equal to True
        • (Duel Region 9 <gen> contains (Dying unit) Equal to True
  • Actions:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Dying unit) belongs to an ally of Player 1 (Red)) Equal to True
    • Then - Actions
      • Unit Group - Remove (Dying unit) from Duel_Group[1]
    • Else - Ations
      • Unit Group - Remove (Dying unit) from Duel_Group[2]
  • Duel End (Intially Off)
  • Events:
    • Time - Every 1.00 seconds of game time
  • Conditions:
  • Actions:
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Number of units in Duel_Group[2] Less than or equal to 1
      • Then - Actions
        • Quest - Display to (All players) the Quest Completed message:Team 1 wins the duel
        • Unit Group - Pick every unit in Duel_Group[1] and do (Actions)
          • Loop - Actions
            • Unit - Move (Picked unit) instantly to Duel_Point_Leak[7])
        • Custom script: call RemoveLocation(udg_Duel_Point_Leak[7]
        • Unit Group - Remove all units from Duel_Group[1]
        • Unit Group - Remove all units from Duel_Group[2]
        • Countdown Timer - Start Duel_Timer as a One-Shot that will expire in 300.00 seconds
        • Trigger - Turn off (This trigger)
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
          • Number of units in Duel_Group[1] Less than or equal to 1
          • Then - Actions
            • Quest - Display to (All players) the Quest Completed message:Team 2 wins the duel
            • Unit Group - Pick every unit in Duel_Group[2] and do (Actions)
              • Loop - Actions
                • Unit - Move (Picked unit) instantly to Duel_Point_Leak[8])
            • Custom script: call RemoveLocation(udg_Duel_Point_Leak[8]
            • Unit Group - Remove all units from Duel_Group[1]
            • Unit Group - Remove all units from Duel_Group[2]
            • Countdown Timer - Start Duel_Timer as a One-Shot that will expire in 300.00 seconds
        • Trigger - Turn off (This trigger)
 
Level 6
Joined
Sep 13, 2008
Messages
261
Isufficient data to tell why this doesn't work. We need to know how may heros each player in the group has and how many players are allies of player 1 and 7.

Also the
  • Set Duel_Unit[x]
triggers seems unnecessary though I'm not sure if you use it somewhere I don't see.

If you will upload the map or supply this data you will have a better chance of someone helping you.
 
Level 6
Joined
Jul 22, 2008
Messages
243
One thing could be that you have made your variable arrays with too few "spaces"

Example;

Your Player_Group[1] and Player_Group[2] - The variable is probably declared like an array with 2 "spaces"

Now, then it should be Player_Group[0] and Player_Group[1]

As, arrays start on zero, not at 1. Try this and post if this doesn't help ya.
 
Level 6
Joined
Jul 25, 2005
Messages
221
Isufficient data to tell why this doesn't work. We need to know how may heros each player in the group has and how many players are allies of player 1 and 7.

Also the
  • Set Duel_Unit[x]
triggers seems unnecessary though I'm not sure if you use it somewhere I don't see.

If you will upload the map or supply this data you will have a better chance of someone helping you.

Agreed, you should try and make it easier on the eyes :eekani:
 
Level 9
Joined
Nov 4, 2007
Messages
931
To me it seems like your using too many unit group variables than you need to, I could see doing your Duel Start trigger in a much more efficient way, but I have a very hard time figuring out your global variables.
 
Level 2
Joined
Dec 29, 2008
Messages
18
I tried changing the variable arrays to start from 0.But it still doesn't work.I did the Duel_Unit[X] so that I could make sure the picked unit wasn't a unit that was picked.
Here's the map
 

Attachments

  • Duel.w3x
    25.3 KB · Views: 39
Level 9
Joined
Nov 4, 2007
Messages
931
OK I took a look and the Duel Start trigger looks confusing as ever, it looks like you have six unit groups with one unit in each and only 4 unit variables from an array being set, which really threw me off. By the way instead of using a periodic timer Every 1.00 seconds of game time for your Duel End trigger, why not jus use the Event Generic unit dies so it runs smoother? Better yet if you do decide to use that make sure to include the condtion Unit type of dying unit is a hero for the boolean comparison.
 
Level 6
Joined
Mar 20, 2008
Messages
208
I suggest you scrap the filters, and just add/remove the units from the unit group as they die/revive
 
Last edited:
Level 2
Joined
Dec 29, 2008
Messages
18
What do you mean by scraping the filters and I had a trigger that when a unit dies,the triggering unit would be removed from the unit group.
 
Last edited:
Level 6
Joined
Mar 20, 2008
Messages
208
Put all the units into two groups

Pick one from the group
place him in the arena, then remove him from the group.

When he dies, add him back to the group.
 
Status
Not open for further replies.
Top