Advanced Scripting in Dialogues

Started by , Thu 11/03/2004 19:55:24

Previous topic - Next topic

Cisco

this post is for those who can't find out a way to script dialogues with an "if/then/else" construct or other funcions, not implemented in the dialogue script. i belive that someone is already get to this solution but browsing the forum i have found nothing on it. Since i was one of the club since this morning (since the boring lesson of Macroeconomics) i'm writing this to you in order to stop your brain-fusion on the topic.

so....it's quite easy....

now let's consider that in the scripting there's a special "run-script x" function which send the value x to the "dialog_request" function in the global script.

Now you should ask yourself....what the hell can i do with a script with just a single input??????

consider that "x" is an integer value passed to dialog_request.

just write an if/then/else construct in the dialog_request which check the value such as

function dialog request(x);
int x;
if x == 1 {............................}
if x == 2 {............................}
................
...............

simply write your script in the if construct and then the game will run the script as you call it from the dialog with the correct number

i don't know if this will work i have not tried it yet; and i'm not sure of the correct scripting at all.

it's just an idea.

see you

Cisco

Ishmael

Actually, the dialog_request is created as follows:

function dialog_request(int var) {
if (var == 1) {
// code for run-script 1 be here
} else if  (var == 2) {
// code for run-script 2 be here
}
}

And just adding more else if's with matching == x's with the run-scirpt number as the x.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SMF spam blocked by CleanTalk