'Albion' style dialog system.

Started by Scavenger, Tue 20/01/2004 13:51:39

Previous topic - Next topic

Scavenger

I've been theorising a dialog system close to that of Albion. (For all of you who don't know, Blue Byte, 1996, RPG, I'll try and scrounge some screenshots.) Basically, it is a pop up window with a semi-transparent background, and there is a LOT of text in the middle. Almost the whole pageful in height and 1/3 the width of the screen. What I'm wondering is - How do I get a lot of text onto the screen at once easily (i.e using GUIs.) since labels can only have a certain amount (I think its about 500 characters). I know it can be done with multiple labels, but I need to be able to scroll the text. Is there any way of doing this? If there isn't, I'll find a work-around.

Scorpiorus

Yeah, a listbox object should do the job. You can have about 150 lines of text and scroll up/down.

Scavenger

Hmm.. Listboxes. Wouldn't that make it really difficult to change the text? Since it works on lines of text and not blocks of it... You'd have to do multiple lines of code...
SetListBoxSomethingorother (GUI, OBJECT, 1,"This text will only be one line");
SetListBoxSomethingorother (GUI, OBJECT, 2, "And will have to repeat for 150 lines each time I want to");
SetListBoxSomethingorother (GUI, OBJECT, 3, "Change the conversation piece.");

Is there some way to allow labels to scroll? With, for example, the top line vanishing, and the bottom line appearing, and vica versa?

Scorpiorus

QuoteHmm.. Listboxes. Wouldn't that make it really difficult to change the text? Since it works on lines of text and not blocks of it... You'd have to do multiple lines of code...
Yes, but you'd have to put multiple commands in ethier way provided the text is written in the script itself, like string variables. And labels won't help much as well. For instance, you want a new line appearing at the button, but there should be a variable AGS gets an actual text from. How do you want to store the text? Btw, how long is the text? Would it work to read the text from an external text file?

Scavenger

I guess I'd have to use an external *encrypted* text file to use the whole page. Maybe if I don't have scrolling, but flipping from one page to the next at each point you can't fit any more stuff in. And I suppose, if I were to use the default Dialog System as well, I should have this line of code in all the options:
set-glob-var 1 (DIALOGNUM)
set-glob-var 2 (DIALOGOPTION)
run-script 1

And in the dialog script, I'd have an array. I'm not sure if we can as yet have dialog[dialognum].optionfile[optionnum] as a string yet... how would I have to do this? With CONVOxxxx.dat? (the first two xxes being the dialog numbers, the last two being the options themselves...)

Scorpiorus

#5
QuoteAnd in the dialog script, I'd have an array. I'm not sure if we can as yet have dialog[dialognum].optionfile[optionnum] as a string yet... how would I have to do this? With CONVOxxxx.dat? (the first two xxes being the dialog numbers, the last two being the options themselves...)
Yep, maybe like that. The trouble with the text files, as you mentioned, is that they should be encrypted, so the player can't spoil the fun. Another thing is that someone could rename convo99xx.dat to convo01xx.dat, again with the intention to read all the texts.

Btw, have you considered using global/room messages? They can be long enough, I think. But in order to display the whole message you'd need to show it through the DisplayMessage(), though. Is it suitable for the kind of the dialog you are talking about?

EDIT: I've just checked the built-in dialog and figured out that you can have a very long text displayed. (@1 ego: "xxxxxxxxxxxxxxx") If you are not going to scroll it could be a solution as well.

Scavenger

Hmm... for the trouble of renaming things, how about putting some kind of key at the top of the file? Like, reading the header. It'll have to be corresponding to the dialog topic/option. Like the number in Hexidecimal.
"6F 9A" for example, at the start. And to increase security, would not starting at Dialog ONE? What if I start at Dialog fourty, and work in random? That'll help =)

And as for Global Messages, I'm not too sure. They can be as long as you like, but the problem is, transferring it to strings to use. Unfortuanately, string variables can only be 200 characters long...

Scorpiorus

QuoteHmm... for the trouble of renaming things, how about putting some kind of key at the top of the file? Like, reading the header. It'll have to be corresponding to the dialog topic/option. Like the number in Hexidecimal.
"6F 9A" for example, at the start. And to increase security, would not starting at Dialog ONE? What if I start at Dialog fourty, and work in random? That'll help =)
Possibility, but then maybe just to put all the text into one single encoded file? The thing that really bothers me is that you need to write both encoder/decoder etc. The question is it worthwhile? :P

So...

QuoteAnd as for Global Messages, I'm not too sure. They can be as long as you like, but the problem is, transferring it to strings to use. Unfortuanately, string variables can only be 200 characters long...
What I meant is to show them directly via the DisplayMessage() function, thus workarounding AGS limit on string length... Another possibility (Im begining to like it) is to use the built-in dialog engine. To make myself clear let's return to your original post:

QuoteBasically, it is a pop up window with a semi-transparent background, and there is a LOT of text in the middle.

Let's see how we can simulate this:

1. Make a custom textwindow (with transparency etc)
2. Set up a dialog:

@1
narrator: "ego: a very long text 1"
narrator: "man: a very long text 2"
narrator: "ego: a very long text 3"

this way all the text will be displayed on the custom GUI. We can even make that custom gui completely transparent (no background image and background color set to 0) and draw another one behind (semitransparent).

Would that work?

SMF spam blocked by CleanTalk