Jump to content

Display text instead of a number for a cvar value?

Recommended Posts

Hey, all. I was wondering if this was possible to do in XML only. (I don't want to write custom C# code for this.)


Let's say you have a cvar that represents a number that can be expressed by a tier. Example:


  • if myVar < 1, tier = "Low"
  • if myVar < 2, tier = "Medium"
  • ...etc.


Is there any way to display the "Low", "Medium", etc. string instead of the cvar's numeric value?


I'm especially looking for some way to do this with buffs, as a replacement for the "display_value" property - unless there's a way to get that property to display strings instead of numbers. (EDIT: I'm also aware that "display_value_key" can make it display non-numeric characters, but it can only accept standard C# string formatting.)


Ideally I would also like some way to display this in the character stats window as well. Right now I am using "{cvar(myVar:0)}" but that displays the numeric value.


Any ideas?

Edited by khzmusik (see edit history)
Link to comment
Share on other sites

  • khzmusik changed the title to Display text instead of a number for a cvar value?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...