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

[Trigger] -Kick and and a question.

Status
Not open for further replies.
Level 4
Joined
Sep 25, 2009
Messages
49
Hey how would i go about making a -Kick command >< i can't figure it out.

and also how do i make my game so that allys cannot attack each other?
 
Level 15
Joined
Dec 18, 2007
Messages
1,098
  • Kick
    • Events
      • Player - Player 1 (Red) types a chat message containing -kick as An exact match
    • Conditions
      • (Substring((Entered chat string), 1, 5)) Equal to -kick
    • Actions
      • Game - Victory (Player((Integer((Substring((Entered chat string), 7, 7)))))) (Skip dialogs, Skip scores)
This should kick player red if you type -kick 1.
I'll try and see if there's a way to use colors instead.

PS: There is, but its inefficient, too many condition checks.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
allies cant attack:

  • No teamkilling
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True
    • Actions
      • Unit - Order (Attacking unit) to Stop
 
Level 6
Joined
Mar 22, 2009
Messages
276
^it may work but still after the first hit.
try this one.
  • No teamkill
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • ((Triggering unit) belongs to an ally of (Owner of (Target unit of issued order))) Equal to True
    • Actions
      • Unit - Order (Triggering unit) to Stop
 
Level 15
Joined
Sep 3, 2006
Messages
1,738
^it may work but still after the first hit.
try this one.
  • No teamkill
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • ((Triggering unit) belongs to an ally of (Owner of (Target unit of issued order))) Equal to True
    • Actions
      • Unit - Order (Triggering unit) to Stop

What if you cast a spell on your ally?

Hashjie's method is the best way to do it in GUI.
 
Level 4
Joined
Sep 25, 2009
Messages
49
Yeah....I got it working so that they cannot attack using regular attack, but they're able to use a spell on the other players hero, How can i fix that?
 
Level 9
Joined
Aug 27, 2009
Messages
473
Ok.. Thats simple, create a new trigger with this Events, Conditions and Actions:
  • DontCastSpellsOnAllies
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Target unit of ability being cast) belongs to an ally of (Owner of (Triggering unit))) Equal to True
    • Actions
      • Unit - Order (Triggering unit) to Stop
To allow healing you can do this:
  • DontCastSpellsOnAllies
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) belongs to an ally of (Owner of (Triggering unit))) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Ability being cast) Equal to Healing Wave
                  • (Ability being cast) Equal to Holy Light
            • Then - Actions
            • Else - Actions
              • Unit - Order (Triggering unit) to Stop
        • Else - Actions
This will probly only works on Channeling spells, with casting time.
 
Status
Not open for further replies.
Top