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

Custom command

Status
Not open for further replies.
Level 6
Joined
Mar 2, 2013
Messages
127
I need a custom command so if a person types "-yes" then the players hero will be added to a group.

I tried this but it didn't work.
  • Duel Vote Team1
    • Events
      • Player - Player 2 (Blue) types a chat message containing -yes as An exact match
      • Player - Player 3 (Teal) types a chat message containing -yes as An exact match
      • Player - Player 4 (Purple) types a chat message containing -yes as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -yes as An exact match
      • Player - Player 6 (Orange) types a chat message containing -yes as An exact match
    • Conditions
    • Actions
      • Unit Group - Add (Triggering unit) to DuelGroup[1]
 
Last edited:
Level 18
Joined
May 11, 2012
Messages
2,103
  • Melee Initialization
    • Events
      • Player - Player 1 (Red) types a chat message containing -yes as An exact match
      • Player - Player 2 (Blue) types a chat message containing -yes as An exact match
      • Player - Player 3 (Teal) types a chat message containing -yes as An exact match
      • Player - Player 4 (Purple) types a chat message containing -yes as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -yes as An exact match
      • Player - Player 6 (Orange) types a chat message containing -yes as An exact match
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to DuelGroup[1]
Is that what you want?
 
Level 6
Joined
Mar 2, 2013
Messages
127
Ok So it looks better but I am missing something.
I want the variable to add the players units to the group, not replace when a different person type -yes.
Is there a way to make it so its set duelgroup[1] = duelgroup[1] + .....

Here is what I have
  • Duel Vote Team1
    • Events
      • Player - Player 2 (Blue) types a chat message containing -yes as An exact match
      • Player - Player 3 (Teal) types a chat message containing -yes as An exact match
      • Player - Player 4 (Purple) types a chat message containing -yes as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -yes as An exact match
      • Player - Player 6 (Orange) types a chat message containing -yes as An exact match
    • Conditions
    • Actions
      • Set DuelGroup[1] = (Units owned by (Triggering player) matching (((Unit-type of (Matching unit)) Not equal to (!=) Naruto Bunshin) and ((Unit-type of (Matching unit)) Not equal to (!=) Uchiha Traitor)))
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Whats this do?
Custom script: set bj_wantDestroyGroup = true

that cleans the group leak. although maker thinks its not good to do anymore since u cant null the group so it does still leak a small amount. the way ur doing it u would need
  • custom script: call DestroyGroup( udg_urGroupName)
  • set udg_urGroupName = null
u should take a look at my tutorial and look at the things that leak tutorial.
and plz dont double post instead hit the edit button on ur last post

also u cant do it like that and u wont need to destroy ur group or null it if u do it the way i first posted. ill c if i can make a sample trigger

heres the trigger
  • Sample trigger
    • Events
      • Player - Player 1 (Red) types a chat message containing -yes as An exact match
      • Player - Player 2 (Blue) types a chat message containing -yes as An exact match
      • Player - Player 3 (Teal) types a chat message containing -yes as An exact match
      • Player - Player 4 (Purple) types a chat message containing -yes as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -yes as An exact match
      • Player - Player 6 (Orange) types a chat message containing -yes as An exact match
    • Conditions
    • Actions
      • Set tempGroup = (Units currently selected by (Triggering player))
      • Unit Group - Add all units of tempGroup to unitGroup
      • Custom script: call DestroyGroup( udg_tempGroup)
      • Custom script: set udg_tempGroup = null
also u should really check out those tutorials since u dont know wat leaks are. they can be the death of ur map.( lag wise)
 
Level 6
Joined
Mar 2, 2013
Messages
127
Well the code isn't working for me :/
I'm gonna post all the stuff I have about it, maybe you can help find my problem?
When i tested it in game, it game me "Konoha Alliance has not voted... duel has been canceled."

