Need help with duel trigger

emphh

Active Member
Reaction score
0
Trigger:
  • Untitled Trigger 010
    • Events
      • Time - Duel expires
    • Conditions
    • Actions
      • Set team1[(Team number of Player 1 (Red))] = (Units in (Playable map area) matching (((Matching unit) belongs to an ally of Player 1 (Red)) Equal to True))
      • Set team2[(Team number of Player 5 (Yellow))] = (Units in (Playable map area) matching (((Matching unit) belongs to an ally of Player 5 (Yellow)) Equal to True))
      • Set random = (Random unit from team1[0])
      • Unit - Move random instantly to (Center of arena1 <gen>), facing Default building facing degrees
      • Unit Group - Remove random from team1[0]
      • Set random = (Random unit from team2[0])
      • Unit - Move random instantly to (Center of arena2 <gen>), facing Default building facing degrees
      • Unit Group - Remove random from team2[0]




So basically that's my trigger. I didn't expect it to work when I made it and ofc it didn't work. I'm just wondering what have gotten wrong.
What I want the trigger to do is to take 1 random hero from each team and make them duel each other in the arena. The other players that don't get to duel will have their hero spectating the duel and when its over they will be ported back to their original position.

I "know" I did something wrong with the
"Set team1[(Team number of Player 1 (Red))]......" so maybe that could be the only problem hopefully



"Duel" is my timer to countdown to the duels btw.




And this trigger which I think should be working but I could use a second opinion.


Trigger:
  • Untitled Trigger 011
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Killing unit) is A Hero) Equal to True
      • (Number of units in (Units in arena <gen>)) Equal to 1
    • Actions
      • Wait 5.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Killing unit) is in team1[0]) Equal to True
        • Then - Actions
          • Unit - Move (Killing unit) instantly to (Center of spawn 1 <gen>)
        • Else - Actions
          • Unit - Move (Killing unit) instantly to (Center of spawn 2 <gen>)
      • Countdown Timer - Start Duel as a One-shot timer that will expire in 30.00 seconds
 

Joccaren

You can change this now in User CP.
Reaction score
54
Welcome to The Helper!!!!

Please use WC3 tags from no on when posting triggers, they make the triggers easier to read. To use WC3 tags, enter you trigger editer, right click the white page icon at the top of your trigger and select 'copy as text'.
Then, come to your post, left click once the WC3 tags icon (The Yellow a) and paste your trigger-as-text between the tags.
Trigger:
  • This is what WC3 tags look like in the Helper
    • Much Easier to read


For your problem, yes. I believe the Team1(Team number of (Player 1 (Red)))is incorrect. Change that to 0 and it should work.

Your second trigger seems to be fine though.
 

emphh

Active Member
Reaction score
0
do you mean like this?
Trigger:
  • Untitled Trigger 010
    • Events
      • Time - Duel expires
    • Conditions
    • Actions
      • Set team1[0] = (Units in (Playable map area) matching (((Matching unit) belongs to an ally of Player 1 (Red)) Equal to True))
      • Set team2[0] = (Units in (Playable map area) matching (((Matching unit) belongs to an ally of Player 5 (Yellow)) Equal to True))
      • Set random = (Random unit from team1[0])
      • Unit - Move random instantly to (Center of arena1 <gen>), facing Default building facing degrees
      • Unit Group - Remove random from team1[0]
      • Set random = (Random unit from team2[0])
      • Unit - Move random instantly to (Center of arena2 <gen>), facing Default building facing degrees
      • Unit Group - Remove random from team2[0]


because that didn't work
 

Joccaren

You can change this now in User CP.
Reaction score
54
Try this Trigger:
Trigger:
  • GetRandomUnit
    • Events
      • Time - Duel expires
    • Conditions
    • Actions
      • Unit - Move (Random unit from (Units in (Playable map area) matching (((Owner of (Matching unit)) is an ally of Player 1 (Red)) Equal to True))) instantly to (Center of (Playable map area))
      • Unit - Move (Random unit from (Units in (Playable map area) matching (((Owner of (Matching unit)) is an ally of Player 5 (Yellow)) Equal to True))) instantly to (Center of (Playable map area))
 

