| 10-22-2003, 02:30 AM | #1 |
Hello, my friend and I are having a little trouble creating our TD. We are having a problem with strings being displayed through a "real" variable. When the text is displayed,( say if it was gold... "You recieved 4.000 gold!") It has a .000 on the end of it...Why is this, and how do we fix it? ALSO, there is a problem displaying a unit-type in a string... When the unit type is displayed, it would say: "custom_h00B - Level 5.000" or h00F...(it varies in ending letters) What the hell is going on? Can you help us out? |
| 10-22-2003, 02:41 AM | #2 |
Dont' use real variables for gold, use integer, as you can't harvest nor store 0.325 gold. |
| 10-22-2003, 02:45 AM | #3 |
Also, use the unit NAME not the unit STRING |
| 10-22-2003, 02:50 AM | #4 | |
Quote:
It's a TD, you're not harvesting...it's all even numbers, no .xxx and it's not only for gold, it's for the rounds number... |
| 10-22-2003, 03:52 AM | #5 |
If you only have whole numbers, use integers instead of real variables. Rounds, for example: You're not going to have half-rounds or quarter-rounds, right? |
| 10-22-2003, 06:47 PM | #6 |
Also, if for some reason you do need that to be a Real value, there are two kinds of Real to String conversion - I think the one you want is called "Convert Real to String with Formatting" or something... it lets you specify how many digits and how many digits after the decimal to display. |
| 10-22-2003, 07:36 PM | #7 |
you have to...well, define real variables to X number of digits and Y number of decimals.... so if X is 8 and Y is 2 it will look like Curent Level is : 1.00 (etc...) |
| 10-22-2003, 07:45 PM | #8 |
Like Ligature said its called "Conversion - Convert Real To Formatted String" and it gives your something like "String(yourtext, #, #) The first # specifies how many places you want it to go on the left of the decimal and the second # is for all numbers right of the decimal. So if you want it to not show the decimal places just set it to something like "String(yourtext, 9, 0)" The only problem I came across is that it still shows it like "186.0" but the 0 always stays a 0. I dont think you can get it to be a single digit with no ".0" on it so if you really need it changed you will have to figure out a way to use integers instead of real variables. |
