Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Wed 23/07/2003 12:23:44

Title: Text + image
Post by: on Wed 23/07/2003 12:23:44
Hi There,

How to I add an image to a text in a dialog:

for example

option 1: ask about cup?
@1
Narrator/other man: This is a rare cup, see the markings?
<Here an image of the appear - but how?> ???

P.S. if someone asked this already - I apologize (my Explorer is misbehaving) :-\.
Title: Re:Text + image
Post by: SSH on Wed 23/07/2003 12:48:29
You will probably need to call a script from the dialog. Look up runs-cript and dialog_request in the manual. In this script you could swap to a room which is just a closeup of the cup, or you could display the cup as an overlay, or as a room object, or various possibilities. Pick one and see how you get on.

EDIT: Removed uncalled for remark
Title: Re:Text + image
Post by: on Wed 23/07/2003 15:40:39
Hmm...That WAS very helpful, but I recieve an error message regarding the 1 after the "dialog_request".   What did I do wrong?  :'(

@3 // ask about PADD
Narrator: "The PADD is bla bla bla".
run-script(1)

<in the global script>
function dialog_request(1) {createGraphicOverlay (X, Y,slot, trasperant color);}

According to my, apperantly, LIMITED understanding this should work. ;)
Title: Re:Text + image
Post by: SSH on Wed 23/07/2003 16:58:59
The parameter to dialog_request needs to be a variable:

@3 // ask about PADD
Narrator: "The PADD is bla bla bla".
run-script(1)

<in the global script>
function dialog_request(int reference_no) {
if (reference_no == 1) {createGraphicOverlay (X, Y,slot, trasperant color);}
}

Then, if you want to use dialog_request somewhere else in another dialog for a different reason, call it with
run-script(2)

and then put :

function dialog_request(int reference_no) {
if (reference_no == 1) {createGraphicOverlay (X, Y,slot, trasperant color); }
if (reference_no == 2) { // do soemthing different here }
}

of course, I assume you're replacing the X, Y, slot, etc for real numbers
Title: Re:Text + image
Post by: TerranRich on Thu 24/07/2003 00:57:12
Also, isn't it run-dialog 1 as opposed to run-dialog(1)? Or am I mistaken and it really doesn't matter?
Title: Re:Text + image - end?
Post by: on Fri 25/07/2003 11:11:55
Ah Ha,

function dialog_request(int reference_no) {
if (reference_no == 1)

THAT was the missing part, and now it works pretty good.

Thanks.
For now this issue is complete, until more problems  comes, or maybe even a better way to do this.

Thanks again! :) ;)