Home   Help Search Login Register  

Author Topic: format command in titleRsc  (Read 1302 times)

0 Members and 1 Guest are viewing this topic.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
format command in titleRsc
« on: 31 Aug 2004, 15:28:59 »
Below is an extract from my description.ext.   It works perfectly except for one thing.    The format bit:   what appears is the text

format ["Use ..... etc

Whereas of course what I want is

Use your .... etc

but with the correct number in the appropriate spot.     I can do it fine with a titletext ... I've tried every combination of format text = that I can think of but no luck.   Does anybody know the correct syntax, or indeed if it works at all?

Many thanks.



 class change2
   {
   name = "change2";
   duration = 6;
   idd = -1;
   movingEnable = false;
   controls[]={name1};
         
   class name1 : RscText
   {
    style = ST_MULTI + ST_CENTER + ST_NO_RECT;
    lineSpacing = 1.0;
    text = format ["Use your radio to make a choice . . .\n\nYou may end the mission now:\n\nor continue until you have kicked the %1 remaining Americans off Kolgujev.", count WestList]";
         x = 0.05;
         y = 0.5;
         w = 0.9;
         h = 0.8;
         colorText[] = {1.0, 1.0, 0, 1};
         font="SteelfishB128";
         size = 0.6;
       };
   };
Plenty of reviewed ArmA missions for you to play

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:format command in titleRsc
« Reply #1 on: 31 Aug 2004, 15:50:12 »
It's Rsctext, n00by. :tomato: I'll give you an answer in a sec, just gonna dig up my dialog.

:beat: *Gets Shot* :beat:

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:format command in titleRsc
« Reply #2 on: 31 Aug 2004, 15:52:17 »
There ya go. I use the line in a script. Don't think it'll work directly in description but I ain't sure.

ctrlsettext [_number, format["%1", _mags]]

:beat: *Gets Shot* :beat:

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:format command in titleRsc
« Reply #3 on: 31 Aug 2004, 16:09:56 »
Sorry, I don't quite follow.   Could you elaborate?    I don't understand any of this type of stuff, I limit myself to copying and pasting and changing the words.

For the avoidance of doubt this is just text on the screen, its not a dialogue.


PS - forget LCD's mission and concentrate on helping me with MINE!!    ;D
« Last Edit: 31 Aug 2004, 16:11:37 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:format command in titleRsc
« Reply #4 on: 31 Aug 2004, 16:14:00 »
Okedoke,

first you gotta give yourself and ID. Do that in name1, something like this:

class change2
  {
   name = "change2";
   duration = 6;
   idd = -1;
   movingEnable = false;
   controls[]={name1};
         
   class name1 : RscText
   {
    style = ST_MULTI + ST_CENTER + ST_NO_RECT;
    lineSpacing = 1.0;
    IDC = 101 <==== HERE
    text = format ["Use your radio to make a choice . . .\n\nYou may end the mission now:\n\nor continue until you have kicked the %1 remaining Americans off Kolgujev.", count WestList]";
        x = 0.05;
        y = 0.5;
        w = 0.9;
        h = 0.8;
        colorText[] = {1.0, 1.0, 0, 1};
        font="SteelfishB128";
        size = 0.6;
      };
  };

Now, you have to ID which is 101. Simpley, you wanna use my line yeh? Add that ID instead of _number and add your own text. Like this:

ctrlsettext [101, format["Macca got %1 on his %2",birdpoop,head]

NOTE: TWO CONTROLS CAN NOT HAVE THE SAME IDC!!

That is all. 8)

:beat: *Gets Shot* :beat:
« Last Edit: 31 Aug 2004, 16:15:07 by The Real Armstrong »

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:format command in titleRsc
« Reply #5 on: 31 Aug 2004, 16:23:36 »
LMAO Macca, I'm LCD and I must follow.

He's calling me traitor now on MSN. :P

Check my personal text. ;D

:beat: *Gets Shot* :beat:

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:format command in titleRsc
« Reply #6 on: 31 Aug 2004, 16:25:01 »
Oh, and you can't use \n in rsctext. :-\

:beat: *Gets Shot* :beat:

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:format command in titleRsc
« Reply #7 on: 31 Aug 2004, 17:12:33 »
 ;D  It's LCD I pity.

No luck, I'm afraid.    I added back the missing ] and temporarily binned the format stuff till I got ctrlSetText working.     However, what ever I do, it still prints the original text.   If I lose the text line altogether I get an error box saying there's no text line.

I've added the ctrlSetText command to both script and description file without effect.

Am I missing something stupid?  Or do we need to define something else in description.ext?    Or does it only work in dialogues?

Forgot to say I've been calling the thing with

titleRsc ["change2","plain",2]

How should the titleRsc command relate to the ctrlSetText command?   Before?   After?   Instead of?   Doesn't matter?
The \n bit doesn't matter, I can deal with that.
« Last Edit: 31 Aug 2004, 17:15:46 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:format command in titleRsc
« Reply #8 on: 31 Aug 2004, 17:15:11 »
Code: [Select]
text = format ["Use your radio to make a choice . . .\n\nYou may end the mission now:\n\nor continue until you have kicked the %1 remaining Americans off Kolgujev.", count WestList]";
Is there an extra " affter the ] That should not be there?

Maybe the extra " is messing it up?

Try it without the " at the end of the line.

Code: [Select]
text = format ["Use your radio to make a choice . . .\n\nYou may end the mission now:\n\nor continue until you have kicked the %1 remaining Americans off Kolgujev.", count WestList];
« Last Edit: 31 Aug 2004, 17:15:58 by Raptorsaurus »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:format command in titleRsc
« Reply #9 on: 31 Aug 2004, 17:16:42 »
yea dats it.... he didnt complete ma dialog yet.... wich means im delyin da next version till tomoz  :-X  :'(

nd he doesnt wanna let me talk w/ his sis ::) she swedish i gotta talk 2 her ;) ;D

