Scripts and dialogs

Started by , Tue 13/01/2004 23:53:06

Previous topic - Next topic

Hood the Robin

First of all: Ive read the manual.

So, my question is: In the dialogs things therea r topics and in the topics you edit the script. This script is a different one and easier one (thank god!) but there are functions that need to be done with a more complex script.

So ive added a run-script thing. Ive named it as run-script 1. So it is right til now?

Then ive called the global script thing. There ive added this (i want to change the characther view. the charachter script name is Q and the view is 7):

 function dialog_request (int 1) {
   // my code
   ChangeCharacterView (Q, 7)
 }

Then i save and close it. When i save the game, it says:

"Error in line #106. Nested functions not supported"  

Can anyone help me??

Wolfgang Abenteuer

It should actually look like this:

function dialog_request (int dialog) {
 if (dialog == 1) {
   ChangeCharacterView(Q,7);
 }
}

The "run-script 1" from the dialogue script passes the number "1" into the dialog_request function.  Therefore, you need to tell AGS what to do when the value of that is 1 (hence the if (dialog == 1) { line).

~Wolfgang

Hood the Robin

Ok ill try it thanks.

2nd thing i want to know:

How do i know how much "{" and "}" ive got to put??

Scorpiorus

#3
Basically, each opening { brace has to be closed by }:
function dialog_request(int dialog) {

if (dialog == 1) {
ChangeCharacterView(Q,7);
}
}

~Cheers

TerranRich

I thought I added this to the Beginners' FAQ. Didn't I?
Status: Trying to come up with some ideas...

SMF spam blocked by CleanTalk