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

Message Conditions

Status
Not open for further replies.
Level 4
Joined
Feb 5, 2020
Messages
48
Is there a way to add a condition that prevents a message from being activated if there's already a bunch of messages being displayed? I have this map where killing certain targets gives a reward, however potentially you could kill several quest targets at the same time spamming the message board. This is more a precaution then a necessity.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,557
If Then Else statements are used to run Actions only if certain Conditions are met.

So the logic would be: If My Condition is Equal to (True/False) then Display text message.

For this particular situation you could use a Boolean variable as your condition to prevent the messages from being displayed and a Timer to then reenable the messages after X seconds has passed.

So whenever you want to display a message you would do something like this:
  • Actions
  • If SkipTextMsg is Equal to False then do Actions:
    • Game - Display your text message / Quest message
    • Set Variable SkipTextMsg = True
    • Countdown Timer - Start SkipMsgTimer as a one-shot timer that will expire in 5.00 seconds
After 5.00 seconds the SkipMsgTimer will expire and set SkipTextMsg to False again which will allow a new message to be displayed:
  • Events
    • Time - SkipMsgTimer expires
  • Actions
    • Set Variable SkipTextMsg = False
Note that this single Timer/Boolean approach means it will be shared between all players. You may want to give each player their own Timer/Boolean depending on how your map works. Also, note that when you Start a one-shot Timer that is already running it will simply restart the Timer.
 
Last edited:
Status
Not open for further replies.
Top