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

Treat as Ally

Status
Not open for further replies.
Level 3
Joined
Apr 29, 2019
Messages
32
Hi all, I have a trigger that causes leavers to grant shared control of their units, which I assume must be fairly common. My map is only 1 person controlling 1 hero, like DotA.

Trigger: Red Leaver
Event: Player - Player 1 (Red) leaves the game
Actions: Game - Grant shared vision and full shared unit control of Player 1 (Red) units with his/her allies

-

Okay, then I have a trigger which applies when their hero dies, to send them to an arena where they can fight each other while they're bored. This makes other dead people enemies, but not living people.

Trigger: Boromir Dies
Events: Unit - Boromir 0002 <gen> Dies
Actions:
Set Variable Set BoromirDead =1
Wait 10.00 seconds
Camera - Pan camera ... blah blah
Hero - Instantly revive (Dying unit) at ... blah blah
Player Group - Add Player 1(Red) to Villains
Player Group - Remove Player 1 (Red) from Heroes
Player Group - Make Villains treat Player Group - Player 1 (Red) as an Enemy
Player Group - Make Player Group - Player 1 (Red) treat Villains as an Enemy

-

This works perfectly. The players still playing the game do not lose control of the leaver's hero. I guess because they are still in Heroes group, so nothing is being done to their allegiance.

Finally, the trigger that doesn't work. I have events which happen, which resurrects their hero. Since apparently "Make X treat X as an Ally" removes shared unit control, I am looking for the most elegant way to bring the dead unit out of the arena, make them an ally, but if they are a leaver, keep their unit as shared control.

Perhaps this impossible, and I have have to type 50 different triggers out... there are a few different spots you can resurrect, so I would have to repeat this, twice, for every hero, if I was going to make a variable for leaver status and then a conditional trigger whether they left or not... yeah it was less work by far to type this post out.

Anyway, here is the offending trigger. The map in question is the only one in my profile, Balin's Tomb Reforged.

Trigger: Boromir Respawn
Events: Destructible - Hell Cage 0160 <gen> dies
Conditions: BoromirDead Equal to 1
Actions:
Wait 3.00 seconds
Player Grou - Add Player 1 (Red) to Heroes
Player Group - Remove Player 1 (Red) from Villains
Player Group - Make Heroes treat Player Group - Player 1 (Red) as an Ally
Player Group - Make Player Group - Player 1 (Red) treat Heroes as an Ally
Camera - Pan camera ... blah blah
Unit - Move Boromir 002 <gen> instantly to ... blah blah
Hero - Instantly revive Boromir ... blah blah
Unit - Reset ability cooldown for Boromir 0002 <gen>
Unit - Set life of Boromir 0002 <gen> to 100.00%
Unit - Set mana of Boromir 002 <gen> to 100.00%
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
Perhaps this impossible, and I have have to type 50 different triggers out... there are a few different spots you can resurrect, so I would have to repeat this, twice, for every hero, if I was going to make a variable for leaver status and then a conditional trigger whether they left or not... yeah it was less work by far to type this post out.
Use a data fed system. Hold the data in arrays. Loops can be used to process arrays very efficiently. This would allow a few triggers to be used for all players.

Instead of just making the player an ally you could use conditional flow of control to make them share control if the player has left the game.
 
Level 3
Joined
Apr 29, 2019
Messages
32
Use a data fed system. Hold the data in arrays. Loops can be used to process arrays very efficiently. This would allow a few triggers to be used for all players.

Instead of just making the player an ally you could use conditional flow of control to make them share control if the player has left the game.

Hey bro, thanks for help again, do you have Discord or something where we can talk about this? I was gonna finally get around to fixing it tonight. I'm not great at loops... I know what they are but... if you don't have time I will try to do it myself too.
 
Status
Not open for further replies.
Top