• 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] Duel System

Status
Not open for further replies.
Level 19
Joined
Aug 31, 2008
Messages
1,780
Well I've been making a map and in this map i will put a duel system (I will post informations about my post in Map development section after this)

so let's go right away to my request (I'm in a hurry)

give me a trigger for this one

Every 15 Minutes time in the game
2 random heroes (one from team 2 and one from team 1) will be teleported in a <Selected Region>
and fight if one dies the winner will get 250 Gold and 1 Lumber.. after
that the winning hero will be teleported in a <random region> and the the unit who died will be revive at <random region>
and
if there are only one playing and has no enemies duel system will be canceled

can anyone make a trigger code for that? +rep
 
Level 4
Joined
Apr 25, 2008
Messages
75
Okay here's what I got:

  • setup
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start duel as a One-shot timer that will expire in 900.00 seconds
  • duel
    • Events
      • Time - duel expires
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Number of players in (All allies of Player 1 (Red))) Greater than or equal to 1
          • (Number of players in (All allies of Player 2 (Blue))) Greater than or equal to 1
    • Actions
      • Trigger - Turn on camera <gen>
      • Trigger - Turn on camera2 <gen>
      • Unit - Move main_hero[(Random integer number between 0 and 5)] instantly to (Center of Team 1 <gen>)
      • Unit - Move main_hero[(Random integer number between 6 and 11)] instantly to (Center of Team 2 <gen>)
  • camera
    • Events
      • Unit - A unit enters Team 1 <gen>
    • Conditions
    • Actions
      • Unit - Set life of (Entering unit) to 100.00%
      • Unit - Set mana of (Entering unit) to 100.00%
      • Camera - Pan camera for (Owner of (Entering unit)) to (Center of Team 1 <gen>) over 0.00 seconds
      • Trigger - Turn off (This trigger)
  • camera2
    • Events
      • Unit - A unit enters Team 2 <gen>
    • Conditions
    • Actions
      • Unit - Set life of (Entering unit) to 100.00%
      • Unit - Set mana of (Entering unit) to 100.00%
      • Camera - Pan camera for (Owner of (Entering unit)) to (Center of Team 2 <gen>) over 0.00 seconds
      • Trigger - Turn off (This trigger)
  • end duel
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Dying unit) is A Hero) Equal to True
          • (Arena <gen> contains (Dying unit)) Equal to True
    • Actions
      • Player - Add 250 to (Owner of (Killing unit)) Current gold
      • Player - Add 1 to (Owner of (Killing unit)) Current lumber
      • Hero - Instantly revive (Dying unit) at (Random point in Town <gen>), Show revival graphics
      • Unit - Move (Killing unit) instantly to (Random point in Town <gen>)
      • Countdown Timer - Start duel as a One-shot timer that will expire in 900.00 seconds
Okay, now I'm assuming you set everyone's hero to a variable so change, main_hero to that variable. I also assumed (proabably inccorectly) that it's a 12 (6v6) player map. Change the random number generated in "duel" to match the team numbers. Also change the condition so that Red becomes the main person on team 1 and Blue becomes main person on team 2.

camera and camera2 are Initially Off.

Arena is the Arena
Town is some place outside
Team 1 is left side of arena (where duelist for Team 1 spawns)
Team 2 is right side of arena (where duelist for Team 2 spawns)

You can make this look much better by adding texts and all but I put it together real quick.

Also: THIS PROBABLY LEAKS!!! I'M HOPELESS WITH LEAKS SO MAKE SURE YOU REMOVE THEM!!!!
 
Level 19
Joined
Aug 31, 2008
Messages
1,780
Ok i have some questions

camera
Events
Unit - A unit enters Team 1 <gen>
Conditions
Actions
Unit - Set life of (Entering unit) to 100.00%
Unit - Set mana of (Entering unit) to 100.00%
Camera - Pan camera for (Owner of (Entering unit)) to (Center of Team 1 <gen>) over 0.00 seconds
Trigger - Turn off (This trigger)
camera2
Events
Unit - A unit enters Team 2 <gen>
Conditions
Actions
Unit - Set life of (Entering unit) to 100.00%
Unit - Set mana of (Entering unit) to 100.00%
Camera - Pan camera for (Owner of (Entering unit)) to (Center of Team 2 <gen>) over 0.00 seconds
Trigger - Turn off (This trigger)

