Home   Help Search Login Register  

Author Topic: stringtable tutorial  (Read 8446 times)

0 Members and 1 Guest are viewing this topic.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
stringtable tutorial
« on: 18 Nov 2005, 18:56:55 »
Here is the first draft of a simple stringtable tute.     I haven't tarted it up yet, what I'm interested in at present is facts.     Any howling errors?   Have I missed anything useful?

An example stringtable is included.

And yes, there is a stringtable tutorial already in the Ed Depot but it is very old and has been described as "a bit like describing New Jersey to someone living on the Sun".

Many thanks.


Edit 19 Nov - New version up (0.2)

Edit 21 Nov - New version up (0.3)

Edit 23 Sep 06 - New version up (0.5 recovered)


[attachment deleted by admin]
« Last Edit: 26 Sep 2006, 12:36:02 by macguba »
Plenty of reviewed ArmA missions for you to play

klavan

  • Guest
Re:stringtable tutorial
« Reply #1 on: 18 Nov 2005, 19:26:54 »
It's a good tute.
You should add that the mission maker can isert comments by adding a ; before the line. I find it usefull for organize the stringtable in sections, to avoid confusion between strings, like this example:

Code: [Select]
;----Intro-----
STRN_Int1,"Introduction","Introduzione"

;----Outro----
STRN_Out1,"Mission end","Missione finita"

Klavan


EDIT
Never mind me: after looking at the template file you've included I realized that they're useless!
It's a very good tute!  ;D
« Last Edit: 18 Nov 2005, 19:30:28 by klavan »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:stringtable tutorial
« Reply #2 on: 18 Nov 2005, 19:44:46 »
Yes stringtable is the "other way around" compared to script files.   Only stuff that is specifically called - that is, the stuff starting STR - matters.   You can chuck in anything else you want.  In fact you can chuck in stuff starting with STR as long as you don't call it.
Plenty of reviewed ArmA missions for you to play

Offline Mikero

  • Former Staff
  • ****
  • ook?
    • Linux Step by Step
Re:stringtable tutorial
« Reply #3 on: 19 Nov 2005, 01:13:25 »
I would strongly recommend you delete all mention of Micro$oft Excell except to point out not to use it

That )(&*)#(@@)(_$#@ program is the single reason why people are finding this incredibly straightforward file so difficult to understand.

The *best* method is to simply., and, I mean ,simply, use notepad and organise each value in TAB space columns, just as $#@)(&)($#@ Excell tries to do and makes such a $#)(*_##$_+ MESS OF.

There is a total misperception out there that stringtable.csv is a micro$soft inspired device. These files, this format, has been around the industry since the year dot.

sorry for the flame'ish manner Mac, that's not intended, but that $#_*_#$ program has caused 90% of the problems.
----

Other comment is that there are (now) two reasons for using csv

first is the obvious, it is the easiest by far manner to allow translations.

but the 2nd, and nowadays critical reason for using csv is that all strings can be in one place. In the 'good old days' where we were lucky to get a mission that lasted longer than 2 minutes, it didn't matter muchly. Nowadays, with upwards of thirty script files used in some missions to say nothing of separate folders, it's essential, to look in one place only.
Just say no to bugz

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:stringtable tutorial
« Reply #4 on: 19 Nov 2005, 08:14:03 »
So that's how it's done! Cheers mac ;)

As for setting all the scripts' paths and such, I normally reserve that as the init.sqs 's prerogative. Actually, I never thought to look for paths and names in the string table before, but I guess it's possible to define them there. Is it a good idea though? Also - what is wrong with excel for stringtable editing?

klavan

  • Guest
Re:stringtable tutorial
« Reply #5 on: 19 Nov 2005, 10:41:50 »
Here's another syntax example with the localize command you could add:

hint format [localize "STRN_Stat_1", _value1,_value2]

The string should appear as something like:

STRN_Stat_1,"The variables values are %1 and %2","I valori delle variabili sono %1 e %2"

In addiction you could add that with the stringtable you can define the markers name too, by adding @STRN_StringMarkerName1 in the text field of the marker in the mission editor.

Klavan




Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:stringtable tutorial
« Reply #6 on: 19 Nov 2005, 11:50:43 »
@mikero - I've already edited it to make these two benefits clearer.  As for Excel, you're probably right ... however that's what I use and once I'd got over the little foibles I found it very easy.   However I will rebalance the text on this point.     And as for the flamish manner ... well I'd expect nothing else.  ;D

I don't understand what you mean about tab space columns though.  I thought the whole point was that things were seperated by commas?

@Fragorl, yes I suppose you could put script paths in there and then get them out, but that's too advanced for me and this tute.  This is just to get you started.

@klavan, thanks for that, it's going in.

More examples welcome.
« Last Edit: 19 Nov 2005, 11:59:56 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:stringtable tutorial
« Reply #7 on: 19 Nov 2005, 15:13:45 »
New version (0.2) up, comments welcome.      Grab it from the first post.

@mikero, I nicked all the main points from your tute and added you as joint author.     Assuming you're happy with that concept, please make any edits you want.   If not then I apologise for my presumption and I'll make you an acknowledgement.    (Which reminds me, I forgot to put klavan in.... done for next version.)