armsty ya bitch... help macca n finish ma dialog right now :P

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:format command in titleRsc
« Reply #10 on: 31 Aug 2004, 17:19:57 »
Tried that Raptosaurus, thanks, no joy.

The good news is that the \n bit is working fine.

Plenty of reviewed ArmA missions for you to play

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:format command in titleRsc
« Reply #11 on: 31 Aug 2004, 17:47:20 »
I have great doubts that the format (or any other) would work in this situation as description.ext is read first when the mission is loaded, and probbaly not read another time after that...

But this is just 'afaik'... :P

You could also try to use the format style thing in the stringtable.csv and have the text= be 'picked up' from there... Can't remmenber how exactly this would be done, but I think there was a question about this in here 'relatively' recently...
Still the upper would probably rule this out, but this's just a thought...

Would that ST_MULTI have anything to do with the \n working ??
As I have not had luck with titleText/Rsc and \n...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:format command in titleRsc
« Reply #12 on: 31 Aug 2004, 18:22:52 »
Thanks HateR_Kint.... you kinda put into words what I was thinking.  It's not a big deal, I can just miss it out and present the information some other way.

I have no idea about the \n except that it's working in that example.   I just copied the ST_MULTI stuff from somewhere, I have no idea what it does.
Plenty of reviewed ArmA missions for you to play

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:format command in titleRsc
« Reply #13 on: 31 Aug 2004, 18:59:19 »
Could you post the line you're using along with the format command?

:beat: *Gets Shot* :beat:

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:format command in titleRsc
« Reply #14 on: 31 Aug 2004, 19:14:31 »
This doesn't work.  Or rather, it gives the text defined in description.ext.

In the script:

ctrlsettext [101, "Use your rhaining f Kolgujev."]
titleRsc ["change2","plain",2]
ctrlsettext [101, "Use your rhaining f Kolgujev."]


In description.ext

 class change2
   {
   name = "change2";
   duration = 10;
   idd = -1;
   movingEnable = false;
   controls[]={name1};
         
   class name1 : RscText
   {
    style = ST_MULTI + ST_CENTER + ST_NO_RECT;
    lineSpacing = 0.8;
                 IDC = 101
    text = "Use your radio to choose . . .\n\nend the mission now :\n\nor continue until you have kicked the remaining Americans off Kolgujev.";
    x = 0.05;
         y = 0.5;
         w = 0.9;
         h = 0.9;
    colorText[] = {1.0, 1.0, 0, 1};
    font="SteelfishB128";
    size = 0.55;
   };
   };
Plenty of reviewed ArmA missions for you to play