• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
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.
 
Level 9
Joined
Apr 23, 2010
Messages
312
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]
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
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.
Top