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

PVP Problems

Status
Not open for further replies.
Level 2
Joined
Mar 18, 2012
Messages
7
In an RPG map I am currently working on, I want to create an arena that when walking into 'Entrance A' you are put onto one team, and when you walk into 'Entrance B' you are put on the opposite team. This is made for a dueling/arena where a group of allies can go in to pit out against eachother and have fun, but upon leaving the arena are still allies. Sadly for me this doesnt seem to want to work :vw_sad:. The problem being; said trigger does not change the alliance of said allies when they enter the arena (from different sides.)

Please Help!

  • Enter A
    • Events
      • Unit - A unit enters Arena Team 1 <gen>
    • Conditions
    • Actions
      • Player Group - Add (Owner of (Triggering unit)) to Arena_Team[1]
      • Unit - Move (Triggering unit) instantly to (Center of Arena Fight 1 <gen>)
      • Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Triggering unit)) over 1.00 seconds
      • Camera - Set (Owner of (Triggering unit))'s camera Distance to target to 4000.00 over 1.00 seconds
  • Enter B
    • Events
      • Unit - A unit enters Arena Team 2 <gen>
    • Conditions
    • Actions
      • Player Group - Add (Owner of (Triggering unit)) to Arena_Team[2]
      • Unit - Move (Triggering unit) instantly to (Center of Arena Fight 2 <gen>)
      • Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Triggering unit)) over 1.00 seconds
      • Camera - Set (Owner of (Triggering unit))'s camera Distance to target to 3500.00 over 1.00 seconds
  • Alliances
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Make Arena_Team[1] treat Arena_Team[2] as an Enemy
      • Player Group - Make Arena_Team[1] treat Arena_Team[1] as an Ally with shared vision
      • Player Group - Make Arena_Team[2] treat Arena_Team[1] as an Enemy
      • Player Group - Make Arena_Team[2] treat Arena_Team[2] as an Ally with shared vision
I havn't posted the Death/Leaving Triggers here because thats not the problem atm.
 
Last edited:
Level 2
Joined
Mar 18, 2012
Messages
7
I'm not sure if I am right or not, but I don't believe you can use indexes as player groups.
Okay thanks, do you know any other ways I could trigger this? Would very much appreciate help!
You don't have to make the alliance checking a periodic one. Just set the alliance aspects once before and after the battle.
Yeah I think I was doing it pretty rushed at the time. Thanks!
 
Level 11
Joined
Aug 6, 2009
Messages
697
You don't have to make the alliance checking a periodic one.

I think he will need this, cause if one unit enters in team 1 and no one is on team two then someone joins team 2, the person on team two will be enemies with team 1 and team 1 will still be allies with team 2.
Try this:
Entering Region
  • Untitled Trigger 002
    • Events
      • Unit - A unit enters Arena1 <gen>
      • Unit - A unit enters Arena2 <gen>
    • Conditions
    • Actions
      • Set EnteringUnit = (Triggering unit)
      • -------- This is used because you use "triggering unit" more then twice. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Arena1 <gen> contains EnteringUnit) Equal to True
        • Then - Actions
          • Unit - Move EnteringUnit instantly to (Center of ArenaPoint1 <gen>)
          • Camera - Pan camera for (Owner of EnteringUnit) to (Position of EnteringUnit) over 1.00 seconds
          • Camera - Set (Owner of EnteringUnit)'s camera Distance to target to 4000.00 over 1.00 seconds
          • Player Group - Add (Owner of EnteringUnit) to ArenaPGroup1
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Arena2 <gen> contains EnteringUnit) Equal to True
            • Then - Actions
              • Unit - Move EnteringUnit instantly to (Center of ArenaPoint2 <gen>)
              • Camera - Pan camera for (Owner of EnteringUnit) to (Position of EnteringUnit) over 1.00 seconds
              • Camera - Set (Owner of EnteringUnit)'s camera Distance to target to 4000.00 over 1.00 seconds
              • Player Group - Add (Owner of EnteringUnit) to ArenaPGroup2
            • Else - Actions
Loop:
  • loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in ArenaPGroup1 and do (Player Group - Make ArenaPGroup1 treat ArenaPGroup1 as an Ally with shared vision)
      • Player Group - Pick every player in ArenaPGroup2 and do (Player Group - Make ArenaPGroup2 treat ArenaPGroup2 as an Ally with shared vision)
      • Player Group - Pick every player in ArenaPGroup2 and do (Player Group - Make ArenaPGroup2 treat ArenaPGroup1 as an Enemy)
      • Player Group - Pick every player in ArenaPGroup1 and do (Player Group - Make ArenaPGroup1 treat ArenaPGroup2 as an Enemy)
 
Level 2
Joined
Mar 18, 2012
Messages
7
Isn't choosing team A or B must be decided before the battle starts, therefore there is no need for periodic check.
StarQuizer is correct I don't need to use periodic check to add them to teams.

Ive added in your triggers Assassins-Creed and i'll get back to you on if they work when I have another person to test it with me! (I cant exactly test alliances by myself!)
 
Level 2
Joined
Mar 18, 2012
Messages
7
No luck! I have tried your triggers Assassins' and no luck!

Would the fact that they are in the same force make a difference, they are not allied at the begginning of the game but I have a Trigger that puts them on the same team so it obviously will work.

Could it be that I use a variable?
 
Level 8
Joined
Sep 18, 2011
Messages
195
I think each time you change the player group (A or B) you should make each player in the group to treat each player in the other group as enemy and each one in the same as ally.

There are four things to do
  • Make Group A treat Group B as enemies
  • Make Group B treat Group A as enemies
  • Make Group A Players treat Group A Players as allies (except theirselves if picked)
  • Make Group B Players treat Group A Players as allies (except theirselves if picked)
 
Level 2
Joined
Mar 18, 2012
Messages
7
Use the variable perhaps? This isn't tested but it looks like it should work.
I don't understand which variable your reffering to sorry.

Let me try and make it for you.
I would very much appreciate this!

There are four things to do
Make Group A treat Group B as enemies
Make Group B treat Group A as enemies
Make Group A Players treat Group A Players as allies (except theirselves if picked)
Make Group B Players treat Group A Players as allies (except theirselves if picked)
Already done this but thanks for trying!
 
Status
Not open for further replies.
Top