Welcome, Guest. Please login or register.
Did you miss your activation email?
September 20, 2024, 06:22:13 AM
Home Help Login Register
News: Trouble in Terrorist Town? Site here, forum here.

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: LANG keys in SWEPS
Pages: [1]
Author Topic: LANG keys in SWEPS  (Read 5943 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.011 seconds with 18 queries.