• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Substrings

Status
Not open for further replies.
Awesome!

Thank you almighty Paladon! =)

Edit:

Another problem...

if i use this:
  • Player - Player 2 (Blue) types a chat message containing (Substring(-agi, 6, 7)) as An exact match
it doesn't matter if i type "-str 15" or "-agi 15" it gives 15 to all stars(i have the different triggers for each atribute) it looks like it just picks up he substring...

So i tried this: string + substring(_, 6, 7)

  • Add Strength
    • Events
      • Player - Player 2 (Blue) types a chat message containing (-str + (Substring( , 6, 7))) as An exact match
    • Conditions
    • Actions
      • Set Y_Map_Point[4] = (Center of (Playable map area))
      • Set Y_Wish_Group[1] = (Units within 5000.00 of Y_Map_Point[4] matching ((((Matching unit) is A Hero) Equal to True) and (((Owner of (Matching unit)) Equal to Player 2 (Blue)) and (((Matching unit) is selected by Player 2 (Blue)) Equal to True))))
      • Unit Group - Pick every unit in Y_Wish_Group[1] and do (Actions)
        • Loop - Actions
          • Hero - Modify Strength of (Picked unit): Add (Integer((Substring((Entered chat string), 6, 7))))
      • Custom script: call RemoveLocation(udg_Y_Map_Point[4])
      • Custom script: call DestroyGroup(udg_Y_Wish_Group[1])
But nothing happens :S

Any ideas how to fix this matter?

Thanks!
 
Last edited:
Level 11
Joined
May 31, 2008
Messages
698
For the end of the substring do this:
Unit - Set (Last created unit) movement speed to (Real((Substring((Entered chat string), 1, (Length of (Entered chat string))))))
And ur not the only one who didnt understand the stupid example blizzard made. I had to ask someone before i saw what they were talkin bout lol
for that other problem you had just do player types -str as a substring.
Heres some examples i have of substring stuff (cheats for a map im makin :p)
The nullify thing is good for ppl that are annoying and that you dont want in ur game, but it doesnt kick them (kicking sometimes causes crashes or whatever i guess)
  • nullify
    • Events
      • Player - Player 1 (Red) types a chat message containing -nullify as A substring
    • Conditions
      • (Name of (Triggering player)) Equal to (==) wolfman
    • Actions
      • Cinematic - Turn on letterbox mode (hide interface) for (All players matching ((Name of (Matching player)) Equal to (==) (Substring((Entered chat string), 10, (Length of (Entered chat string)))))): fade out over 2.00 seconds
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Substring((Entered chat string), 10, (Length of (Entered chat string)))) Equal to (==) wolfman
          • Then - Actions
            • Wait 5.00 seconds
            • Cinematic - Turn off letterbox mode (show interface) for (All players matching ((Name of (Matching player)) Equal to (==) wolfman)): fade in over 2.00 seconds
          • Else - Actions


  • unnullify
    • Events
      • Player - Player 1 (Red) types a chat message containing -unnullify as A substring
    • Conditions
      • (Name of (Triggering player)) Equal to (==) wolfman
    • Actions
      • Cinematic - Turn off letterbox mode (show interface) for (All players matching ((Name of (Matching player)) Equal to (==) (Substring((Entered chat string), 12, (Length of (Entered chat string)))))): fade in over 2.00 seconds


  • gold
    • Events
      • Player - Player 1 (Red) types a chat message containing -gold as A substring
    • Conditions
      • (Name of (Triggering player)) Equal to (==) wolfman
    • Actions
      • Player - Add (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string)))))) to (Triggering player) Current gold


  • level
    • Events
      • Player - Player 1 (Red) types a chat message containing -lvl as A substring
    • Conditions
      • (Name of (Triggering player)) Equal to (==) wolfman
    • Actions
      • Set TempUnitGroup = (Units currently selected by (Triggering player))
      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
        • Loop - Actions
          • Hero - Set (Picked unit) Hero-level to (Integer((Substring((Entered chat string), 6, (Length of (Entered chat string)))))), Show level-up graphics
      • Custom script: call DestroyGroup(udg_TempUnitGroup)
 
Status
Not open for further replies.
Top