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

[Solved] Attack Own Unit?!

Status
Not open for further replies.
Level 6
Joined
May 9, 2011
Messages
228
guys i have a problem on my map
my allied player can attack its on ally
for example player 1 attacks player 2 this two players are allied
so how make the allied units cant attack their own ally
any idea
 
Level 6
Joined
May 9, 2011
Messages
228
wow thank you again maker for the wonderful help....
hey i have another problem
OFF-TOPIC:
can you help my trigger problem
heres my trigger:
  • Untitled Trigger 002
    • Events
      • Unit - A unit owned by Player 11 (Dark Green) Is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to Hive Fortress
      • (Percentage life of (Attacked unit)) Less than or equal to 99.90
    • Actions
      • Game - Display to (All players) for 1.00 seconds the text: Who dares trying to...
      • Special Effect - Create a special effect at (Center of Center of Map <gen>) using HealingWater.MDX
      • Wait 2.00 seconds
      • Special Effect - Destroy (Last created special effect)
      • Unit - Create 1 Hydra for Player 11 (Dark Green) at (Center of Center of Map <gen>) facing Default building facing degrees
      • Trigger - Turn off Untitled Trigger 001 <gen>
the problem is more hydra will spawn i want 1 hydra will to that trigger
btw + rep again
 
Level 14
Joined
Sep 28, 2011
Messages
968
When we turn off the trigger the current execution is not interrupted so if you want to have a trigger who run only once you can put the turn off as the first action.And read a tutorial on memory leaks if this trigger is the one you use in your map.
 
  • T
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True
        • Then - Actions
          • Unit - Order (Attacking unit) to Stop
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 11 (Dark Green)
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to Footman
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • b Equal to False
                • Then - Actions
                  • Set b = True
                  • Set p = (Center of (Playable map area))
                  • Game - Display to (All players) for 1.00 seconds the text: Who dares trying to...
                  • Special Effect - Create a special effect at p using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Wait 2.00 seconds
                  • Unit - Create 1 Footman for (Owner of (Triggering unit)) at p facing Default building facing degrees
                  • Custom script: call RemoveLocation (udg_p)
                  • Set b = False
                • Else - Actions
            • Else - Actions
        • Else - Actions
p -> Point variable
b -> Boolean variable (by default set to false)
 

Attachments

  • testmap.w3x
    17.8 KB · Views: 46
Status
Not open for further replies.
Top