Here is what I have
  • Duel Startup
    • Events
      • Time - DuelTimer expires
    • Conditions
    • Actions
      • Quest - Display to Players the Secret message: |c00ff0303Duel Syst...
      • Quest - Display to Players the Secret message: |c00ff0303You have ...
      • Quest - Display to Players the Secret message: |c00ff0303Type -yes...
      • Trigger - Turn on Duel Vote Team1 <gen>
      • Trigger - Turn on Duel Vote Team2 <gen>
      • Wait 20.00 seconds
      • Trigger - Turn off Duel Vote Team1 <gen>
      • Trigger - Turn off Duel Vote Team2 <gen>
      • Quest - Display to Players the Secret message: |c00ff0303Voting Fi...
      • Wait 2.00 seconds
      • -------- DUEL CHECK --------
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Number of units in DuelGroup[1]) Equal to (==) 0
          • Then - Actions
            • Countdown Timer - Start DuelTimer as a One-shot timer that will expire in 480.00 seconds
            • Custom script: call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,5.0,"Seireitei Alliance has not voted... duel has been canceled.")
            • Skip remaining actions
          • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Number of units in DuelGroup[2]) Equal to (==) 0
          • Then - Actions
            • Countdown Timer - Start DuelTimer as a One-shot timer that will expire in 480.00 seconds
            • Custom script: call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,5.0,"Konoha Alliance has not voted... duel has been canceled.")
            • Skip remaining actions
          • Else - Actions
      • -------- DUEL GROUPINGS --------
      • Set DuelUnit[1] = (Random unit from DuelGroup[1])
      • Set DuelUnit[2] = (Random unit from DuelGroup[2])
      • -------- DUEL SETUP --------
      • Unit - Make DuelUnit[1] Invulnerable
      • Unit - Make DuelUnit[2] Invulnerable
      • Unit - Move DuelUnit[1] instantly to (Center of DuelSpawn4 <gen>), facing Default building facing (270.0) degrees
      • Unit - Move DuelUnit[2] instantly to (Center of DuelSpawn3 <gen>), facing 90.00 degrees
      • Custom script: call SafePause(udg_DuelUnit[1])
      • Custom script: call SafePause(udg_DuelUnit[2])
      • Unit - Reset ability cooldowns for DuelUnit[1]
      • Unit - Reset ability cooldowns for DuelUnit[2]
      • Unit - Remove All buffs from DuelUnit[1]
      • Unit - Remove All buffs from DuelUnit[2]
      • Unit - Set life of DuelUnit[1] to 100.00%
      • Unit - Set life of DuelUnit[2] to 100.00%
      • Unit - Set mana of DuelUnit[1] to 100.00%
      • Unit - Set mana of DuelUnit[2] to 100.00%
      • Hero - Disable experience gain for DuelUnit[1]
      • Hero - Disable experience gain for DuelUnit[2]
      • Wait 2.00 seconds
      • Custom script: call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,5.0,"5...")
      • Wait 1.00 seconds
      • Custom script: call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,5.0,"4...")
      • Wait 1.00 seconds
      • Custom script: call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,5.0,"3...")
      • Wait 1.00 seconds
      • Custom script: call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,5.0,"2...")
      • Wait 1.00 seconds
      • Custom script: call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,5.0,"1...")
      • Wait 1.00 seconds
      • Custom script: call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,5.0,"FIGHT!")
      • Custom script: call SafeUnPause(udg_DuelUnit[1])
      • Custom script: call SafeUnPause(udg_DuelUnit[2])
      • Unit - Set life of DuelUnit[1] to 100.00%
      • Unit - Set life of DuelUnit[2] to 100.00%
      • Unit - Set mana of DuelUnit[1] to 100.00%
      • Unit - Set mana of DuelUnit[2] to 100.00%
      • Unit - Make DuelUnit[1] Vulnerable
      • Unit - Make DuelUnit[2] Vulnerable
  • Duel Vote Team1
    • Events
      • Player - Player 2 (Blue) types a chat message containing -yes as An exact match
      • Player - Player 3 (Teal) types a chat message containing -yes as An exact match
      • Player - Player 4 (Purple) types a chat message containing -yes as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -yes as An exact match
      • Player - Player 6 (Orange) types a chat message containing -yes as An exact match
    • Conditions
    • Actions
      • Set tempgroup[1] = (Units owned by (Triggering player) matching ((((Matching unit) is A Hero) Equal to (==) True) and (((Unit-type of (Matching unit)) Not equal to (!=) Naruto Bunshin) and ((Unit-type of (Matching unit)) Not equal to (!=) Uchiha Traitor))))
      • Unit Group - Add all units of tempgroup[1] to DuelGroup[1]
      • Custom script: call DestroyGroup( udg_tempgroup[1])
      • Custom script: set udg_tempgroup[1] = null
  • Duel Vote Team2
    • Events
      • Player - Player 8 (Pink) types a chat message containing -yes as An exact match
      • Player - Player 9 (Gray) types a chat message containing -yes as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -yes as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -yes as An exact match
      • Player - Player 12 (Brown) types a chat message containing -yes as An exact match
    • Conditions
    • Actions
      • Set tempgroup[2] = (Units owned by (Triggering player) matching ((((Matching unit) is A Hero) Equal to (==) True) and (((Unit-type of (Matching unit)) Not equal to (!=) Naruto Bunshin) and ((Unit-type of (Matching unit)) Not equal to (!=) Uchiha Traitor))))
      • Unit Group - Add all units of tempgroup[2] to DuelGroup[2]
      • Custom script: call DestroyGroup( udg_tempgroup[2])
      • Custom script: set udg_tempgroup[2] = null
 
Status
Not open for further replies.
Top