Bloodydood

New Member
Reaction score
14
Click Here to learn about memory leaks.

Gimmie a sec to get the triggers made

[EDIT]
Variables:
Duel_Timer - Timer
Duel_TimerWindow - Timer Window
Temp_Group - Unit Group
Temp_Point - Point
Hero - Unit Array (Size: 2)

Trigger:
  • Test Duel
    • Events
      • Time - Duel_Timer expires
    • Conditions
    • Actions
      • Set Temp_Group = (Units in (Playable map area) matching (((Owner of (Matching unit)) is an ally of Player 1 (Red)) Equal to True))
      • Set Hero[1] = (Random unit from Temp_Group)
      • Countdown Timer - Destroy Duel_TimerWindow
      • Set Temp_Point = (Center of (Playable map area))
      • Unit - Move Hero[1] instantly to Temp_Point
      • Custom script: call RemoveLocation(udg_Temp_Point)
      • Custom script: call DestroyGroup(udg_Temp_Group)
      • Set Temp_Group = (Units in (Playable map area) matching (((Owner of (Matching unit)) is an ally of Player 2 (Blue)) Equal to True))
      • Set Hero[2] = (Random unit from Temp_Group)
      • Set Temp_Point = (Center of (Playable map area))
      • Unit - Move Hero[2] instantly to Temp_Point
      • Custom script: call RemoveLocation(udg_Temp_Point)
      • Custom script: call DestroyGroup(udg_Temp_Group)
      • Trigger - Turn on Test Duel Result <gen>

Trigger:
  • Test Duel Result (Initially Off)
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to Hero[1]
          • (Triggering unit) Equal to Hero[2]
    • Actions
      • Trigger - Turn off (This trigger)
      • Countdown Timer - Create a timer window for Duel_Timer with title Next Duel
      • Set Duel_TimerWindow = (Last created timer window)
      • Countdown Timer - Start Duel_Timer as a One-shot timer that will expire in 300.00 seconds
      • Countdown Timer - Show Duel_TimerWindow


That'd be my basic idea using a timer
 

emphh

Active Member
Reaction score
0
Set Temp_Group = (Units in (Playable map area) matching (((Owner of (Matching unit)) is an ally of Player 1 (Red)) Equal to True))


