• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Setting Alliances, need help!

Status
Not open for further replies.
Level 1
Joined
May 16, 2007
Messages
4
Hello,

I'm a little stuck with this...I'm trying to create a trigger that changes the alliance settings for all players but can't seem to get it to work.

I have set forces, namely: player 1 to 9 being allied, and 10 being their enemy.

Basically, a unit dying is the event, and then i check to see that it's a particular type of unit.

Actions:
Make triggering player treat player 10 as an ally.
Make player 10 treat triggering player as an ally.

Right, so that seems to work, but now i want that triggering player's initial allies to become his enemies, and for his allies to treat him as an enemy.
Essentially the player is transferring to player 10's force.

Here's what i tried:

Player group:
Make all enemies of 10 treat all allies of 10 as enemy
Make all allies of 10 treat all enemies of 10 as ally


I stick in a small wait in between these two lines and the previous ones at the top of my post, just in case the game needs some time to recognise that the triggering player is now with 10 and vice versa.

But, this part doesn't work regardless....the triggering player is allied with 10, and 10 with him but the other players still treat him as an ally, and he treats them as an ally...any help would be appreciated.
 
Level 13
Joined
Nov 4, 2006
Messages
1,239
  • Events
    • Unit - A Unit dies
  • Conditions
  • Actions
    • Playergroup - add owner of triggering Unit to team2
    • Playergroup - remove owner of triggering Unit from team1
    • Pick every Player in team1 and make picked player treat random player of team2 as an enemy
    • Pick every Player in team2 and make picked player treat random player of team1 as an enemy
just a basic idea don't know if it works, "team1" and "team2" are playergroup variables
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
What UreDe4D said is a good idea, using player groups.
I'll explain it to you a bit more.

1) Create a PlayerGroup Variable with an array. (I named it Alliance.)
Inside Alliance[1] we have: Players 1 to 9.
Inside Alliance[2] we have: Player 10.

I want you to add these to their groups first and make them treath each other allies and enemies. (Look at the trigger below.)

  • Initialization
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Player Group - Add Player 1 (Red) to Alliance[1]
      • Player Group - Add Player 2 (Blue) to Alliance[1]
      • Player Group - Add Player 3 (Teal) to Alliance[1]
      • Player Group - Add Player 4 (Purple) to Alliance[1]
      • Player Group - Add Player 5 (Yellow) to Alliance[1]
      • Player Group - Add Player 6 (Orange) to Alliance[1]
      • Player Group - Add Player 7 (Green) to Alliance[1]
      • Player Group - Add Player 8 (Pink) to Alliance[1]
      • Player Group - Add Player 9 (Gray) to Alliance[1]
      • Player Group - Add Player 10 (Light Blue) to Alliance[2]
      • Player Group - Make Alliance[1] treat Alliance[1] as an Ally with shared vision
      • Player Group - Make Alliance[2] treat Alliance[2] as an Ally with shared vision
      • Player Group - Make Alliance[1] treat Alliance[2] as an Enemy
      • Player Group - Make Alliance[2] treat Alliance[1] as an Enemy
Now you want to put people in Alliance[1] to Alliance[2] when a unit fo them dies right?
If so then add this trigger aswell.

  • Unit Dies
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Dying unit)) is in Alliance[1]) Equal to True
        • Then - Actions
          • Player Group - Remove (Owner of (Dying unit)) from Alliance[1]
          • Player Group - Add (Owner of (Dying unit)) to Alliance[2]
          • Player Group - Make Alliance[1] treat Alliance[1] as an Ally with shared vision
          • Player Group - Make Alliance[2] treat Alliance[2] as an Ally with shared vision
          • Player Group - Make Alliance[1] treat Alliance[2] as an Enemy
          • Player Group - Make Alliance[2] treat Alliance[1] as an Enemy
        • Else - Actions
This should do the trick, also I used a Boolean Condition to check if the owner was inside Alliance[1]
 
Status
Not open for further replies.
Top