Nerd-Rage Modders
Nerd-Rage Modders
Nerd-Rage Modders
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Nerd-Rage Modders

Nerd-Rage Modders
 
HomeHomeSearchLatest imagesRegisterLog in

 

 Scripting: How to create and use string-files.

Go down 
AuthorMessage
Fixz
Admin



Posts : 18
Points : 1049
Join date : 2010-03-03
Age : 31
Location : Sweden - Julita

Scripting: How to create and use string-files. Empty
PostSubject: Scripting: How to create and use string-files.   Scripting: How to create and use string-files. EmptyWed Mar 03, 2010 3:41 am

First of all:
What is a stringfile? - I stringfile is a file that can store strings and such. Example is weapon names and those thing. these are there to simplify, mostly.

What is needed? - First of all, a good text-editor is needed. one like notepad++ is reccomended. you also need to mod tools.

Lets begin:

Start with navigating to:
"Call of Duty - World at War\raw\english\localizedstrings"

In there create a new text-document and name it "something.str"
remember to not use underlines "_" in the name.

Open it up with Notepad++, and then add.
Code:

// Note to translators:
// If a sentence is the same in your language then please change it to "#same"
//
// eg:
// LANG_ENGLISH  "HALT"
// LANG_GERMAN  "#same"
//
// (This is so we can tell which strings have been signed-off as ok to be the same words for QA
//  and because we do not store duplicate strings, which will then get exported again next time
//  as being untranslated.)
//
VERSION            "1"
CONFIG              "C:\cod5\cod\cod5\bin\StringEd.cfg"
FILENOTES          ""

REFERENCE          MYREFERENCE
LANG_ENGLISH        "This is my test-reference!"

ENDMARKER

in this example i use "MYREFERENCE" as my test-reference. the reference can be called anything, but avoid using underlines "_" in them.

when you wanna add another reference just simply make a line break and copy and paste your old.
Code:


// Note to translators:
// If a sentence is the same in your language then please change it to "#same"
//
// eg:
// LANG_ENGLISH  "HALT"
// LANG_GERMAN  "#same"
//
// (This is so we can tell which strings have been signed-off as ok to be the same words for QA
//  and because we do not store duplicate strings, which will then get exported again next time
//  as being untranslated.)
//
VERSION            "1"
CONFIG              "C:\cod5\cod\cod5\bin\StringEd.cfg"
FILENOTES          ""

REFERENCE          MYREFERENCE
LANG_ENGLISH        "This is my test-reference!"


REFERENCE          MYREFERENCE2
LANG_ENGLISH        "This is my second test-reference!"

ENDMARKER

the first lines of this file is just comments, and they are not really needed.

now you need to include your string-file to your fastfile, to do this simply add
Code:

localize,something
in my example i used "something" as my string-file-name.

Extras:
You can also add colors to your string-file. to do this simply add ^[number] in front of your text.
Code:

REFERENCE          MYREFERENCE
LANG_ENGLISH        "^1This is my test-reference!"

this will make your text appear red in game.
Code:

1 = Red
2 = Green
3 = Yellow
4 = Blue
5 = Cyan
6 = Magenta
7 = White
8 = Allies team-color
9 = Axis team-color
0 = Black

You can also add stuff like.
Code:


REFERENCE          PRESSUSETO
LANG_ENGLISH        "Press ^3&&1 ^7to do this..."


This will make this string appear like:
"Press F to do this..."
if you have bound another key to "use" then it will automaticly appear.

How and when to use string files:

I try to use string files as much as possible. cause it makes it easy for me to change something if i have to.
A good example for when you "have" to use string files is when you create a custom weapon.

at the start of the weapon file it looks like this:
Code:

WEAPONFILE\displayName\FILENAME_REFERENCE\
the display name uses a string-file. remember to use upper case on the reference and the file name.

if you want to include your "strings" to your script, simply add:
Code:

iprintln(&"FILENAME_REFERENCE");
Back to top Go down
http://www.xfire.com/communities/nerdragemodders/
 
Scripting: How to create and use string-files.
Back to top 
Page 1 of 1
 Similar topics
-
» Modding: How to Create Decals
» Mapping/Scripting: Teleporters.
» Photoshop: How to Create a Seamless Texture

Permissions in this forum:You cannot reply to topics in this forum
Nerd-Rage Modders :: User Tutorial's :: Modding Tutorial's-
Jump to: