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

Changing forces mid-game.

Status
Not open for further replies.
Level 1
Joined
Mar 21, 2017
Messages
3
I am working on a map where four players together fight their way through a level. When the end boss is killed, though, the killing player shifts team and the game becomes about that player versus the rest.
Now, here is the problem: I simply don't know how to do such a thing with triggers. I've played a bit around with the 'set alliance'-trigger as shown below, but it didn't do anything.

Player Group - Pick every player in (All players) and do (Player - Make (Owner of (Killing unit)) treat (Picked player) as an Enemy)
Player Group - Make (All enemies of (Owner of (Killing unit))) treat (All enemies of (Owner of (Killing unit))) as an Ally with shared vision

I'd love to get some help with this from you map-maker-veterans! ;D
 
What I'm thinking of is:

  • Player Group - Pick every player in (All Players) and do (Actions)
    • set <player_var> = (PickedPlayer)
      • Player Group - Pick every player in (All Players) and do (Actions)
        • if (All Conditions are true) then
          • if
            • (PickedPlayer) != <player_var> equal to true
          • then
            • Player Group - Make (PickedPlayer) treat <player_var> as an Enemy
          • else
          • endif
        • endif
  • set <player_var> = null
This was written in plain text from scratch..
 
Level 1
Joined
Mar 21, 2017
Messages
3
Thank you very much for your answer, though I couldn't get it to work. The players' units were still yellow for each other, indicating they were still allies.
After trying your soloution I tried doing the same thing again, just without variables. It looked like this:

Player Group - Pick every player in (All players matching ((Matching player) Not equal to (Owner of (Killing unit)))) and do (Actions)
Loop - Actions
Player - Make (Owner of (Killing unit)) treat (Picked player) as an Enemy
Player - Make (Picked player) treat (Owner of (Killing unit)) as an Enemy

How it'd work in my mind, was where the all the players not killing the final boss would get picked and then made enemies of the player who did the kill and vice versa, but that didn't work either. You shouldn't have any other possible solotions? :)
 
Thank you very much for your answer, though I couldn't get it to work. The players' units were still yellow for each other, indicating they were still allies.
After trying your soloution I tried doing the same thing again, just without variables. It looked like this:

Player Group - Pick every player in (All players matching ((Matching player) Not equal to (Owner of (Killing unit)))) and do (Actions)
Loop - Actions
Player - Make (Owner of (Killing unit)) treat (Picked player) as an Enemy
Player - Make (Picked player) treat (Owner of (Killing unit)) as an Enemy

How it'd work in my mind, was where the all the players not killing the final boss would get picked and then made enemies of the player who did the kill and vice versa, but that didn't work either. You shouldn't have any other possible solotions? :)

Is it okay if I could see your map? I'll check my approach and see...
 
Level 1
Joined
Mar 21, 2017
Messages
3
Yes, I can upload it! :)
(oh and while you're at it, can you also see if you can fix my custom wisps not being able to gather lumber from trees??)
 

Attachments

  • WorldEditTestMap.w3x
    37.3 KB · Views: 30
Status
Not open for further replies.
Top