Home   Help Search Login Register  

Author Topic: grrr..cant figure it out...  (Read 1053 times)

0 Members and 2 Guests are viewing this topic.

Offline ONoSixIsDown

  • Members
  • *
grrr..cant figure it out...
« on: 13 Nov 2005, 18:59:11 »
Hi all, im new here at OFPEC and i hope one of you can/will help me.

I'm trying to figure out how to simulate speach from units during cut scenes by using the "effects" part of triggers.  What i can't figure out is why the text I enter always comes out in one long line, cutting off most of the text i want displayed.

 How can i have a unit say a few sentences (using the above method) with out most of it ending up off screen.

Also, is there a better way to do this? I've read dozens of tuts but have been unable to find the info i need.

thanks
CRIMSON REIGN COMMING..... eventually :/

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:grrr..cant figure it out...
« Reply #1 on: 13 Nov 2005, 19:15:29 »
Firstly,

Welcome to the forum!

Secondly, in general when you want to separate speech (or any other text) into several lines on the screen, use /n.   Or \n.   I can never remember which.

Thirdly, there are lots of ways of doing what you want.   BIS used gamelogics and waypoints to control conversations.   Many people use scripts.     Using triggers isn't very easy, as you are discovering.

To see a working example of the script method download the Tutorial Mission from the Editors Depot and look in there.   (You'll find lots of other useful stuff there too.)    For working example of the gamelogic method unpbo practically any BIS mission.  (Use Amalfi's pbo decryptor 1.5 from the Editors Depot to unpbo the BIS stuff.)
Plenty of reviewed ArmA missions for you to play

marcus3

  • Guest
Re:grrr..cant figure it out...
« Reply #2 on: 13 Nov 2005, 19:17:50 »
Welcom OhNoSixIsDown  :wave:

I could make a small script for you u, if you want. but if not.
try makeing a few more triggers, then spliting up the text. like
trig1 = hello my name is bob, i have to tell you something
trig2 = you mom wants you to come home for dinner

or try useing game logics, there is a tut in the editors depo i think.
hope this helps!

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re:grrr..cant figure it out...
« Reply #3 on: 13 Nov 2005, 19:22:19 »
Probably a better way would be to define all the texts you need in a special file called description.ext and then use titleRsc command to show the text when you need it.

An example of description.ext:

Code: [Select]
#define FontS "tahomaB24"
#define FontM "tahomaB36"
#define FontHTML "courierNewB64"
#define FontHTMLBold "courierNewB64"
#define FontMAP "courierNewB64"
#define FontMAIN "SteelfishB64"
#define FontMAINCZ "SteelfishB64CE"
#define FontTITLE "SteelfishB128"
#define FontTITLEHalf "SteelfishB64"
#define FontBOOK "garamond64"
#define FontNOTES "AudreysHandI48"

#define CT_STATIC   0
#define CT_HTML      9

#define ST_LEFT         0
#define ST_RIGHT      1
#define ST_CENTER      2
#define ST_UP         3
#define ST_DOWN         4
#define ST_VCENTER      5

#define ST_SINGLE      0
#define ST_MULTI      16
#define ST_PICTURE      48
#define ST_FRAME      64

#define ST_HUD_BACKGROUND   128
#define ST_TILE_PICTURE      144
#define ST_WITH_RECT      160
#define ST_LINE         176

#define ST_SHADOW      256
#define ST_NO_RECT      512

class RscPicture
{
   type = CT_STATIC;
   idc = -1;
   style = ST_PICTURE;
   colorBackground[] = {0, 0, 0, 0};
   colorText[] = {1, 1, 1, 1};
   font = FontS;
   size = 0;
};

class RscText
{
   type = CT_STATIC;
   idc = -1;
   style = ST_LEFT;
   h = 0.04;
   colorBackground[] = {0, 0, 0, 0};
   colorText[] = {1, 1, 1, 1};
   font = FontS;
   size = 1;
};

class RscBackground
{
   type = CT_STATIC;
   idc = -1;
   style = ST_LEFT;
   colorBackground[] = {0, 1, 0, 1};
   colorText[] = {1, 1, 1, 1};
   font = FontS;
   size = 0;
   text = "";
};

class RscHTML
{
   type = CT_HTML;
   idc = -1;
   style = 0;
   colorBackground[] = {1, 1, 1, 1};
   colorText[] = {0, 0, 0, 1};
   colorBold[] = {0, 0, 0.2, 1};
   colorLink[] = {0.4, 0.4, 0.8, 1};
   colorLinkActive[] = {0.8, 0.35, 0.48, 1};

   class H1
   {
      font = FontHTML;
      fontBold = FontHTMLBold;
      size = 1.0;
   };
   class H2
   {
      font = FontHTML;
      fontBold = FontHTMLBold;
      size = 0.7;
   };
   class H3
   {
      font = FontHTML;
      fontBold = FontHTMLBold;
      size = 0.5;
   };
   class H4
   {
      font = FontHTML;
      fontBold = FontHTMLBold;
      size = 0.4;
   };
   class H5
   {
      font = FontBOOK;
      fontBold = FontBOOK;
      size = 0.6;
   };
   class H6
   {
      font = FontNOTES;
      fontBold = FontNOTES;
      size = 0.7;
   };
   class P
   {
      font = FontHTML;
      fontBold = FontHTML;
      size = 0.47;
   };
};

