DotA-like Mode Triggers

LordXavier

TH.net Regular
Reaction score
16
I've been trying to get this to work, but I just can't get it right. I have multiple game modes for my map
Main Modes: -ap, -ar
Secondary Modes: os, oi, oa, do, ro, nt, em, xm
and I don't know how to make the trigger like DotA that can decipher what the player types in, I want the player to have to type something in like this: -apemosdoront
Can anybody help me? +rep
 

Scary Nachos

Castro flashing Gang Signs!
Reaction score
45
Huh...

Trigger:
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -apemom as An exact match
    • Conditions
    • Actions
      • Trigger - Turn on Archer Research <gen>
      • Trigger - Turn on BlueDrag Research <gen>
      • Trigger - Turn on Salamandar orange <gen>


Like that?
If you mean decipher.... do you mean....
Trigger:
  • Player - Player 1 (Red) types a chat message containing -apemom as An exact match

That or something?
You could check out the dota template....
http://world-editor-tutorials.thehelper.net/maps.php?view=137
 

GetTriggerUnit-

DogEntrepreneur
Reaction score
129
Trigger:
  • Player - Player 1 (Red) types a chat message containing -apemosdoront as An exact match


Isn't it good?
 

LordXavier

TH.net Regular
Reaction score
16
if I made a trigger for every single combination of my modes, I'd have a ton. There are about 100 different combinations, I do not want to have to make that many triggers JUST for the game mode
Also, that DotA template and every other one I've looked at (even DotA Allstars template) only have a trigger like
Trigger:
  • Player - Player 1 (Red) types a chat message containing -ap as An exact match
    • Player - Player 1 (Red) types a chat message containing -allpick as An exact match

I want it to be possible to type in -apemosdoront (just an example of the largest posibility0
 

Guest3z

New Member
Reaction score
22
Trigger:
  • Events
    • Player - Player 1 (Red) types a chat message containing ap as A substring
Change as an exact match to as a substring and make a trigger for the multiple modes and it should work with whatever combo you type in.
 

Kuberr24

Well-Known Member
Reaction score
28
what dota does is, it breaks down the chat string in to parts of 2 letters. you can use by using local string variables and setting them equal to letters A/B of the entered chat string and then set the next local string to letters CD, then third string to EF etc. until the entire string is split up.

then for each string variable made this way, compare what exactly the player typed. then alot of if/then/else functions to do if stirng = ap, if string = ar, if string = oi etc... If a combination doesn't exist, give a message saying "illegal combination"
 

LordXavier

TH.net Regular
Reaction score
16
what dota does is, it breaks down the chat string in to parts of 2 letters. you can use by using local string variables and setting them equal to letters A/B of the entered chat string and then set the next local string to letters CD, then third string to EF etc. until the entire string is split up.

then for each string variable made this way, compare what exactly the player typed. then alot of if/then/else functions to do if stirng = ap, if string = ar, if string = oi etc... If a combination doesn't exist, give a message saying "illegal combination"
care to make a sample of that in GUI or Jass tags?
 

Moridin

Snow Leopard
Reaction score
144
Couldn't you do this? :S

Trigger:
  • Player - Player 1 (Red) types a chat message containing <YOUR MODE KEYLETTERS HERE> as A substring
 

LordXavier

TH.net Regular
Reaction score
16
yes I can do that, but let me explain why I want an example in GUI/Jass tags. I can make it player 1 red types -ap as a substring, but I don't know how I'd make the rest of the trigger, considering there's a TON of different combinations with my modes
 

Smilis

TH.net Regular
Reaction score
7
yes I can do that, but let me explain why I want an example in GUI/Jass tags. I can make it player 1 red types -ap as a substring, but I don't know how I'd make the rest of the trigger, considering there's a TON of different combinations with my modes

You havn't read the full text... He told you to use this:
Trigger:
  • Player - Player 1 (Red) types a chat message containing om as A substring


And put that in the Only mid trigger... so if Blue writes OM... (he wont need anything before it or after it), it will run that trigger... And becuse you have "as A substring" you can use as "text" as you want to..

If you understood what I ment ^^'
 

Guest3z

New Member
Reaction score
22
If you want something like kuberr said it would be something like this
Trigger:
  • Events
    • Player - Player 1 (Red) types a chat message containing - as A substring
    • Conditions
    • Actions
      • Set IntegerCounter = 1
      • Set IntegerLength = (Length of (Entered chat string))
      • For each (Integer A) from 2 to IntegerLength, do (Actions)
        • Loop - Actions
          • Set StringVar[IntegerCounter] = (Substring((Entered chat string), (Integer A), ((Integer A) + 1)))
          • Set IntegerCounter = (IntegerCounter + 1)
          • Custom script: set bj_forLoopAIndex = bj_forLoopAIndex + 1
      • For each (Integer A) from 1 to IntegerCounter, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (String(StringVar[(Integer A)]) as Lower case) Equal to ap
            • Then - Actions
              • Trigger - Run AP <gen> (checking conditions)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (String(StringVar[(Integer A)]) as Lower case) Equal to ar
                • Then - Actions
                  • Trigger - Run AR <gen> (checking conditions)
                • Else - Actions

Kinda sloppy but you get the point
 

Dirac

22710180
Reaction score
147
Events
Player 1 types - as a substring
Conditions
None
Actions
Loop 1 to 6 (if the maximum number of game modes are typed simultaneously.. -apemomsone)
IF -ap is equal to Substring (integer A + 1) (integer A + 3)
THEN set AP = TRUE
ELSE
do the same with other game modes

As for the game message build a string inside a var
If AP = True
Set String = String + "All Pick"
Display Player 1 turned on "STRING" modes
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top