Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question with .lang and global variables
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#2
RE: Question with .lang and global variables

This is not possible without a bit of a "hack" unfortunately.

Solution 1 - Lots of values in the lang files
The only way you can achieve this effect is to create entries for the values which the variable may hold. For example: If you wanted to track "money" you could reasonably get away with 0-9999 without taking up too much space. You will probably want to write a program (or use my lang tool) to generate the numbers though.

Assuming you then name the entries like "m<value>" in a category called money you would be able to access the vars by getting the entry of "m"+GetLocalVarInt("money").

This is just a crude example and will need to tweaking for your scenario. If you are using floats, convert it into fixed-point integer & scale. If you are using strings then the solution is much more context dependant. This solution isn't unreasonable though, i used it for "time" and a death counter in a currently unreleased map.

Solution 2 - Billboarding / Light display
The other solution is to display the value in a specific location. You can then use box-lights with a numeric/alphabetic gobo to display digits. You could do the same billboards or entities, activating the appropriate thing for each digit/letter.

This limits the display to specific locations though, which may not be what you are looking for - but you will be able to display much greater ranges of information using this approach without any space tradeoffs. Be wary of having too many (>1k) box lights though - if you are going to need a large display think about using something else.
04-02-2012, 02:26 AM
Find


Messages In This Thread
RE: Question with .lang and global variables - by Apjjm - 04-02-2012, 02:26 AM



Users browsing this thread: 1 Guest(s)