class RscTitles
{
   
   class Text1
   {
      name = "Text1";
      duration = 2;
      idd = -1;
      movingEnable = false;
      
      controls[]=
      {
         name1
      };
      
      class name1 : RscText
      {
         style = ST_MULTI + ST_CENTER + ST_NO_RECT + ST_SHADOW;
         lineSpacing = 0.9;
         text = "September 18th 2004\n\n0300 HRS\n\nNovosibirsk";
         x = 0.0; y = 0.76; w = 1; h = 0.1;
         colorText[] = {0.8, 0.8, 1.0, 1};
         font = FontS;
         sizeEx = 1.5 * 0.1;
         size = 0.7;
      };
   };

class Text2
   {
      name = "Text2";
      duration = 2;
      idd = -1;
      movingEnable = false;
      
      controls[]=
      {
         name1
      };
      
      class name1 : RscText
      {
         style = ST_MULTI + ST_CENTER + ST_NO_RECT + ST_SHADOW;
         lineSpacing = 0.9;
         text = "Russian military compound\n\nScud missile production";
         x = 0.0; y = 0.76; w = 1; h = 0.1;
         colorText[] = {1.0, 1.0, 1.0, 1};
         font = FontS;
         sizeEx = 1.5 * 0.1;
         size = 0.7;
      };
   };

};

(in this example is probably also stuff you don't need, but well it's a working file)

An example of script line which shows the text that was defined in description.ext:

Code: [Select]
titleRsc ["text1", "PLAIN"]
If you look closely to the part in description.ext where I defined text:

Code: [Select]
text = "September 18th 2004\n\n0300 HRS\n\nNovosibirsk";
you can see that there is \n in middle of the text. That means a linechange. Experiment with it and you'll find it easy to use for sure.

When you need more texts, add more "class Textblahblah" sections. Make sure you give them separate names and pay special attention that you get all the curled braces right. You need to have them in pairs in your description.ext file.
« Last Edit: 13 Nov 2005, 19:23:08 by Baddo »

marcus3

  • Guest
Re:grrr..cant figure it out...
« Reply #4 on: 13 Nov 2005, 19:25:45 »
that seems kinda hard for a new guy. :-\ dont u think? :P
« Last Edit: 13 Nov 2005, 19:26:06 by Big Boss Marcus »

Offline ONoSixIsDown

  • Members
  • *
Re:grrr..cant figure it out...
« Reply #5 on: 13 Nov 2005, 19:33:57 »
first off thanks for the uber quick reply's.. its very encouraging.  and yeah, that is a bit much for me being a newb when it comes to scripting. but, the whole "/n" thing just relieved a lot of frustration.   ;D im still learning to understand the script language and how it works so the real big quote is still giberish to me. And as far as screwing around with the description files....i dont thing im ready for that yet.  But soon enough, im sure, i'll get more accustomed to it all.

thanks again.
« Last Edit: 13 Nov 2005, 19:35:23 by OhNoSixIsDown »
CRIMSON REIGN COMMING..... eventually :/

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re:grrr..cant figure it out...
« Reply #6 on: 13 Nov 2005, 19:35:04 »
that seems kinda hard for a new guy. :-\ dont u think? :P

No, it is not hard.

An example script file which shows the two texts in my example:

Code: [Select]
titleRsc ["text1", "PLAIN"]

; have a 6 second delay between texts
~6

titleRsc ["text2", "PLAIN"]

Save this as a script file, like showText.sqs and then use the normal way of executing script files to show the two texts.

I think it's not hard. Playing with triggers is harder and more confusing, imho. If you try to do long conversations with triggers, it gets confusing fast because you would need alot of triggers and make them trigger at correct times. Writing a script file and adjusting the needed delays in that script file is much clearer, because all needed stuff is in the script file and in description.ext, and your mission editor does not clutter up with zillions of triggers.

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re:grrr..cant figure it out...
« Reply #7 on: 13 Nov 2005, 19:35:41 »
first off thanks for the uber quick reply's.. its very encouraging.  and yeah, that is a bit much for me being a newb when it comes to scripting. but, the whole "/n" thing just relieved a lot of frustration.   ;D im still learning to understand the script language and how it works so the real big quote is still giberish to me. And as far as screwing around with the description files....i dont thing im ready for that yet.  But soon enough, im sure, i'll get more accustomed to it all.

thanks again.


\n

Offline ONoSixIsDown

  • Members
  • *
Re:grrr..cant figure it out...
« Reply #8 on: 13 Nov 2005, 19:39:44 »
 ;D ;D ;D

yeah..... that hit the spot.. thanks
CRIMSON REIGN COMMING..... eventually :/