Text is independent of the event system and can be called directly from the game. Though in most cases that is not a good idea as running through the event system allows for custom events interrupting with special text. Most of the time though when modding an event will be calling the text. Just like events text uses a label to know it was called and has lots of customization.
Probably the most important part of text is actually the images. Text is simple images not so much. Images are broken down into 5 locations (bg, fg, fgleft, fgright, and fgcenter.)
Right now the width / height or scale is kept by the fg, fgleft, fgcenter, and fgright and then centered. While the bg is always forced to fit the full screen. I may at a later date make this user choice. If you need this feature please say so.
Next up is how to call the images. There is a nice file by the name of
You don't have to use image replace you can just put in the direct file path to the images folder but I really would appreciate if you did. That way if the image moves we only have to change it once. Also I screw up paths with the wrong .jpg or and an s or what ever so having to put it in once means that its easier to fix and you know where it is. ( I probably shouldn't mention it but you can use the image replace command in any of the text system files... but please don't.)
name = "#realestatebg" -- the label called
file = "shop/realestate/realestatebg.jpg" -- where the image is looking in the image director libs/otherlib/image
That's all there is for image replacement.
Now just as important text replacement... There are two types varreplace where you replace variables and replacer where you replace text.
A variable replacement the gold and a name replacement example.
First off replacer, its damn simple you put in a search and return a replacement. File is
though it actually works in any of the loaded in text files. But still keep the standards, it saves us from problem like misspelling Setra multiple times and then having to find it over and over and over... not that happened...
xml is so simple no reason to really worry about it.
search = "#showchange" --- what we are searching for
rep = "makechange" --- what we are changing too
Now on to variable replace
So this work exactly the same and is covered in events since they use the same things. No reason to rebuild a wheel. Really modders should probably ask me before adding these as misspellings or even bad capitalization will CRASH THE GAME! That's why I have done dozens already for you guys. File is at...
search = "#gold" -- label we are looking for
rclass = "GameData" -- The class
rep = "charGold" -- The variable in the class
name = "Gold" -- Used by the after points changes more on that in a second.
And there is still another variable replacement. No really on the fly variables those pesky ones made by modders they might want to display those too. Okay now there is a very important rule about these as a matter of fact two.
1) You can't use "#". That's a key word that is a variable replace and if used here crash.... maybe or it won't work.
2) Make sure it's unique or the text editor may end up replacing your variable everywhere.
File is at
Though of course that's a lie it can be added to any EVENT!!! xml file. That's right its not directly part of the text system because there variables created by the event system.
label = "fatiguework" --- the search label
vvar = "33" --- the starting value
Okay just one more type of replacement and that is stat changes. Which is all done internally for I hope are obvious reasons, all you have to do is add the key word, "#showchange".
That was a lot of options and explanations and we still haven't even made a single text fire in the game yet.