• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Trigger] What is the variables type of a chat message?

Status
Not open for further replies.
Level 8
Joined
Feb 22, 2009
Messages
271
I tried string but it didn't show up in the dropdown list.

1728017059550.png
 
It is string but you can't use the variable for events in GUI.
So instead you should do it in action.
  • Fel
    • Events
      • Player - Player 1 (Red) types a chat message containing -fel as An exact match
    • Conditions
    • Actions
      • Set EnteredString = (Entered chat string)
EnteredString is a string variable.
Perhaps you can elaborate more on what you're trying to achieve with this string variable.

Interestingly, this is achieveable in JASS.
JASS:
function WhatYouWantToDo takes nothing returns nothing
    // Do your actions here
endfunction

//===========================================================================
function InitTrig_Fel takes nothing returns nothing
    local trigger t = CreateTrigger()
    local integer index = 0
   
    loop
        call TriggerRegisterPlayerChatEvent( t, Player(index), udg_YourStringVariable, true )
        set index = index + 1
        exitwhen index == bj_MAX_PLAYER_SLOTS
    endloop
   
    call TriggerAddAction( t, function WhatYouWantToDo )
endfunction
 
Last edited:
I use it for faction change. You know the type -fel to change from playing normal orc to fel orc.

  • Fel orc
    • Events
    • Conditions
    • Actions
      • Set ReplaceUnitGroup = (Units owned by (Triggering player))
      • Unit Group - Pick every unit in ReplaceUnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Peon
            • Then - Actions
              • Unit - Replace (Picked unit) with a Fel Orc Peon using The old unit's relative life and mana
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Great Hall
            • Then - Actions
              • Unit - Replace (Picked unit) with a War Chamber using The old unit's relative life and mana
            • Else - Actions
      • Custom script: call DestroyGroup (udg_ReplaceUnitGroup)

  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • Trigger - Add to Fel orc <gen> the event (Player - (Picked player) types a chat message containing -fel as An exact match)
 
Yeah, that should work. :)
I completely forgot you can do this as well
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • Trigger - Add to YourTrigger the event (Player - (Picked player) types a chat message containing YourText as An exact match)
this way you can use string variable for the event. YourText is a string variable.
 
Status
Not open for further replies.
Back
Top