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

Floating Text over building that produces resources.

Status
Not open for further replies.
Level 2
Joined
Jan 21, 2015
Messages
5
Hey guys, I'm fairly new to the editor, that being said I'm only using features available within the editor, I don't use custom scripts or anything.

My goal at the moment is to have certain types of buildings produce income periodically and have floating text that displays the amount of income gained. I have a trigger set up that does this just fine, but I can't seem to get the floating text to display above said building(s).

My problem is that I'm not sure which floating text option to choose to make multiple of the same building show the income ticks. Example: I've made a Bank structure that produces 50 gold every 10 seconds, and I'd like every bank controlled by each player to display a quick +50g in text above the building momentarily then fades away or just goes away after a second.

Hopefully that makes sense, thanks guys.
 
First you create a texttag.
Then you set the visibility to true.
Then you set the fading age and lifespan to your preference. (fading age is when he starts fading and lifespan is the total duration.)

You have to do that for every building for every player...
You could do a unit group loop for every unit of each player and then check if their unit type corresponds to your income structure.
 
What you want is fairly easy to do, it just looks complicated is all, and unfortunately to prevent future lag in the game it would be best to use some short custom scripts to remove leaks.
[Trigger=floating texts]unit group - pick every unit in (units matching (unit is a bank)) and do (actions)
Loop - actions
Set temppoint = position of (picked unit)
Floating text - create floating text that reads (+50g) at temppoint ......
Floating text - change (last created text): disable permanence
Floating text - change lifespan of (last created text) to 1.50 seconds
Floating text - change the fading age of (last created text) to 1.00 seconds
Floating text - show (last created text) for (whoever)
Custom script: call removelocation(udg_temppoint)
[/trigger]
 
You are limited to at most 100 floating text at any given time. This includes text from gold mine income, lumber harvester income, critical strikes and misses (evasion or height difference). After this the last created texttag will be returned and modified instead of creating a new one.

In complex maps it is easily possible for over 100 such sources to exist at a time. For example if each farm did it, and 10 players have 10 farms then that is 100 and the limit is hit without any other sources, which there usually are such as the overly used critical strikes. To solve this problem you only display floating text for income or buildings that happen near the player's view area. Additionally each texttag can be managed locally, so that the texttags for different players do not strain the limit.
 
Status
Not open for further replies.
Back
Top