Senior Member
Volunteer Data File Author
Join Date: Oct 2011
Posts: 121
|
Quick question. I was bouncing some ideas for improvements to my data files around in my head and was wondering if it is possible to have a script modify the name of an entity (say pre-pend a special character) based on a tag (specifically having a tag from a specific group). This adjustment to the name should be cosmetic only and not affect sorting and so forth.
The purpose of this change would be to help less knowledgeable users identify entities with this particular property. If it can't be done without affecting sorting, I can just add the special character to the end (not ideal, but workable). What script would do this? I'm assuming it would be one of the global ones, but it's outside the scope of what I've had to do before or any examples or documentation I've seen. Thanks, ~Antares My code doesn't have bugs; it has undocumented features! |
#1 |
Senior Member
Join Date: May 2012
Posts: 206
|
Is fairly straight forwards to do
1. Set up a string in the def file (that way round if anyone translates the file to another language then they only have one place to change it) - example name strChange 2. Script in the postscript section: if (tagis[tagGroup.tagName] > 0) then name = name + $strChange endif That will add it to the end, reverse order to put at start, add a space character or use a string to represent a space. Changing the name will change the sort order though when the user clicks to order by unit name. If you wanted it to affect all units with that tag then drop the script in the entity done section My own Warlord Games gallery and the home of the Warlord Games datafiles: http://www.facebook.com/ABDataFileWarlordGames |
#2 |
|
|