1. How will this work?
2. Is Camera needed in a duel system?

and..

1.What are the variables i should make? or none?
2.Can you please point out what will i change to change the place where 2 people will duel
3.can you please point out what will i change to change the reviving place of a killed unit?

thanks
 
Level 4
Joined
Apr 25, 2008
Messages
75
-The camera triggers just pan the camera (screen) to the arena.

-Make a variable called "duel_timer" or something like that and set it to type "Timer". In the trigger "setup" make the action:
  • Countdown Timer - Start YOUR VARIABLE as a One-shot timer that will expire in 900.00 seconds
-Make a variable called "main_hero" or something like that. Make the type "Unit" and Tick "Array" and set the Array (the little number next to it) to the number of players in your map (INCLUDING COMPUTERS) minus 1. (Because 0 counts as a number).
Then in the trigger "duel" change the last 2 actions to:
  • Unit - Move main_hero[(Random integer number between -PLAYER NUMBER OF 1st PERSON ON TEAM 1 (eg. RED)- and -PLAYER NUMBER OF LAST PERSON ON TEAM 1 (eg. ORANGE)-)] instantly to (Center of Team 1 <gen>)
  • Unit - Move main_hero[(Random integer number between -PLAYER NUMBER OF 1st PERSON ON TEAM 1 (eg. GREEN)- and -PLAYER NUMBER OF LAST PERSON ON TEAM 2 (eg. BROWN)-)] instantly to (Center of Team 2 <gen>)
So suppose team 1 was:(First Person) RED, BLUE, TEAL, PURPLE, ORANGE. (Last Person)
and team 2 was:(First) GREEN, PINK, GREY, LIGHT BLUE, DARK GREEN, BROWN. (Last)
Leave it like is. Otherwise change the number to corrosponding player:
Red = 0
Blue = 1
Teal = 2
etc
Brown = 11

The region "Arena <gen>" is the arena itself (The place where they duel) (make the region a tiny bit bigger than the arena).
"Team 1 <gen>" is where the fighter for Team 1 will spawn in the arena (put this region in the arena)
"Team 2 <gen>" is where the fighter for Team 2 will spawn in the arena (put this region in the arena)

In the "end duel" trigger make the 3rd last and 2nd last actions:
  • Hero - Instantly revive (Dying unit) at <THIS IS WHERE THEY REVIVE>, Show revival graphics
  • Unit - Move (Killing unit) instantly to <WINNER IS TELEPORTED HERE>
In the "duel" trigger make the conditions:
  • Conditions
    • (Number of players in (All allies of Player 1 (Red))) Greater than or equal to 1 <<<---MAKE THE FIRST PLAYER OF TEAM 1 (see above)
    • (Number of players in (All allies of Player 2 (Blue))) Greater than or equal to 1<<<---MAKE THE FIRST PLAYER OF TEAM 2 (see above)
 
Level 19
Joined
Aug 31, 2008
Messages
1,780
I already started copying

first problem came..

(Number of players in (All allies of Player 1 (Red))) Greater than or equal to 1
(Number of players in (All allies of Player 2 (Blue))) Greater than or equal to 1
how to do that?
i can only do this
(Player number of Player 1 (Red)) Greater than or equal to 1
(Player number of Player 2 (Blue)) Greater than or equal to 1
 
Level 4
Joined
Apr 25, 2008
Messages
75
I already started copying

first problem came..


how to do that?
i can only do this
(Player number of Player 1 (Red)) Greater than or equal to 1
(Player number of Player 2 (Blue)) Greater than or equal to 1

Integer Comparison -> Player - Count Players in Player Group -> Allies of Player

What this condition does is check if there is 1 or more person(s) in Team 1 (anyone who is an ally of Red must be on his team).

Sorry for slow reply, went out for a haircut.
 
Status
Not open for further replies.
Top