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

Kick System

Status
Not open for further replies.

kj_

kj_

Level 5
Joined
Aug 1, 2008
Messages
134
Well I want this ...
Say player one types -kick 2
Blue will be kicked simple enough but
If player one's unit is equal to a Vampire
I want the kick system to disable
I don't know if this would work but here is my current trigger
  • Kick
    • Events
  • Player - Player 1 (Red) types a chat message containing -kick 2 as An exact match
    • Conditions
  • (Unit-Type of (Triggering unit)) Equal to Human
    • Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • Then - Actions
  • Game - Defeat Player 2 (Blue) with the message: Kicked!
    • Else - Actions
  • Trigger - Turn off (This Trigger)
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
You should make an variable like Player1_Unit and then use it instead of Triggering unit, also first set which unit is the Player1_Unit.

example:
  • Map initialization
  • Unit Create Footman at center of Your_Region_Name
  • set Player1_Unit = last created unit
this is how your kick system should look

  • Events
  • Player - Player 1 types a chat message containing -kick 2 as An exact match
  • Conditions
  • Actions
  • If/then/else
  • If condition
  • Unit type of Player1_Unit equal to Human
  • Then - Actions
  • Game - Defeat Player 2 with message: Kicked!
  • Else - Actions
  • Do nothing
But i think there are much better existing vote kick systems, you should not give the Red Player the power to kick all others, unless you want that.
 
Last edited:
Level 5
Joined
Aug 24, 2008
Messages
199
I dont have much experience in map making but couldn't you just use an unequal trigger like:

  • Kick
    • Events
      • Player - Player 1 (Red) types a chat message containing -kick 2 as An exact match
    • Conditions
      • (Unit-Type of (Triggering unit)) Unequal to Vampire
    • Actions
      • If (All Conditions are True) then Kick Player 2 else do nothing
      • Trigger - Turn off (This Trigger)
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
I think not cause the editor will not know which unit is the triggering unit.
Triggering unit is used for:
  • Unit comes within range
Then the triggering unit is the unit which comes within range.
For Unit begins/finishes casting use Event response - Casting Unit but to use just triggering unit is undefined.
But you launch the map and see for yourself.
 
Level 5
Joined
Aug 24, 2008
Messages
199
This is true. But a region wont work for this i thing. If the hero/vampire is created via trigger you would need a variable and save the hero/vampire to it.
Then you could use
  • Kick
    • Events
      • Player - Player 1 (Red) types a chat message containing -kick 2 as An exact match
    • Conditions
      • Variable Unequal to Vampire
  • Actions
    • If (All Conditions are True) then Kick Player 2 else do nothing
    • Trigger - Turn off (This Trigger)
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
That is what i said you need an variable or you can use groups:
  • Event Player chat message -kick2
  • Conditions
  • Actions
  • Set Player_1_Units = Units in playable map area matching matching owner equal Player 1
  • Unit Group - Pick every unit in Player_1_Units and do actions
  • If/then/else
  • Condition Unit type of picked unit not equal to Vampire
  • Then Actions Game - Defeat player 2
  • Custom script call DestroyGroup(udg_Player_1_Units)
  • Else Actions Custom script call DestroyGroup(udg_Player_1_Units)
  • Do nothing
You need an group variable if you want your trigger to be leakless.
Also what region are you talking about? I didn't used any regions in my posts.
 
Level 13
Joined
Jul 26, 2008
Messages
1,009
Sorry, this might not help you out entirely, but it's worth a try.

If you want the trigger to exlude booting a vampire, then try utelizing some of the non-used unit types. Like how there's Unit Type Giant, Tauren, Ancient, Undeaed, etc. Giant is hardly used. You can try renaming the Giant type to Vampire in the constants too, to keep up with the theme. (This could also allow you to make certain spells work only on Vampires)
Iunno, I'm not too good at triggering and ground-up Jass. But it's a simple solution worth a try.

Here's a Jass function I use to prevent DMs from killing essential pieces when they type in "kill" in the map I'm working on:

JASS:
        if not IsUnitIdType(GetUnitTypeId(GetEnumUnit()), UNIT_TYPE_GIANT) then

To get an idea of what might work. Hopefully this was helpful in some regards.
 
