• 🏆 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] Prefixes for Chat Commands

Status
Not open for further replies.
Level 7
Joined
Oct 20, 2010
Messages
182
I am unsure if anyone remembers such maps as SotDRP or the like, but I am currently trying to recreate some features for my own personal use on a map with a friend. I preface this with that I am new to coding although I understand most of the logic that goes into it. My only problem is actually finding the things in the GUI menus.

I will likely have more questions if anyone wishes to help me more in-depth on chat messages but I will just start with this question.

How do I make an event recognizing a prefix? such as a "." so when I type ".hello" it will post hello as a floating text.
 
Level 10
Joined
Dec 11, 2009
Messages
234
  • Events
    • Player - Player 1 (Red) types a chat message containing . as A substring
upd:
  • example
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 1)) Equal to .
    • Actions
      • Set str = (Substring((Entered chat string), 2, (Length of (Entered chat string))))
      • Floating Text - Create floating text that reads str above Ghoul 0006 <gen> with Z offset 16.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
 
Last edited:
Status
Not open for further replies.
Top