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

[Trigger] Switch Team Trigger

Status
Not open for further replies.
Level 10
Joined
Jul 31, 2008
Messages
477
Helloo guys!

So im making a map. It's called demon tag, its like tree tag or camper tag or stuff like that. But when you die you become a demon. But my swap team trigger fails...

Here it is:
  • Swap Team
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Unit-type of (Dying unit)) Equal to Goblin Runner
  • Actions
    • Unit - Create 1 Voidwalker for (owner of (dying unit)) at (Center of Starting point <gen>) facing default building facing degrees
    • Set PG = (All players matching ((Number of living Goblin Runner units owned by (Owner of (Dying unit))) Equal to 0))
    • Player Group - Make PG treat (All enemies of Player 2 (Blue)) as an Enemy
    • Player Group - Make PG treat (All allies of Player 2 (Blue)) as an Ally with shared vision
    • Player Group - Make (All allies of Player 2 (Blue)) treat PG as an Ally with shared vision
    • Custom script: call DestroyForce(udg_PG)
What is wrong?
 
Level 9
Joined
Apr 14, 2007
Messages
437
I could help. I would need a copy of your map though, to make it easier. If you don't trust me, then I'll try to figure out your trigger w/o your map. Although, there is no reason not to trust me lol.

Try this for the time being:

  • Unit - Create 1 Voidwalker for (owner of (dying unit)) at (Center of Starting point <gen>) facing default building facing degrees
  • Player - Make (owner of dying unit) treat (All enemies of Player 2 (Blue)) as an Enemy
  • Player - Make (owner of dying unit) treat (All allies of Player 2 (Blue)) as an Ally with shared vision
  • Player Group - Make (All allies of Player 2 (Blue)) treat (owner of dying unit) as an Ally with shared vision
You dont need to set the player to a group. It is very unnecessary and redundant. If my method doesn't work, still keep my method but tweak it a little bit. This work for you.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,223
Set PG = (All players matching ((Number of living Goblin Runner units owned by (Owner of (Dying unit))) Equal to 0))
100% certain the fault lies with that line. Due to illogical condition, PG becomes equal to all players as the condition returns true for all players that pass throu it which happen to be all players. Thus basically you set all players to treat all enemies of blue as an enemy. You then make all palyers treat all allies of blue as an ally with vision. Finally you make all allies of blue treat all players as an ally with vision.

Seems quite logical why it does not work.
 
Level 7
Joined
Jul 20, 2008
Messages
377
You shouldn't even need a player group. I believe you can just get the player from the owner of the dying unit.
 
Level 10
Joined
Jul 31, 2008
Messages
477
Well i would do like this

Actions

Player make Owner of dying unit treat player 1 red as an enemy
(and more of these for all players who starts with goblins.
Then:
Player make owner of dying unit treat all allies of player 2 blue

But i didnt find the option, it had to be a player group to do that.
 
Level 7
Joined
Jul 20, 2008
Messages
377
  • Player Group - Add (Owner of (Dying unit)) to tempPlayerGroup
  • -------- Do your player group things here --------
  • Player Group - Remove all players from tempPlayerGroup
That should be the leak-free way to handle it.

This is assuming you don't have the action for Player - Set Alliance.
 
Level 9
Joined
Apr 14, 2007
Messages
437
Mine actually works lol. Heres mine revised for 100% leak free.

  • Set temp_loc = position of dying unit
  • Set temp_p = owner of dying unit
  • Unit - Create 1 Voidwalker for (owner of (dying unit)) at (temp_loc <gen>) facing default building facing degrees
  • Player - Make (temp_p) treat (All enemies of Player 2 (Blue)) as an Enemy
  • Player - Make (temp_p) treat (All allies of Player 2 (Blue)) as an Ally with shared vision
  • Player Group - Make (All allies of Player 2 (Blue)) treat (temp_p) as an Ally with shared vision
  • Custom script: call RemoveLocation(udg_temp_loc)
  • Custom script: call RemovePlayer(udg_temp_p)
 
Level 10
Joined
Jul 31, 2008
Messages
477
  • Player Group - Add (Owner of (Dying unit)) to tempPlayerGroup
  • -------- Do your player group things here --------
  • Player Group - Remove all players from tempPlayerGroup
That should be the leak-free way to handle it.

This is assuming you don't have the action for Player - Set Alliance.

should it be like this?

  • Player Group - Add (Owner of (Dying unit)) to tempPlayerGroup
  • Player Group - Make TempPlayerGroup treat (All allies of Player 2 (Blue)) as an Ally with shared vision
  • Player Group - Remove all players from tempPlayerGroup
 
Level 7
Joined
Jul 20, 2008
Messages
377
I think "All allies of Player 2" might leak. But yes, basically. And what about making enemies?
 
Level 10
Joined
Jul 31, 2008
Messages
477
Yeah right,
It should be like this:

  • Player Group - Add (Owner of (Dying unit)) to tempPlayerGroup
  • Player Group - Make TempPlayerGroup treat (All allies of Player 2 (Blue)) as an Ally with shared vision
  • Player Group - Make TempPlayerGroup treat (All enemies of Player 2 (Blue)) as an Enemy
  • Player Group - Remove all players from tempPlayerGroup
 
Status
Not open for further replies.
Top