Hi awesome community!
I am working on a manufacturing screen to my upcoming never-seen-before MMF2 RTS-meets-Xcom marriage.
My current system consist of a fast loop that automatically reads available objects and their status, assigned engineers and such from a MagicDeque-array and creates strings and buttons at the right positions according to the manufacturing screens current position.
Alright, everything works. Though I am experiencing some difficulties formatting the string to fit the columns in the screen. (see attached image below)
If you know C++ or C, I am basically looking for a substitute for "/t", a command to type out a tab space.
Or is there any other shortcuts to solve my problem? Feels a little tedious to create strings and counters for every number for every screen in the game when I am already working with the numbers right in the array.
Above is my desired result, and below is the achieved result.
in c++ you wouldnt use \t for this kind of problem. in a console app i'd just use #include<iomanip> and the setw() and left/right allignments.
depending on how big the string is your outputting, you can put the correct amount of spaces in front of it.
ie. say your output range for the column is 5 and youre outputting the data "90"
since 90 is only 2 characters you would output 3 spaces in front of it. the fast loop would help here.
Actually Ben~, after a little fiddling around with the engine, your solution was the best way to go. Thank you!
I will put the game up as an ongoing project as soon as I got this manufacturing procedure working.
Thanks for the quick responses!
Awesome community!
It might also help though I'm a bit late; One workaround I've noticed, at least for doing a "Newline" or "/n" string, is to simply manually go into a string object, and edit one of its texts to simply be the result of hitting ENTER, hence its C equivalent would be a char array of "/n\0"; it is nothing but a newline. Then, whenever I need a Newline char inside of my code, since you can't add a /n or /t symbol due to some oversight in TGF/MMF, you instead just call that string objects data entry from the expression editor, and add that.
So I'm not entirely sure if TAB would also work, since its very program specific, but I imagine you could do this:
*create a new string object called "TABSpace", and set its single data entry to simple "(Tab)"
*When you need a tab in your expression, instead of trying to write "data entry " + " " + " data entry", you can write:
"data entry " + getstring("Tab", 1) + " data entry".
If you need to break for new lines, this will solve that problem too easily.