I don't understand the part about the first non-space character defining the text.   I had no trouble making an entry which started with a long line of spaces.   What am I missing?  In Notepad the entry looks like this

STR_OUTRO_14,                      Judge Roy Bean,                      Judge Roy Bean,                      Giudice Roy Bean,                                        Juez Roy Bean,                      Judge Roy Bean,                      Sêdzia Roy Bean,

and the spaces were picked up (via description.ext) and displayed - if that's the right word - on the screen.    I've never used .csv except in Excel, which is probably why I find using Notepad difficult.
« Last Edit: 19 Nov 2005, 15:16:05 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline Mikero

  • Former Staff
  • ****
  • ook?
    • Linux Step by Step
Re:stringtable tutorial
« Reply #8 on: 19 Nov 2005, 15:15:35 »
>I don't understand what you mean about tab space columns though.  I thought the whole point was that things were seperated by commas?

they are separated by commas. however, further to that, whitespace is stripped in the following manner

,"this is a text",
,       this is a text        ,

are identical. Therefore, the same results in notepad are generally achieved as Excel (eg) example

STR1,         English           ,  Pongolian
STR999,     More English  ,  More Pongolian
----
although often used, I have never seen a csv that requires quotes except in the rare instance of making commas transparent in text.
----
you can also have NO phrasing btwn commas. Even truncated commas (ie not as many as there are languages).

In which case, the engine takes the 2nd 'column' by default. Ie, for lack of any other, it will revert to the default, (English eg). This makes it exceptionally easy for a Hungarian to simply build a csv, in hungarian only and let someone else add to it, another language, when it suits.

Language, Hungarian

STR1, Ook?
STR2, More Ook?

other people can, add English, French, or whatever gives them a thrill. If they don't know a phrase, it doesn't matter, the hungarian will take it's place until it's sorted out.

----
also  comment on comments

ANY text (afaik) is a comment if the 1st three chars on a line don't begin STR. Exception is the 1st line of file (Language)

the reason why STR is a fixed in concrete label is that the engine knows to specifically look in STRingtable.csv as opposed to any other.

But, all in all Mac, I think you should keep the text to absolute basics so that people can grasp it's simplicity. Once they're over that, they can experiment for themselves. the format is exceptionally easy to understand, and very forgiving, if people wish to put complex statements between commans, then, fine, but it will mask the simplicity if you elaborate too much (imho)

Just say no to bugz

Offline Mikero

  • Former Staff
  • ****
  • ook?
    • Linux Step by Step
Re:stringtable tutorial
« Reply #9 on: 19 Nov 2005, 15:27:12 »
>joint author

absolutely. Best choice. I'll delete my little beast later on. *but* as you know I'm on a holy crusade to make up a series of File Format: topics :D.

is the bit about spacing cleared up? or do we have a problem. My statments are absolutely for certain cast in concrete garanteed for addons and any classname {} constructs. Sqs files which i know nothin about might be different. Did you actually mean

, "       Judge Roy Bean",

 ???
Just say no to bugz

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:stringtable tutorial
« Reply #10 on: 19 Nov 2005, 15:37:16 »
I understand what you are saying about spaces, and my gut feel is that you are right.   I'll need to look into that counterexample ... its cut and pasted from the stringtable for Unimpossible and appears in the Loose Outro.
Plenty of reviewed ArmA missions for you to play

klavan

  • Guest
Re:stringtable tutorial
« Reply #11 on: 19 Nov 2005, 16:11:48 »
What about an example mission?
Nothing more than some radio triggers.
Klavan

Offline Mikero

  • Former Staff
  • ****
  • ook?
    • Linux Step by Step
Re:stringtable tutorial
« Reply #12 on: 19 Nov 2005, 17:35:32 »
here is an example for an addon, if mac doesn't want to add 'examples' I'd agree with him but here it is anyway, because it's a typical example of how you can make an addon that a person in Pongolia can use in her language, not yours.

class MyGreatTruck: truck // use bis standard truck
{
 vehicleClass=$STREDITOR_MY_FANTASTIC_ADDONS;
 displayName=$STREditorArmoredTruck;
 armor=200000; // make it bulletproof
};

whatever is in the string for my_fantastic_addons, will be shown in the editor as a group name, for, all, my fantastic addons, in the language of the user, not me.

whatever an armored truck is called in Swahili, can be stated, in the csv for people making missions in Basutoland.

I have deliberately shown two distinct StylesOfLabelling.
---
Mac, the tute as it stands, is great. I love my name in lights, where you do all the work ;D
Just say no to bugz

Offline 456820

  • Contributing Member
  • **
Re:stringtable tutorial
« Reply #13 on: 19 Nov 2005, 21:37:24 »
i dont really feel like reading this all but you say the mission name should be put straigt nto the intel box but it can still be done using a stringtable IIRC BIS missions use it with the stringtable
anyway since im not in a paticular reading mood ill read through it a different time

but good idea i have often tryed to avoid stringtable.csv mainly becuase i didnt understand them

klavan

  • Guest
Re:stringtable tutorial
« Reply #14 on: 19 Nov 2005, 21:47:16 »
@456
I've made several attempts in doing so, but I've always failed. Seems like OFP doesn't recognize this. I currently run OFP with italian language, but all the missions appears with their english title, even (if my memory doesn't betrays me) they're defined in the .csv.  
Klavan