Home   Help Search Login Register  

Author Topic: Stringtable related  (Read 1443 times)

0 Members and 1 Guest are viewing this topic.

Offline nettrucker

  • Members
  • *
  • Too young to die-OFP Campaign by TOY & nettrucker
Stringtable related
« on: 27 Oct 2007, 12:08:58 »
Hi everybody.
Gotta question concerning stringtables. I experienced that when camera is not pointed at the player stringtable text is not seen on the screen. So therefore I had to use a mix in an intro betwen Stringtables and game logic To do mostly all the text and audio stuff in my missions i'm using gamelogic I can position the text to be displayed really at the bottom of the screen using the \n command, meanwhile using stringtables it's not propperly at the bottom. Especially in intros with showCinemaborder = true. Is it possible in a way to lower the text on screen using the stringtable text?
Thanks for any idea.
regards
nettrucker  ::)

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Stringtable related
« Reply #1 on: 27 Oct 2007, 15:45:31 »
String-tables (stringtable.csv) are methods of storing multi-lingual text outside of your code. They have absolutely nothing to do with the display of text, though string-table text can be shown on the screen. Are you perhaps trying to use something like:
Code: [Select]
titleText (localize "STR_MY_STRING");
In which case you are asking a question about titleText (or whatever other command you are using to display the text), not about string-tables per se.

One issue with string-tables that might be causing you problems, though, is that string-tables are only updated when you save the mission, not when you run it. Thus, if you have added string-table entries and not saved the mission before you run it again, the strings would not be recognised and would just be displayed as "" (or nothing on the screen).
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline nettrucker

  • Members
  • *
  • Too young to die-OFP Campaign by TOY & nettrucker
Re: Stringtable related
« Reply #2 on: 29 Oct 2007, 22:14:37 »
Hello Spooner sorry for my late reply.
Yes i know about the main function (multi lingual text) of stringtables. I most probably expressed myself badly. I apologize for that.

Quote
titleText (localize "STR_MY_STRING");

Well with that command I had an error message on screen: I'll take a screenshot as soon as I can.

I still need to do some testing I'm also aware about the save mission issue. I saw yesterday a stringtable where the "\n\n\n2 command was used to lower the text on screen. i'll come back on that in case it works.
Anyway thanks for the heads up.
regards
nettrucker :D
« Last Edit: 29 Oct 2007, 22:16:37 by nettrucker »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Stringtable related
« Reply #3 on: 30 Oct 2007, 04:13:23 »
That wasn't meant as a suggested code, but rather an example of syntax, which, as you have now realised, had a very silly mistake in it (so no need for the screenshot) :whistle: It also assumes that you have STR_MY_STRING defined in the stringtable or it won't display anything.

Code: (display text at centre of screen) [Select]
titleText [localize "STR_MY_STRING", "PLAIN"];

Code: (display text near the bottom of screen (well, 25% of the screen from the bottom) [Select]
titleText [localize "STR_MY_STRING", "PLAIN DOWN"];

If you haven't already, I'd suggest you check up on stringtable.csv in the OFPEC tutorial. As far as your problem, newlines ("\n") embedded in a titleTxt (or cutText) message can be used to start new lines, so, if placed before the text, should have the effect of making the text appear lower on the screen. Perhaps if you actually gave an example of the code that you are trying to use?
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Stringtable related
« Reply #4 on: 30 Oct 2007, 10:34:32 »
If you can't get the \n\n commands to work while writing inside the stringtable itself (i.e. STR_MY_STRING, "Stuff\n\nother stuff",) then maybe you can put it into the titletext/hint command? Something like this:

Code: [Select]
Hint ("Top text \n\n\n" + localize "STR_MY_STRING + "\nbottom text!")
Since you can use + to add strings together happily :) A slightly cleaner version of the above would be something like:

Code: [Select]
_string = localize "STR_MY_STRING";
Hint ("Top text \n\n\n" + _string + "\nbottom text!");

Worth a shot!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline nettrucker

  • Members
  • *
  • Too young to die-OFP Campaign by TOY & nettrucker
Re: Stringtable related
« Reply #5 on: 30 Oct 2007, 11:13:16 »
Thank you both.
I'll try that first thing when I'm home from work and i'll let you know. Thanks for all the useful tips.
regards
nettrucker :D

Offline Cheetah

  • Former Staff
  • ****
Re: Stringtable related
« Reply #6 on: 30 Oct 2007, 13:36:25 »
This page may be worth a look. Chapter Stringtable of the OFPEC Beginners Guide  :cool2:
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline nettrucker

  • Members
  • *
  • Too young to die-OFP Campaign by TOY & nettrucker
Re: Stringtable related
« Reply #7 on: 30 Oct 2007, 14:23:57 »
Hi Cheetah

yeah I already read the tutorial you wrote. since the first time you pointed it out to me. well I actually wanted to know if I could lower the text of the string displayed on screen and as far as I understood it's possible with the \n\n\n\n command, just need to test that. Thanks anyway for pointing me to your tutorial which by the way is very good.
Regards
nettrucker :D

Edit: the \n\n\n command works perfectly in the strings. :D
« Last Edit: 31 Oct 2007, 23:49:54 by nettrucker »