• 🏆 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] Mini Duel System

Status
Not open for further replies.
Level 10
Joined
Feb 20, 2008
Messages
448
here i wanted to make a small duel system : the player write duel than the name of the hero exemple : Goku. both unit are teleported to the battle zone place. i am not very familiar with String usage and player even versus unit condition XD

i want it liek the duel player cannot duel himself -_- XD im not sure also if i did the best way o_O any tips & suggestion are welcome


  • Duel Int
    • Events
      • Player - Player 1 (Red) types a chat message containing Duel as A substring
      • Player - Player 2 (Blue) types a chat message containing Duel as A substring
      • Player - Player 3 (Teal) types a chat message containing Duel as A substring
      • Player - Player 4 (Purple) types a chat message containing Duel as A substring
      • Player - Player 5 (Yellow) types a chat message containing Duel as A substring
      • Player - Player 6 (Orange) types a chat message containing Duel as A substring
      • Player - Player 7 (Green) types a chat message containing Duel as A substring
      • Player - Player 8 (Pink) types a chat message containing Duel as A substring
      • Player - Player 9 (Gray) types a chat message containing Duel as A substring
      • Player - Player 10 (Light Blue) types a chat message containing Duel as A substring
      • Player - Player 11 (Dark Green) types a chat message containing Duel as A substring
      • Player - Player 12 (Brown) types a chat message containing Duel as A substring
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to (Substring(Goku, 6, 9))
          • (Triggering player) Not equal to Player 1 (Red)
        • Then - Actions
          • Unit - Move (Triggering unit) instantly to (Center of Region 136 <gen>), facing (Facing of unit31) degrees
          • Unit - Move unit31 instantly to (Center of Region 135 <gen>), facing (Facing of (Triggering unit)) degrees
        • Else - Actions
 
Last edited:
Level 9
Joined
Jun 25, 2009
Messages
427
Wouldn't it be easier if you write something like this.
  • Duel
    • Events:
      • Player - Player 1 (red) writes Duel as a substring
      • Player - Player 2 (Blue) writes Duel as a substring
      • Player - Player 3 (Teal) writes Duel as a substring
      • Player - Player 4 (Purple) writes Duel as a substring
      • Player - Player 5 (Yellow) writes Duel as a substring
    • Conditions:
    • Actions:
      • Set Dueler=(Triggering Player)
      • Set Duelist=Entered chat string (5,6)
      • If (All conditions are true) then (do actions):
        • If - Conditions:
          • Player(Duelist) is an enemy of Dueler
        • Then - Actions:
          • Set Units=(Units in (Playable map area) owned by Dueler
          • Unit Group - Pick all (units) in Units group and (do actions):
            • If (All conditions are true) then (do actions):
              • If - Conditions:
                • (Picked Unit) is a Hero equal to True
              • Then - Actions:
                • Unit - Move (Picked Unit) to Arena <gen>
                • Custom Script: call DestroyGroup(udg_Units)
                • Else - Actions:
                  • Set Units=(Units in (Playable map area) owned by Player(Duelist)
                  • Unit Group - Pick all (units) in Units group and (do actions):
                  • If (All conditions are true) then (do actions):
                    • If - Conditions:
                      • (Picked Unit) is a Hero equal to True
                    • Then - Actions:
                      • Unit - Move (Picked Unit) to Arena <gen>
                      • Custom Script: call DestroyGroup(udg_Units)
        • Else - Actions:
          • Game - Write to (Triggering Player): You cannot fight with your teammate!!
 
Level 13
Joined
Feb 18, 2009
Messages
1,381
Wouldn't it be easier if you write something like this.
  • Duel
    • Events:
      • Player - Player 1 (red) writes Duel as a substring
      • Player - Player 2 (Blue) writes Duel as a substring
      • Player - Player 3 (Teal) writes Duel as a substring
      • Player - Player 4 (Purple) writes Duel as a substring
      • Player - Player 5 (Yellow) writes Duel as a substring
    • Conditions:
    • Actions:
      • Set Dueler=(Triggering Player)
      • Set Duelist=Entered chat string (5,6)
      • If (All conditions are true) then (do actions):
        • If - Conditions:
          • Player(Duelist) is an enemy of Dueler
        • Then - Actions:
          • Set Units=(Units in (Playable map area) owned by Dueler
          • Unit Group - Pick all (units) in Units group and (do actions):
            • If (All conditions are true) then (do actions):
              • If - Conditions:
                • (Picked Unit) is a Hero equal to True
              • Then - Actions:
                • Unit - Move (Picked Unit) to Arena <gen>
                • Custom Script: call DestroyGroup(udg_Units)
                • Else - Actions:
                  • Set Units=(Units in (Playable map area) owned by Player(Duelist)
                  • Unit Group - Pick all (units) in Units group and (do actions):
                  • If (All conditions are true) then (do actions):
                    • If - Conditions:
                      • (Picked Unit) is a Hero equal to True
                    • Then - Actions:
                      • Unit - Move (Picked Unit) to Arena <gen>
                      • Custom Script: call DestroyGroup(udg_Units)
        • Else - Actions:
          • Game - Write to (Triggering Player): You cannot fight with your teammate!!

I actually had to use that. Thanks. Do you know how to keep them in the same place?
 
Level 9
Joined
Jun 25, 2009
Messages
427
I actually had to use that. Thanks. Do you know how to keep them in the same place?

What do you mean? If you mean that after arena, get those heroes back to the same spot they were? if yes then just do something (add it to the actions)

  • Actions:
    • Unit Group - Pick all units in (the unit group in the trigger variable)
      • If (All conditions are True) then (do actions) else (do actions):
        • If - Conditions:
          • (Picked Unit) is a Hero equal to True
        • Then - Actions:
          • Set Position_1=(Position of (Picked Unit))
    • Unit Group - Pick all units in (the unit group that owned by the second player)
      • If (All conditions are True) then (do actions) else (do actions):
        • If - Conditions:
          • (Picked Unit) is a Hero equal to True
        • Then - Actions:
          • Set Position_2=(Position of (Picked Unit))
And after the duel is over or timer expires (if you use that)
  • Actions:
    • Set (the group)=(units in playable map area owned by Dueler/Duelist)
    • Unit Group - Pick units in (the group (dueler/duelist))
      • Loop - Actions:
        • Unit - Move to position(1,2)
    • Custom script: call RemoveLocation(udg_Position_1)
    • Custom script: call RemoveLocation(udg_Position_2)
    • Custom script: call DestroyGroup(udg_(the group 1/2))
Hope this is what you wanted.

Tiche3:grin:
 
Last edited:
Level 10
Joined
Feb 20, 2008
Messages
448
Thx @ tiche for other thingy ^^ i will have to use them both, got lot stuff to do now, currently fixing the Vjass creep revive my friend made for me, so im adding some function .

i should try it in the end of the day i will feedback if it work ^^ + rep
 
Status
Not open for further replies.
Top