OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: ponq on 02 Jul 2004, 22:00:59
-
I'd like to have a text of more than 1 line in a text control in a dialog.
I've tried to /n or \n, but to no avail. Also the ctrl is set to multiline, but doesn't seem to make a difference.
Also, can I have scrollbars in the text ctrl (or attached/linked to it), so the player can scroll up and down the read all the text of the ctrl.
Any1 know how to do it?
-
There is a dialog tutorial in the Editors Depot.......by VectorBosun I think.
Planck
-
I know. Couldn't find what I need there.
Maybe you know how to?
-
If I remember correctly someone also did an addition to VectorBosons tutorial to cover bits that weren't covered.
I'll have a look and see if I can find it.
Planck
-
1) A guy that called himself crashnburn or summin like that made a function just what you want. Try contacting him (he's registred on the forum) and ask him if he wants to release the function the the ed depot function library.
2) Dunno, you can do it other ways like pressing a "Next Page" button or summin.
:beat: *Gets Shot* :beat:
-
I'll try to contact him, thnx.
Having a next page isn't really what I want.
I'm trying to show some kind of conversation in a dialog, with text added to the conversation over time. The new text should at the first line of the ctrl, the old text right below.
But if the player wants to read the old text, he could scroll down...well that's the idea.
My first question is more important though, so I'll see if CnB know something about this.
-
Dude, that's exactly why I know about this function. He realesed a dialog script, and I asked him if I can modify it for my own use to make it more advanced. He said sure. I'll see if I can dig it up, would still be better if we could contact CnB first though.
:beat: *Gets Shot* :beat:
-
great! ;D
PM sent.
-
I'm afraid he hasn't been on the forums for ages, try e-mailing or his Mod Forum. BTW, his mod looks really cool.
:beat: *Gets Shot* :beat:
-
OK......In case you still wanted to know.......
The other dialog tutorial is called 3D Dialog Tutorial and is by Igor Drukov.
Planck
-
Thanks Planck.
I also have "studied" that one already.
-
Sorry you guys but I don't have any knowledge of this. It must be someone else you're thinking of, or, I'm really getting old.... :-\
-
Armstrong, could it be some1 else made that nice function you referred too? Or is there any chance you could find it on your HD somewhere?
-
Very sorry!! I meant a guy called Crashdome and his mod is Sinews of War. Hope I didn't sceared you up Crashnburn. :P
:beat: *Gets Shot* :beat:
-
np ;)
email sent to him now.
-
Hello everyone,
Armstrong: Thanks for the comments!
Ponq: Multiline dialog ctrls are very limited in ofp. Only the textbox can be multiline and there are no scroll bars that I am aware of. Even if you use pages, you will have to manually set the length of each page as you cannot determine a count of characters in a string and break it up programmatically.
I did write a dialog that resembles something like old RPG games where the top portion is a multiline textbox of talking and the lower portion is a listbox of single line responses you can make. Check it out at http://www.crashdome.net/ofpsx (http://www.crashdome.net/ofpsx)
No need to register just click on the anonymous link to access the files.
To summarize what you need to get a multiline text box (in case you do not want to download my dialog and browse through it:
in the description.ext file define a textbox class like so:
class multiTextBox
{
   type = CT_STATIC;
   idc = -1;
   style = ST_MULTI;
   colorBackground[] = <any color you want>;
   colorText[] = <any color you want>;
   font = <any font you want>;
   sizeEx = <height of each line - 0.025 is a good start but try and match the font so it is not fuzzy>;
   linespacing = 1.0;
   text = "";
};
Create the actual textbox as a control:
   class myTextBox : multiTextBox
   {
      idc = 100;
      text = "";
      x = 0.0625; y = 0.3625; w = 0.875; h = 0.25;
   };
Then, to get your text into the textbox, you will need to use a single string in a script to set the text (or write it into the description.ext directly if it never changes)
Here is an example:
ctrlSetText [100, "Here is an example of a multiline text box, blah, blah. I can write text and keep going and going and going..."]
The text will be displayed and it will break wherever it wants. "\n" doesn't work and you will be stuck with however it looks. To fine tune, you will need to maybe add spaces to the text to get it to look right - or adjust the size of the box.
Edit: forgot a " :)
-
Thanks for your reply!
I guess I have to accept there's no decent line-breaks in ofp-dialogs ;)
LOL at your demo mission btw
-
Glad I can (still) help! ;D