Duel Area

Level 1
Joined
Jun 21, 2022
Messages
45
Hi guys.
In the map I edited, the players are friendly with each other.
But is there an arrangement where I can be hostile with other players when I go to a certain part of the map, that is, when I enter that area?

Well ;
-Two friendly players
-They attack each other when they enter the area.
-So they're dueling.

Can anyone help in the form of TestMap for what I want?
 
Level 1
Joined
Jun 21, 2022
Messages
45
they automatically attack each other untill one dies in that area (kind of like the "duel" ability in dota), or just that they can fight if they want to? (like a pvp zone)
Players entering the zone should automatically attack each other. this should preferably be the one who wants to duel should enter that area.
Free pvp zone

It's a completely free zone. Anyone can enter and duel.
I hope something like this is possible :)
 

Uncle

Warcraft Moderator
Level 42
Joined
Aug 10, 2018
Messages
4,194
He wants a system where players in a specific region are hostile towards other players that are in that same region. It's a PVP zone which you see in a lot of games.

To do this, you would use the Enters/Leaves Region events to detect entering/exiting the PVP zone. Then in response to these Events you would use the Set Alliance actions to make players allies/enemies. You can use a Player Group variable to track the players that are inside/outside of the PVP region so you know who to hostile and who to remain allies with. The Pick Every Player action would be used to reference each player inside of the PVP region.
 
Level 1
Joined
Jun 21, 2022
Messages
45
He wants a system where players in a specific region are hostile towards other players that are in that same region. It's a PVP zone which you see in a lot of games.

To do this, you would use the Enters/Leaves Region events to detect entering/exiting the PVP zone. Then in response to these Events you would use the Set Alliance actions to make players allies/enemies. You can use a Player Group variable to track the players that are inside/outside of the PVP region so you know who to hostile and who to remain allies with. The Pick Every Player action would be used to reference each player inside of the PVP region.
I can't give directions because my English is not enough. On the map I edited, 1-12 players are friendly. As I said, without tunnels and teleporting on the playable map, it would be enough to go straight and have a pvp zone. I think you professionals can do it :)
 
Level 12
Joined
Mar 16, 2008
Messages
365
Uncle gave a good conceptual outline but I'm guessing you didn't understand it. Here's a starting point, it might not be perfect and need some adjustments:

1) make a region called duel area
2) make 2 player group variables, one for duelers and one for non-duelers
3) make these two triggers:
  • unit enters duel area
    • Events
      • Unit - A unit enters Duel Area Region <gen>
    • Conditions
    • Actions
      • Player Group - Add (Owner of (Entering unit)) to duel_player_group_variable
      • Player Group - Remove (Owner of (Leaving unit)) from normal_player_group_variable.
      • Player Group - Make duel_player_group_variable treat duel_player_group_variable as an Enemy
      • Player Group - Make duel_player_group_variable treat normal_player_group_variabe as an Ally
      • Player Group - Make normal_player_group_variable treat normal_player_group_variabe as an Ally with Shared Vision
  • unit leaves duel area
    • Events
      • Unit - A unit leaves Duel Area Region <gen>
    • Conditions
    • Actions
      • Player Group - Remove (Owner of (Leaving unit)) from duel_player_group_variable.
      • Player Group - Add (Owner of (Entering unit)) to normal_player_group_variable
      • Player Group - Make duel_player_group_variable treat duel_player_group_variable as an Enemy
      • Player Group - Make duel_player_group_variable treat normal_player_group_variabe as an Ally
      • Player Group - Make normal_player_group_variable treat normal_player_group_variabe as an Ally with Shared Vision
maybe add some conditions to the trigger such as "unit is a hero" idk the specifics of your map nor have i really brainstormed potential bugs with these triggers but i think this could be a good starting point like i wrote earlier.

Edit: i just read the part about being born free of charge. you could make a third trigger that does something like, if unit dies in duel area, instantly revive somewhere.
 
Last edited:
Level 1
Joined
Jun 21, 2022
Messages
45
Uncle gave a good conceptual outline but I'm guessing you didn't understand it. Here's a starting point, it might not be perfect and need some adjustments:

