• 🏆 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!

Chat Problem

Status
Not open for further replies.
Level 7
Joined
Jul 11, 2007
Messages
512
Uhh ok, there are many triggered chat-related threads, but NONE answers my question. I am trying to do a triggered chat (without disabling the normal one :p) using substrings (Gahh how to put those images showing triggers @_@).It works like in SotDRP, using a . , but the problem is that if i use the point anywhere, it shows up (substring :C) and if i change it to "matched" (with the appropiate conditions and actions) it stops working, or only the "." has an effect.I can't get the damn thing work ONLY if the point is the first character in the entered string :S
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
well as you already said, your probably like the 100000 dude who asks this question.

The answer is your question: Just combine "." and "substring" and "at the beginning of the string".

You just have to check, if the substring from 1 to 1 of the entered chat string is ".", then you return your actions.
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
I can make it for you I think, never tried it though.

EDIT:

  • Chat
    • Events
      • Player - Player 1 (Red) types a chat message containing . as A substring
      • Player - Player 2 (Blue) types a chat message containing . as A substring
      • Player - Player 3 (Teal) types a chat message containing . as A substring
      • Player - Player 4 (Purple) types a chat message containing . as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 1)) Equal to .
    • Actions
      • Game - Display to (All players) the text: ((Name of (Triggering player)) + (: + (Substring((Entered chat string), 2, 100))))
Also added a map to this post. You can also edit it to show colors etc, but I'm to lazy to do that.
 

Attachments

  • Chat.w3m
    15.7 KB · Views: 26
Level 14
Joined
Jul 1, 2008
Messages
1,314
  • Game - Display to (All players) the text: ((Name of (Triggering player)) + (: + (Substring((Entered chat string), 2, 100))))

Its better to change this part
JASS:
Game - Display to (All players) the text: ((Name of (Triggering player)) + (:  + (Substring((Entered chat string), 2, 100))))

to

JASS:
Game - Display to (All players) the text: ((Name of (Triggering player)) + (:  + (Substring((Entered chat string), 2, Lenght of Entered Chat String))))
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
I have just what you need! W8 let me get my trigger.

EDIT:
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set PlayerColor[1] = |c00ff0303
      • Set PlayerColor[2] = |c000042ff
      • Set PlayerColor[3] = |c001ce6b9
      • Set PlayerColor[4] = |c00540081
      • Set PlayerColor[5] = |c00fffc01
      • Set PlayerColor[6] = |c00ff8000
      • Set PlayerColor[7] = |c0020c000
      • Set PlayerColor[8] = |c00e55bb0
      • Set PlayerColor[9] = |c00959697
      • Set PlayerColor[10] = |c007ebff1
      • Set PlayerColor[11] = |c00106246
      • Set PlayerColor[12] = |c004e2a04
      • Set PlayerColor[13] = |c00272727
      • Set PlayerColor[14] = |c00caedf4
Just put PlayerColor[x] in front of the text, you can make x for example: number of etc.
 
Status
Not open for further replies.
Top