Welcome, Guest. Please login or register.
Did you miss your activation email?
November 21, 2024, 03:44:00 PM
Home Help Login Register
News: Zombie Master 2 discussion

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: LANG keys in SWEPS
Pages: [1]
Author Topic: LANG keys in SWEPS  (Read 5968 times)
spaceking
Poster

Posts: 4


« on: December 07, 2011, 04:08:18 AM »

Is it possible to add language keys like:

L.aw_dgl1_title = "It's Like A Tiny Rifle"
L.aw_dgl1_text  = "is getting the hang of the Desert Eagle and killed {num} people."

inside SWEPS?
Anonymous
Poster

Posts: 126


« Reply #1 on: December 07, 2011, 04:28:44 PM »

Derp.

Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #2 on: December 07, 2011, 07:06:44 PM »

Certainly. You can use the following anywhere outside a language file, as long as it's on the client (ie. use "if CLIENT then" where appropriate):
LANG.AddToLanguage(lang_name, string_name, string_text)


So like:
LANG.AddToLanguage("english", "my_text", "Here is some text")


One use for this is adding a proper name for ammo types that are not used in default TTT. Say you have a weapon using the "XBowBolt" ammo type (perhaps with a separate new custom ammo entity) so it doesn't share ammo with the default guns, and you want it to say "Wooden Sticks" when you pick up some of that ammo. You could add a language item by doing:
LANG.AddToLanguage("english", "ammo_xbowbolt", "Wooden Sticks")

When picking up ammo TTT looks for a language key called "ammo_<ammo type>", so it will find your definition and use the custom text in the little popup on the right side of the screen.
spaceking
Poster

Posts: 4


« Reply #3 on: December 09, 2011, 08:50:26 AM »

why thank you!
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: LANG keys in SWEPS « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.008 seconds with 17 queries.