1) make a region called duel area
2) make 2 player group variables, one for duelers and one for non-duelers
3) make these two triggers:
  • unit enters duel area
    • Events
      • Unit - A unit enters Duel Area Region <gen>
    • Conditions
    • Actions
      • Player Group - Add (Owner of (Entering unit)) to duel_player_group_variable
      • Player Group - Remove (Owner of (Leaving unit)) from normal_player_group_variable.
      • Player Group - Make duel_player_group_variable treat duel_player_group_variable as an Enemy
      • Player Group - Make duel_player_group_variable treat normal_player_group_variabe as an Ally
      • Player Group - Make normal_player_group_variable treat normal_player_group_variabe as an Ally with Shared Vision
  • unit leaves duel area
    • Events
      • Unit - A unit leaves Duel Area Region <gen>
    • Conditions
    • Actions
      • Player Group - Remove (Owner of (Leaving unit)) from duel_player_group_variable.
      • Player Group - Add (Owner of (Entering unit)) to normal_player_group_variable
      • Player Group - Make duel_player_group_variable treat duel_player_group_variable as an Enemy
      • Player Group - Make duel_player_group_variable treat normal_player_group_variabe as an Ally
      • Player Group - Make normal_player_group_variable treat normal_player_group_variabe as an Ally with Shared Vision
maybe add some conditions to the trigger such as "unit is a hero" idk the specifics of your map nor have i really brainstormed potential bugs with these triggers but i think this could be a good starting point like i wrote earlier.

Edit: i just read the part about being born free of charge. you could make a third trigger that does something like, if unit dies in duel area, instantly revive somewhere.
Could you share it as a TestMap?
 
Level 13
Joined
Sep 28, 2011
Messages
942
It should be noted that if the players have units other than the heroes that the solution of gnuoy should be either paired with pausing the player units out of the arena or making that if they attack each other they get stunned temporarily.
Else the heroes goes to the arena then both players sees their bases destroyed by the units of their former friends.
 
Level 21
Joined
Mar 29, 2020
Messages
1,231
He wants a system where players in a specific region are hostile towards other players that are in that same region. It's a PVP zone which you see in a lot of games.

To do this, you would use the Enters/Leaves Region events to detect entering/exiting the PVP zone. Then in response to these Events you would use the Set Alliance actions to make players allies/enemies. You can use a Player Group variable to track the players that are inside/outside of the PVP region so you know who to hostile and who to remain allies with. The Pick Every Player action would be used to reference each player inside of the PVP region.
if you read his second post it seems that it's more of an auto-duel area than just a standard pvp
 
Level 21
Joined
Mar 29, 2020
Messages
1,231
lol, it seems I'm a little late to the party but I also made one. it has a normal pvp area and a forced dueling area (click the up and down arrows to try out the different areas). uncles version is probably cleaner though.

not sure why, but "triggering player" doesn't seem to trigger on the enters and exits region events. also the actions for allying and un-allying seem to only work in certain configurations. I finally got this to do what I wanted but it ended up taking a lot longer than I thought it would. gotta love our 20 year old buggy blizzard triggers...
 

Attachments

  • PvP and Dueling zones.w3m
    24.6 KB · Views: 7
Level 1
Joined
Jun 21, 2022
Messages
45
hi guys, thanks a lot for the TestMaps, but the TestMaps you sent are not opening :S
 

Attachments

  • hivez.jpg
    hivez.jpg
    86.3 KB · Views: 5
Level 28
Joined
Feb 27, 2007
Messages
4,111
Yeah that's uh... 5 major patches out of date and pre-Reforged so definitely not compatible with maps made by the editors of anyone in this thread.

In short: update. Or someone has to open them for you and post them all here for you to recreate? That's a bad solution.
 

Uncle

