• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Crashing stuff with chat commands

Status
Not open for further replies.
Level 21
Joined
Mar 27, 2012
Messages
3,232
http://www.hiveworkshop.com/forums/general-mapping-tutorials-278/using-chat-commands-34686/

In here they say, that it is not possible to crash the game with adding gold.

However, some things can.
I made an ally trigger that:
Activates if someone says -ally
Check what's after it and then allies, shares vision, shares xp, shares friendly spell targeting. (Not all is needed, but that's how i did)
So if i say -ally 2 then it allies player 2 Blue.
It was only supposed to accept numbers, but i found no way for it to check if something is a number.

I used this trigger in my map until someone said -ally red
The game crashed.
If any non-numerics result in zeros, then i guess it tried to find player 0.
 
Level 3
Joined
Apr 4, 2006
Messages
33
substring 7 has to be a number between 1 and 12
1_2_3_4_5_6_7
-_a_l__l_y___2

if false, then else function: print message "syntax error" or something

i triggered an example for you


  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing (Substring(-kill, 1, 5)) as A substring
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 7, (Length of (Entered chat string)))) Equal to (String(1))
        • Then - Actions
          • Unit - Kill Paladin 0002 <gen>
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), 7, (Length of (Entered chat string)))) Equal to (String(2))
            • Then - Actions
              • Unit - Kill Archmage 0003 <gen>
            • Else - Actions
              • Game - Display to (All players) the text: ((Substring((Entered chat string), 7, (Length of (Entered chat string)))) + not found :D lol)
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
substring 7 has to be a number between 1 and 12
1_2_3_4_5_6_7
-_a_l__l_y___2

if false, then else function: print message "syntax error" or something

i triggered an example for you


  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing (Substring(-kill, 1, 5)) as A substring
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 7, (Length of (Entered chat string)))) Equal to (String(1))
        • Then - Actions
          • Unit - Kill Paladin 0002 <gen>
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), 7, (Length of (Entered chat string)))) Equal to (String(2))
            • Then - Actions
              • Unit - Kill Archmage 0003 <gen>
            • Else - Actions
              • Game - Display to (All players) the text: ((Substring((Entered chat string), 7, (Length of (Entered chat string)))) + not found :D lol)

Or wait, that way i would still need to make 12 different options, which makes it very long and clumsy. But i think i know what to do now. Yep, it works. I made it use integer A.
For each integer A from 1 to 12 etc
Then it checks if the chat string is the same as integer A and if it is then it works. Else it tells an error.
 
Status
Not open for further replies.
Top