• 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.

Text appearing & disappearing in the center of region

Status
Not open for further replies.
Level 7
Joined
Jul 22, 2021
Messages
65
Hello, so I made these triggers that should enable/disable a text to appear at the center of region.
Basically whenever a unit is entering the region the text should appear and when it leaves it should disappear.

Now, the problem is that it's buggy. Sometimes it works, sometimes it doesn't - text doesn't disappear or appear, etc. So far I tested it with only one unit but when I think about it, it'll get more complicated with more units, probably.

I'm not sure what it's all about. Perhaps there is a better way to implement this? Make invulnerable destructible with sign post model so the name simply appears over mouse hover? (just an idea that popped off my head at the time of writing)
Below are the triggers:
  • WarningSignOn
    • Events
      • Unit - A unit enters Region 181 <gen>
    • Conditions
      • (Triggering unit) Equal to (Random unit from (Units in (Playable map area) owned by Player 2 (Blue)))
    • Actions
      • Floating Text - Create floating text that reads BEWARE! SPIDERS at (Center of Region 181 <gen>) with Z offset 0.00, using font size 9.50, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Trigger - Turn on WarningSingOff <gen>
  • WarningSingOff
    • Events
      • Unit - A unit leaves Region 181 <gen>
    • Conditions
      • (Triggering unit) Equal to (Random unit from (Units in (Playable map area) owned by Player 2 (Blue)))
    • Actions
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 0.00 seconds
      • Trigger - Turn on WarningSignOn <gen>
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
Also, to prevent other issues, you should store this Floating Text in a Floating Text variable and reference that throughout these triggers.
  • Floating Text - Create floating text that reads BEWARE! SPIDERS at (Center of Region 181 <gen>) with Z offset 0.00, using font size 9.50, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
  • Set Variable SpiderText = (Last created floating text)
So you should replace anything using (Last created floating text) with a reference to this Variable instead. For example:
  • Floating Text - Change the lifespan of SpiderText to 0.00 seconds
Note that regions can be a bit unreliable sometimes but these triggers should be okay.
 
Status
Not open for further replies.
Top