Warcraft Moderator
Level 42
Joined
Aug 10, 2018
Messages
4,194
Here are the triggers:
  • Enter Duel Arena
    • Events
      • Unit - A unit enters DuelArena <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set Duel_Player = (Owner of (Triggering unit))
      • Player Group - Add Duel_Player to Duel_Players
      • Player Group - Pick every player in Duel_Players and do (Actions)
        • Loop - Actions
          • Player - Make (Picked player) treat Duel_Player as an Enemy
          • Player - Make Duel_Player treat (Picked player) as an Enemy
  • Leave Duel Arena
    • Events
      • Unit - A unit leaves DuelArena <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set Duel_Player = (Owner of (Triggering unit))
      • Player Group - Pick every player in Duel_Players and do (Actions)
        • Loop - Actions
          • Player - Make (Picked player) treat Duel_Player as an Ally with shared vision
          • Player - Make Duel_Player treat (Picked player) as an Ally with shared vision
      • Player Group - Remove Duel_Player from Duel_Players.
  • Prevent Ally Attack
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) belongs to an ally of (Owner of (Attacking unit)).) Equal to True
    • Actions
      • Unit - Order (Attacking unit) to Stop.
Variables:
Duel_Player = Player
Duel_Players = Player Group
 

Uncle

Warcraft Moderator
Level 42
Joined
Aug 10, 2018
Messages
4,194
Really thank you uncle. You helped even though my version didn't fit :) Let's see if I can do it :D

As I said, all players navigate in a friendly manner on the map I have arranged.

I don't understand if there is a need for a leave_duel arena here, but I will try and give feedback :)
Shouldn't the players become allies again once they leave the arena? That's what the Leave Duel Arena trigger is for.

Anyway, I imagine those triggers will give you an idea on how to do this yourself.
 

Uncle

Warcraft Moderator
Level 42
Joined
Aug 10, 2018
Messages
4,194
I don't have a friend with whom I have experienced the map right now. Thanks again for everything :)
I think you're misunderstanding me but that's okay. My question is: What do you want to happen when the players leave the Arena? Should they still be enemies? If you don't make them allies again then they will attack each other outside of the Arena.

Also, no problem, I'm happy to help.
 
Level 1
Joined
Jun 21, 2022
Messages
45
I think you're misunderstanding me but that's okay. My question is: What do you want to happen when the players leave the Arena? Should they still be enemies? If you don't make them allies again then they will attack each other outside of the Arena.

Also, no problem, I'm happy to help.
Dear uncle, you are right about this :)
To make this system more beautiful. I wonder if the losing player dies, even if he carries the ank item in his bag, can you have it spawn free of charge? In a certain area.
 

Uncle

Warcraft Moderator
Level 42
Joined
Aug 10, 2018
Messages
4,194
Dear uncle, you are right about this :)
To make this system more beautiful. I wonder if the losing player dies, even if he carries the ank item in his bag, can you have it spawn free of charge? In a certain area.
Copy and paste the Leave Duel Arena trigger and change it's Event to -> A unit dies.

Now when a unit dies it will no longer be hostile with other players. You can then revive it elsewhere using the Instantly revive action.

Or, when a unit dies, check if it's inside of the Arena region using the Region contains unit condition. It's a Boolean comparison. If you revive it outside of the Arena that should count as it "Leaving" the region which will run the Leave Duel Arena trigger.


For Ankhs, you can use a system to detect reincarnation -> GUI Unit Event v2.5.3.0
But if you don't wish to use that system, here's the method for detecting reincarnation:

Add a hidden Defend ability to your unit(s) that can reincarnate.
Create a trigger with the Event: Issued order with no target
And this condition to it: Issued order Equal to "undefend"

This will detect when a unit dies with reincarnation. Keep in mind this could cause problems if you're using the Defend ability for other things in your map.
 
Level 12
Joined
Mar 16, 2008
Messages
365
1656449557704.png

ok fixed :xxd:

triggers are like playing with Legos, you just need to arrange them in the right order. just match the text in the trigger to the text. since you have an outline already, you just need basic recognition of the roman alphabet.

tell me your Discord and i'll direct you, if you are serious about implementing the duel area.

the other alternative would be just giving a trigger in JASS that could be copy pasted but even then you'd need to customize it to your map.
 
Last edited:
Top