Halomods Community Portal: Hud messages and strings (specifically, custom control name strings) - Halomods Community Portal

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Hud messages and strings (specifically, custom control name strings)

A basic tutorial.

#1 User is offline   TCK 

  • Script, AI, UI widgets, cutscenes, solo gameplay.
  • PipPipPip
  • Group: Members
  • Joined: 05-May 11
  • LocationSC

Posted 07 May 2011 - 09:39 PM

Hud Messages:

Go, in data, to your map's path in tags (e.g. if your scenario is in "tags\levels\test\map_name\your_scenario" then go to "data\levels\test\map_name\"). In here make a new text file, but save it as "hud messages.hmt" (make sure to change the "save as file type" to "all files" so that it is not saved as "hud messages.hmt.txt") and change the encryption type to unicode. Exit out, delete the .txt, and open the .hmt file. This is where you can type messages to be displayed in-game. You type the message name, equals sign, then the message text. Each message and its name should be on one line, and every new line begins a new message. The format is demonstrated below:

message1=Your message goes here and can have caps and punctuation.
message2=A new line begins a new message such as this one.

Now, this can be changed and updated any time you like during map creation, so don't worry about putting in every single message on the first time. For now just type some messages you think you will use towards the beginning of your map (Give them each a different name of course!), then save and exit.

Go to tool and type in the following, (do not type brackets < >)

tool hud-messages <path in data> <scenario name>

For example, if my map's scenario in tags was called "custom" and my hud messages were under "data\levels\test\my_map" I would type this:

tool hud-messages levels\test\my_map custom

Now it should list your file name (hud messages) and should list what they say. If it didn't then read to find out if it had any errors and what they were. If it didn't say anything, then you either typed in the command wrong, or made a mistake in format/file placement, etc. Just redo it and be careful to follow all the steps.

If it succeeded however, as it should have, open your scenario in sapien and click "mission" in hierarchy view. Over in the properties view, scroll down until you see a box labeled "hud messages" and it should already have a path in that box.

If so, it means you are ready to put them in-game. Open your script (I'm assuming you already are making a script if you are making a solo map) and it is this easy to add them: wherever you want a message show up, just add the command (hud_set_help_text <message name>).

There is one other thing: these are not enabled by default, so before you have any messages shown you must put the command (show_hud_help_text true). After you have shown all the text you want the player to see for one part, just add the command (show_hud_help_text false) because they do not disappear automatically.

These messages can also be displayed as objectives in the pause menu, with the command (hud_set_objective_text <message name>) except they are shown by default, so there is no other command needed to display them.

Custom Control Names (and strings in general):

These are used for the text you see when you walk up to a control panel, or can also be used for the text of entering vehicles and picking up weapons (I'll talk about that afterward). First, anywhere in data, create a new text file and name it whatever you want it to be called. In the text file, go to file > save as and leave everything the same except change the encryption to "unicode" (yes, you leave this one as a .txt!). These things are simple as hell to set up. As with the last kind, each should be on only one line, and the next line should have the string ending denotation, as demonstrated below:

This is the first string; they can have capitals and punctuation.
This is my second string.

Now, the words you type here will be displayed right after the word "to" when you walk up to something. For instance, "Hold <key> to <string>".
Again, these can be updated at any time, so don't worry about getting in all the strings you will need on the first try.

Go into tool and type the following:

tool unicode-strings <path of data folder containing text file>

So for example, if my strings' path was data\custom_hud\custom_strings\my_strings.txt I would type this:

tool unicode-strings custom_hud\custom_strings

Now it should tell you your file name, and the number of strings that are in the file. If it tells you nothing, just says "couldn't read toolbeta blah blah", then make sure you typed the correct file path. If it tells you your filename but says there are 0 strings, then make sure you have them set up correctly.

If it succeeded, go into Sapien and select "mission" in heirarchy view. Then in properties view, scroll down until you see "custom object names". Click the three dots and find your unicode_strings_list in tags. Now you can go into your controls and set the custom control name! (also in sapien).

--- Credit to Kvasir, figuring this all out was a joint op between us way back when.

#2 User is offline   Gary 

  • ¬ 1337
  • Group: Moderators
  • Joined: 05-May 11
  • LocationMelbourne, FL

Posted 07 May 2011 - 10:28 PM

Looks good, but could use some code/ tags.

#3 User is offline   TCK 

  • Script, AI, UI widgets, cutscenes, solo gameplay.
  • PipPipPip
  • Group: Members
  • Joined: 05-May 11
  • LocationSC

Posted 07 May 2011 - 10:49 PM

Done :)

Share this topic:

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users