i cant seem to find how to make that because when i get to
Set Temp_Group = (Units in (Playable map area) matching (((Owner of (Matching unit))
i dont know how to make them an ally of player red.

heres how i do it step by step.
Set variable
Set temp_group = value
and then i click value and do Units in region matching condition.
Units in (playable map area) matching condition
and then im stuck.

what should the matching condition be? a player comparison? if so how do you go from there to set Ally of of player 1 blablabla?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Then you click "Condition", and then "Boolean Comparison".
Then you look for something like "Player - Player Is An Ally Of Player" or something :D
 

emphh

Active Member
Reaction score
0
alright it looks like this now
Trigger:
  • Untitled Trigger 010
    • Events
      • Time - Duel expires
    • Conditions
    • Actions
      • Set temp_group = (Units in (Playable map area) matching (((Matching unit) belongs to an ally of Player 1 (Red)) Equal to True))
      • Set hero[1] = (Random unit from temp_group)
      • Countdown Timer - Destroy duel_window
      • Set temp_point = (Center of arena1 <gen>)
      • Unit - Move hero[1] instantly to temp_point
      • Custom script: call RemoveLocation(udg_temp_point)
      • Custom script: call DestroyGroup(udg_temp_group)
      • Set temp_group = (Units in (Playable map area) matching (((Matching unit) belongs to an ally of Player 5 (Yellow)) Equal to True))
      • Set hero[2] = (Random unit from temp_group)
      • Set temp_point = (Center of arena2 <gen>)
      • Unit - Move hero[2] instantly to temp_point
      • Custom script: call RemoveLocation(udg_temp_point)
      • Custom script: call DestroyGroup(udg_temp_group)
      • Trigger - Turn on Untitled Trigger 011 <gen>


It teleports units to the arena but it teleports all kinds of units, it teleports neutral passives and friendly computers, how do i edit it so it only teleports heroes?
 

jackall

You can change this now in User CP.
Reaction score
37
Trigger:
  • Set temp_group = (Units in (Playable map area) matching (((Matching unit) belongs to an ally of Player 1 (Red)) Equal to True))
make it an and, and use the
Trigger:
  • Matching unit is a hero Equal to True
 

Komaqtion

You can change this now in User CP.
Reaction score
469
You'll need to modify the unit-groups a bit ;)

Your first one should look like this:
Trigger:
  • Set temp_group = (Units in (Playable map area) matching ((((Owner of (Matching unit)) is an ally of Player 1 (Red)) Equal to True) and (((Matching unit) is A Hero) Equal to True)))


To make it look like that, you have to use the line called "And" (When you've clicked the red "Condition"), which lets you pick 2 conditions instead of one...

So, in one of them you put the ally check, and in the other one you use "Boolean Comparison", and then use the line "Unit - Unit Classification Check", and then change "Triggering unit" to "Matching unit" and "A structure" to "A Hero" ;)
 

Bloodydood

New Member
Reaction score
14
You'll need to modify the unit-groups a bit ;)

Your first one should look like this:
Trigger:
  • Set temp_group = (Units in (Playable map area) matching ((((Owner of (Matching unit)) is an ally of Player 1 (Red)) Equal to True) and (((Matching unit) is A Hero) Equal to True)))


To make it look like that, you have to use the line called "And" (When you've clicked the red "Condition"), which lets you pick 2 conditions instead of one...

So, in one of them you put the ally check, and in the other one you use "Boolean Comparison", and then use the line "Unit - Unit Classification Check", and then change "Triggering unit" to "Matching unit" and "A structure" to "A Hero" ;)

Was about to change the trigger for that...

Well I'll do it anyways :D

Trigger:
  • Test Duel
    • Events
      • Time - Duel_Timer expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy Duel_TimerWindow
      • Set temp_group = (Units in (Playable map area) matching ((((Owner of (Matching unit)) is an ally of Player 1 (Red)) Equal to True) and (((Matching unit) is A Hero) Equal to True)))
      • Set Hero[1] = (Random unit from Temp_Group)
      • Set Temp_Point = (Center of (Playable map area))
      • Unit - Move Hero[1] instantly to Temp_Point
      • Custom script: call RemoveLocation(udg_Temp_Point)
      • Custom script: call DestroyGroup(udg_Temp_Group)
      • Set temp_group = (Units in (Playable map area) matching ((((Owner of (Matching unit)) is an ally of Player 2 (Blue)) Equal to True) and (((Matching unit) is A Hero) Equal to True)))
      • Set Hero[2] = (Random unit from Temp_Group)
      • Set Temp_Point = (Center of (Playable map area))
      • Unit - Move Hero[2] instantly to Temp_Point
      • Custom script: call RemoveLocation(udg_Temp_Point)
      • Custom script: call DestroyGroup(udg_Temp_Group)
      • Trigger - Turn on Test Duel Result <gen>

Trigger:
  • Test Duel Result (Initially Off)
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to Hero[1]
          • (Triggering unit) Equal to Hero[2]
    • Actions
      • Trigger - Turn off (This trigger)
      • Countdown Timer - Create a timer window for Duel_Timer with title Next Duel
      • Set Duel_TimerWindow = (Last created timer window)
      • Countdown Timer - Start Duel_Timer as a One-shot timer that will expire in 300.00 seconds
      • Countdown Timer - Show Duel_TimerWindow
      • Set Temp_Point = (Center of Team 1 Base <gen>)
      • Unit - Move Hero[1] instantly to Temp_Point
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is dead) Equal to True
          • (Triggering unit) Equal to Hero[1]
        • Then - Actions
          • Hero - Instantly revive (Triggering unit) at Temp_Point, Show revival graphics
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Temp_Point)
      • Set Temp_Point = (Center of Team 2 Base <gen>)
      • Unit - Move Hero[2] instantly to Temp_Point
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is dead) Equal to True
          • (Triggering unit) Equal to Hero[2]
        • Then - Actions
          • Hero - Instantly revive (Triggering unit) at Temp_Point, Show revival graphics
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Temp_Point)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top