Underhell is a Half Life 2 Modification developed by Mxthe in collaboration with We Create Stuff. Underhell Prologue requires a Source Engine game to run, and Source SDK Base 2006 installed. Underhell Chapter 1 will require a Source Engine game to run, and Source SDK Base 2007 installed.
After hitting a hard limitation on the TITLES.TXT file, we have created our own system that allows us to not only create as many TITLES as we want, but also to save them and read them through multiple files.
Posted by Mxthe on Nov 7th, 2012
Underhell has text, a lot of text, Main Objectives, Secondary Objectives, Item Names, Area Names, Comments ect...
There are so many text entries, that the poor titles.txt file that is used to store localized text, stopped working!
It took us days to figure out exactly what was going on, and even after we figured it out, we realized we could not edit or increase that limitation, because the actual inner workings of this file are located inside a .DLL that was not included within the SDK Valve released.
So, we had to come up with a plan, and Charly did just that.
So, we had all the text already placed in the levels, already referenced in the multiple localized .RES files, so re-creating a new entity would have been more than a pain.
We discussed that the main problem was "Too Many Entries in ONE single file".
So even if we managed to re-create our own titles.txt file, we would still have an issue.
The engine would have to, search through the "pool" of text entries, and "fish" the one called by the game.
So as new Chapters would have been released, this pool of text would have kept growing and growing, therefore increasing text loading times at each display.
So, Charly came up with an idea, to "Slice" the files where the text would be call, into multiple files.
This not only makes calling texts faster, but it also allows people who want to create their own maps/stories to make their personalized text files they can include with the download.
Using only one UNIQUE titles.txt would have been a problem for all the people that wanted to create their own maps and add their own objectives, if everyone includes their own titles.txt, they will overwrite each other.
Through our new system, anyone can create their own titles file, and include it with the download.
Here's how it works :
First, go read the Env_Message section of the New Message Entities Inputs Tutorial.
The new titles system still uses our modded Env_Message entity.
Except it comes with a new twist.
This was the previous Target Parameter to enter, to display a message:
Here, we Input to the env_message to display the title "House_Comment_MusicBox"
If we enter this previous format, the engine will still look through the original scripts/titles.txt file.
Here's where the magic comes in, there is our NEW input with file specification :
Let's break this down shall we?
@YOURFILE.TXT = The @ tells the engine to look for specified the file in the Scripts folder.
_ = Is used as a String Parser between the File Search, and the actual message
House_Comment_MusicBox = The ACTUAL message entry within the specified file.
Not only does our new system works with the "InputMessage" input, but it also works with every other input we have modded into env_message, which are :
Now that we know how to CALL a message through a file, let's see how the actual file formatting is, for practical reasons, we have created our own format that allows us to choose unique styles for each entries.
Here is the format for "Titles_House.txt" :
Let's break THAT down :
Titles_House : The Name of the file
House_Comment_MusicBox : The Name of the Entry, to write in your env_message
positionx : The X position of the Display
positiony : The Y position of the Display
fadein : Message fade in time - per character in effect 2
fadeout : Message fade out time
effect : The Effect Number
// effect 0 is fade in/fade out
// effect 1 is flickery credits
// effect 2 is write out (objectives)
holdtime : Stay on the screen for this long
fxtime : This is the amount of time the highlight lags behind the leading edge of the text
r1 : Primary Red Value ( 0 - 255 )
g1 : Primary Green Value ( 0 - 255 )
b1 : Primary Blue Value ( 0 - 255 )
a1 : Primary Alpha Value (0 - 255 )
r2 : Secondary Red Value ( 0 - 255 )
g2 : Secondary Green Value ( 0 - 255 )
b2 : Secondary Blue Value ( 0 - 255 )
a2 : Secondary Alpha Value (0 - 255 )
Message : The Actual Message, enter #MessageName to localize through resource folder.
(Other Entries here)
} < End of file
So, as you can see, the format differs a bit from the original titles.txt, but the values are the same.
This new system allows for users who want to create their own adventures with their own comments/objectives to do so, without overwriting the original titles.txt file.
Everyone can now create his own, and link it through their env_message within the level.
As you can see in the "Message" field, we have entered "#Underhell_House_Comment_MusicBox" .
The "#Underhell_" part refers to the #Underhell_YourLanguage files that are located in the resource folders.
These language files are part of the Localization system.
If you want to create your own localized files for your levels, simply create a file called "YourLevelName_YourLanguage " and place it in the resource folder.
Say you want to create a Level called "Overheaven", you just need to create a file called Overheaven_English.txt in the resource folder, and in there create your English entries, which your Custom Titles will refer to.
So in the Message field, you will enter "#Overheaven_MessageName", and it will look for the message name within the file you have created.
This way, if someone wants to translate your level, all they have to do is copy "Overheaven_english" and rename it to "Overheaven_TheirLanguage and translate the content.