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

Replacing Buildings & Making Units Hostile Upon Message

Status
Not open for further replies.
Level 11
Joined
Dec 13, 2008
Messages
1,047
Hello everybody! I need help fixing this trigger, it is not working the way I would like it to do.
So the premise of the trigger is that when player blue types a specific message, several heroes are spawned, a few heroes are made neutral hostile, and certain types of units located anywhere in the map are supposed to be made neutral hostile. The spawning of the heroes and making the heroes neutral hostile is working properly, but the player ownership change from blue to neutral hostile is not working correctly.
Please help me fix it, thanks!

  • Blue Allies Brown Mastery
    • Events
      • Player - Player 2 (Blue) types a chat message containing -ally Burning Legion as An exact match
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Varimathras has unv...
      • Unit - Create 1 Anetheron for Player 2 (Blue) at (Center of Nathrezim 1 <gen>) facing 270.00 degrees
      • Unit - Create 1 Mal'Ganis for Player 2 (Blue) at (Center of Plague Cannon 2 <gen>) facing 270.00 degrees
      • Unit - Create 1 Mephistroth for Player 2 (Blue) at (Center of Plague Cannon 1 <gen>) facing 270.00 degrees
      • Player - Make Player 2 (Blue) treat Player 12 (Brown) as an Ally with shared vision
      • Unit - Change ownership of Sylvanas 0017 <gen> to Neutral Hostile and Change color
      • Unit - Change ownership of Master Apothecary Faranell 0064 <gen> to Player 1 (Red) and Change color
      • Trigger - Turn off Blue Wars Brown <gen>
      • Trigger - Turn off Blue Neutrals Brown <gen>
As you probably will notice, the actual trigger for changing the player ownership of the units is not there. I removed it since it was not working properly. What trigger command should be used to replicate what I am trying to achieve??

Thank you very much again!
 
InfinateAnswers, when "Matching the condition", you have to use "Matching unit". Picked unit comes after the "Loop - Actions" sub function, in order to refer to the units of the group.

So,
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units in (Playable Map Area) matching ((Unit-type of (Matching unit) Equal to X) and ((Owner of (Matching unit)) Equal to Player 2 (Blue)) and do (Actions)
    • Loop - Actions
      • Unit - Change ownership of (Picked unit) to Neutral Hostile and Change color
 
Level 11
Joined
Dec 13, 2008
Messages
1,047
Okay, sweet, I found em. I am going to test it now.

Also, I just thought of something else I need help with in reference to this. I need specific buildings owned by Blue to be replaced with different buildings, but still owned by Blue. I suppose the first part
  • Unit Group - Pick every unit in (Units in (Playable Map Area) matching ((Unit-type of (Matching unit) Equal to X) and ((Owner of (Matching unit)) Equal to Player 2 (Blue)) and do (Actions)
  • Loop - Actions
Would be the same, but what would go after "Loop - Actions"?

Also, what exactly does that custom script do?
 
Status
Not open for further replies.
Top