This is the rank line:

It is the second line beneath the Unit Name. We can modify it to display information to the player. First things first, if your unit is not Terran you will have to make it Terran in order for this to work. Go to Datedit > Unit > Basic and change it here:

Next move from the Basic tab to the Staredit tab. Here you will find the list of ranks, which you can modify to say whatever you want. I've changed the rank of Admiral to say "Stunned!"

Now in order to apply this rank in game with triggers, you have to use an EUD action in TriggerEditor called SetDatfile, which looks like this:

This one action has a LOT of uses, but for my purposes I'm going to choose the following options:

Datfile = units.dat
Object = the unit you want to give the "rank" to.
OffsetName = Rank/Sublabel
DValue = this is a dropdown menu of all the ranks, which you will have modified to the string of your choice in the steps above.
Now, save your settings, boot up the game, and behold:

My Terran Zerg Defiler High Templar abomination can be Stunned! This can be turned off and on with triggers via Death Counters! For extra effect, you can modify two ranks to identical strings with different colours, then use death counter timers to toggle between the two strings, to create a flashing text effect! This will be handy to let the player know they've been stunned, or frozen, or poisoned, or whatever!
DAY & NIGHT SYSTEMS, BLINDING EFFECTS, ETC.
Say goodbye to using Medics blinds and burrowed units to modify vision radius, we have some handy new tools we can use which make them completely redundant.
In TriggerEditor use the SetDatfile EUD action, which looks like this:

Now select units.dat, the unit whose vision radius you want to modify, and select SightRange, and then choose an integer, with 1 being the smallest SightRange (comparable to a burrowed unit). For me, it now looks like this:

Now, when I open my map, you can see my new vision radius:

Now, there is another EUD action we can use, called SetLight:

We can use this to increase or decrease the in-game brightness (it doesn't affect the UI, thankfully). This is perfect for creating a moody night-time atmosphere, or a dark cave, especially when combined with the above technique.
You can also use this action to create cinematic scene changes: fading to black, centering location to your next scene, then unfading. And of course, if the player gets blinded by some spell, you can decrease their vision radius or brightness.
Here is a GIF which demonstrates SetLight in action:
https://i.imgur.com/Y2JMQxC.mp4
Good luck, mappers!
Post has been edited 4 time(s), last time on Sep 29 2020, 6:16 pm by Oh_Man.