Level 2
Joined
Aug 31, 2008
Messages
25
here
first trigger displays dialog
  • Kick Console C
    • Events
      • Player - Player 1 (Red) types a chat message containing -kick as An exact match
    • Conditions
    • Actions
      • Dialog - Change the title of Dial_Kick_Console to Kick Console
      • Dialog - Change the title of Dial_Pause to Paused (Host is kic...
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 (Blue) slot status) Equal to Is playing
        • Then - Actions
          • Dialog - Create a dialog button for Dial_Kick_Console labelled ((|cff0041FF + Kick ) + ((Name of Player 2 (Blue)) + |r))
          • Set Dial_Kick_Players[2] = (Last created dialog Button)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 3 (Teal) slot status) Equal to Is playing
        • Then - Actions
          • Dialog - Create a dialog button for Dial_Kick_Console labelled ((|cff1BE6B8 + Kick ) + ((Name of Player 3 (Teal)) + |r))
          • Set Dial_Kick_Players[3] = (Last created dialog Button)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 4 (Purple) slot status) Equal to Is playing
        • Then - Actions
          • Dialog - Create a dialog button for Dial_Kick_Console labelled ((|cff530080 + Kick ) + ((Name of Player 4 (Purple)) + |r))
          • Set Dial_Kick_Players[4] = (Last created dialog Button)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 5 (Yellow) slot status) Equal to Is playing
        • Then - Actions
          • Dialog - Create a dialog button for Dial_Kick_Console labelled ((|cffFFFC00 + Kick ) + ((Name of Player 5 (Yellow)) + |r))
          • Set Dial_Kick_Players[5] = (Last created dialog Button)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 6 (Orange) slot status) Equal to Is playing
        • Then - Actions
          • Dialog - Create a dialog button for Dial_Kick_Console labelled ((|cffFE890D + Kick ) + ((Name of Player 6 (Orange)) + |r))
          • Set Dial_Kick_Players[6] = (Last created dialog Button)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 7 (Green) slot status) Equal to Is playing
        • Then - Actions
          • Dialog - Create a dialog button for Dial_Kick_Console labelled ((|cff1FBF00 + Kick ) + ((Name of Player 7 (Green)) + |r))
          • Set Dial_Kick_Players[7] = (Last created dialog Button)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 8 (Pink) slot status) Equal to Is playing
        • Then - Actions
          • Dialog - Create a dialog button for Dial_Kick_Console labelled ((|cffE55AAF + Kick ) + ((Name of Player 8 (Pink)) + |r))
          • Set Dial_Kick_Players[8] = (Last created dialog Button)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 9 (Gray) slot status) Equal to Is playing
        • Then - Actions
          • Dialog - Create a dialog button for Dial_Kick_Console labelled ((|cff949596 + Kick ) + ((Name of Player 9 (Gray)) + |r))
          • Set Dial_Kick_Players[9] = (Last created dialog Button)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 10 (Light Blue) slot status) Equal to Is playing
        • Then - Actions
          • Dialog - Create a dialog button for Dial_Kick_Console labelled ((|cff7DBEF1 + Kick ) + ((Name of Player 10 (Light Blue)) + |r))
          • Set Dial_Kick_Players[10] = (Last created dialog Button)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 11 (Dark Green) slot status) Equal to Is playing
        • Then - Actions
          • Dialog - Create a dialog button for Dial_Kick_Console labelled ((|cff0F6145 + Kick ) + ((Name of Player 11 (Dark Green)) + |r))
          • Set Dial_Kick_Players[11] = (Last created dialog Button)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 12 (Brown) slot status) Equal to Is playing
        • Then - Actions
          • Dialog - Create a dialog button for Dial_Kick_Console labelled ((|cff4D2903 + Kick ) + ((Name of Player 12 (Brown)) + |r))
          • Set Dial_Kick_Players[12] = (Last created dialog Button)
        • Else - Actions
          • Do nothing
      • Dialog - Create a dialog button for Dial_Kick_Console labelled Cancel
      • Set Dial_Cancel = (Last created dialog Button)
      • Dialog - Show Dial_Kick_Console for Player 1 (Red)
      • For each (Integer A) from 2 to 12, do (Dialog - Show Dial_Pause for (Player((Integer A))))
      • For each (Integer A) from 2 to 12, do (Game - Pause the game)
This actually kicks people
  • Kick Console A
    • Events
      • Dialog - A dialog button is clicked for Dial_Kick_Console
    • Conditions
    • Actions
      • If ((Clicked dialog button) Equal to Dial_Kick_Players[2]) then do (Game - Defeat Player 2 (Blue) with the message: You have been kicke...) else do (Do nothing)
      • If ((Clicked dialog button) Equal to Dial_Kick_Players[3]) then do (Game - Defeat Player 3 (Teal) with the message: You have been kicke...) else do (Do nothing)
      • If ((Clicked dialog button) Equal to Dial_Kick_Players[4]) then do (Game - Defeat Player 4 (Purple) with the message: You have been kicke...) else do (Do nothing)
      • If ((Clicked dialog button) Equal to Dial_Kick_Players[5]) then do (Game - Defeat Player 5 (Yellow) with the message: You have been kicke...) else do (Do nothing)
      • If ((Clicked dialog button) Equal to Dial_Kick_Players[6]) then do (Game - Defeat Player 6 (Orange) with the message: You have been kicke...) else do (Do nothing)
      • If ((Clicked dialog button) Equal to Dial_Kick_Players[7]) then do (Game - Defeat Player 7 (Green) with the message: You have been kicke...) else do (Do nothing)
      • If ((Clicked dialog button) Equal to Dial_Kick_Players[8]) then do (Game - Defeat Player 8 (Pink) with the message: You have been kicke...) else do (Do nothing)
      • If ((Clicked dialog button) Equal to Dial_Kick_Players[9]) then do (Game - Defeat Player 9 (Gray) with the message: You have been kicke...) else do (Do nothing)
      • If ((Clicked dialog button) Equal to Dial_Kick_Players[10]) then do (Game - Defeat Player 10 (Light Blue) with the message: You have been kicke...) else do (Do nothing)
      • If ((Clicked dialog button) Equal to Dial_Kick_Players[11]) then do (Game - Defeat Player 11 (Dark Green) with the message: You have been kicke...) else do (Do nothing)
      • If ((Clicked dialog button) Equal to Dial_Kick_Players[12]) then do (Game - Defeat Player 12 (Brown) with the message: You have been kicke...) else do (Do nothing)
      • If ((Clicked dialog button) Equal to Dial_Cancel) then do (Dialog - Show Dial_Kick_Console for Player 1 (Red)) else do (Do nothing)
      • Trigger - Run Unit Remover <gen> (ignoring conditions)
      • Dialog - Clear Dial_Kick_Console
      • Dialog - Hide Dial_Kick_Console for Player 1 (Red)
      • For each (Integer A) from 2 to 12, do (Dialog - Hide Dial_Pause for (Player((Integer A))))
      • For each (Integer A) from 2 to 12, do (Game - Unpause the game)
2 triggers and anyone new or playing WC3 will know how to use it does use variables and arrayed variables
 
Status
Not open for further replies.
Top