Dialog error

Started by ktalebian, Tue 21/02/2006 07:32:17

Previous topic - Next topic

ktalebian

Hi, I want to run a dialouge, and if certain thing is said, I want to change the variable. I used
SetGraphicalVariable("varname", value);
in the Editting Script thing of the dialouges, but it gives me an error!
-------------
another dialog question
--------------
I have this rather large options for this dialouge. How can I make the dialouge into a list? Because right now the option takes the entire pagee! I mean when I start the conversation, I only see the huge list. It is not like a list with a scroll at the corner!

Ashen

Did you put the command actually IN the dialogue script? Dialogue scripting is different from normal AGS, it only acccepts a few commands (as explained in the manual). This BFAQ entry tells you how to use normal scripting in dialogs.

Your second question: You mean you want a smaller, scrollable dialogue list? Not currently possible, I'm afraid. See this recent topic for more details.
I know what you're thinking ... Don't think that.

ktalebian

thx for the reply
it seems as if I cannot change a variable. Is that correct?

Ashen

#3
Did you read the BFAQ entry? Between that and the manual entry it's pretty clearly explained:
You can't change the variable directly in the dialog script (you could if it was a GlobalInt - using set-globalint GI VAL - but not Graphical Variables), but you can call normal script using run-script X, e.g.
Code: ags

@1  // option 1
man: I want a drink!
run-script 1
return

(In the dialog)

And (in the global script)
Code: ags

function dialog_request (int param) {
  if (param == 1) {
    SetGraphicalVariable("varname", value);
  }
}
I know what you're thinking ... Don't think that.

ktalebian

where exactly is the global script?

Gilbert

Quick way, just press Ctrl-G in the editor.
Slow way, open it from the menus:
Script --> Edit Global Script...

ktalebian

ook, thx, as for that prograam, how do I use it? I am talking about the Money 05 06 program!
I uploaded the files into the BigBlue file directory. Now what do I do? thx

ktalebian

one other thing, for the Variable thing from the dialoge. Where in the place of Ctrl+G would I paste it?

monkey0506

Quote from: monkey_05_06 on Mon 20/02/2006 22:07:37
Ahh...the ScrollingDialog script module.  That's er...broken ATM.  I'm working on it.  I'm about 97.5% sure that I've got it figured out this time.  The next version will revoke some customization options, but should be fully functional, and will be coming within...hopefully the next couple of weeks.  It depends on time I can spend on the computer.  Right now I have to go eat some nasty crap my parents are trying to pass off as dinner (stuffed bell peppers).  But I should be able to work on it after dinner...

Just FYI, the options that will most likely be removed will include the ability to number the options and to reverse them.  I think other than that I've got it worked out in my head.

[EDIT:]

Just a little more information on the subject...At the moment I am rescripting some of the major internal functions to work out (once and for all if all goes as planned) the major underlying bugs which have left the module broken for some time.

It's not currently in any form of releaseable format (then again, neither was 0.80...that was just a really stupid move on my part), as all it's really capable of as is now, is a complicated method of setting the text on several labels.

I know what it is I have to do to fix it this time, it's just a matter of getting it done.  I can only work on it a little more tonight, but then I will have to go to bed (I hate going to school...I hate it with a passion).  I will definitely let you know when I get this finished.  It is going to take me some time, so don't expect it tomorrow or anything...but with some encouragement (encouragement, not flaming death threats :D), I might feel the urge to work on it more (as lately I have been taking a lot of breaks).

-----------------------

I have to rescript the scrolling, highlight, and interaction functions when I get home.  Should have it done by no later than this weekend.

ktalebian

Ok, thx
also, for the run-script thing, this has to happen in different rooms. So I had for example:

#sectionstart character4_a  // DO NOT EDIT OR REMOVE THIS LINE
function character4_a() {
  // script for Character 4 (Michael): Use inventory on character
 
if (GetGraphicalVariable("michael-speak") == 1){
if (player.ActiveInventory == inventory[3]){ 
DisplayMessage(11);
DisplayMessage(12);
player.LoseInventory(inventory[3]);
SetGraphicalVariable("compass", 1);
} else {
DisplayMessage(505);

} else {
DisplayMessage(18);
}
}
function dialog_request (int ch4) {
  if (ch4 == 1) {
    SetGraphicalVariable("michael-speak", 2);
  } else if  (ch4 == 2) {
    SetGraphicalVariable("michael-speak", 3);
  }

}
#sectionend character4_a  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart character6_a  // DO NOT EDIT OR REMOVE THIS LINE
function character6_a() {
  // script for Character 4 (Michael): Use inventory on character
function dialog_request (int ch6) {
  if (ch6 == 1) {
    character[CS].Walk(100, 183, eBlock);
  }

}
#sectionend character6_a  // DO NOT EDIT OR REMOVE THIS LINE

but when I run this, it says that dialog_request (of this line function dialog_request (int ch6) {) already exists! This new character is in another room! What do I do?

Gilbert

Because you can't define functions like this (you can NOT define functions inside functions), and dialog request doesn't work like this, there can only be one function of a specific name in one script. Read this for more info.

monkey0506

RE: ScrollingDialog module

Due to some unforeseen circumstances, the module is currently on hold while I wait for a bug fix in AGS 2.72 (I'm using beta versions).  There's also some other potential problems...but I kind of got tired of trying to fix them...I still need to do some more research into them to be sure if they will cause problems, but..it could delay it even further still.

ktalebian

oook, thx to everyone.
Also, monkey_05_06, I still don't know how to use your program!

monkey0506

You seem to be missing something.

It's broken right now.  I am working on the fix, but it is temporarily delayed.  I will let you know when the situation changes.

Is that clear enough?  Sorry...but the version you have doesn't actually do much (I thought it had a fix in it, but it didn't), so I've been working at it.  There's a bug in AGS that's in my way right now, so the module can't continue forward without it.  I'll let you know when I release the fix.

SMF spam blocked by CleanTalk