sierra convo's

Started by Nixxon, Sun 01/06/2003 14:00:40

Previous topic - Next topic

Nixxon

Just wondering how i would go about making sierra style convo's?
if u talk to a character for the first time it plays one topic... once the conversation commences and u talk to the character for a second time... a different topic is played... third... forth etc. all this without 'chosing what to say' if that makes any sense

Edit -
I consulted the web based manual. it skims on the sierra type convo's and doesnt show how it should be scripted, since I'm a fully fledged retard, i need this spelled out for me :P
this is what i get -
DoDialog: all options have been turned off

Scorpiorus

QuoteJust wondering how i would go about making sierra style convo's?
if you talk to a character for the first time it plays one topic... once the conversation commences and you talk to the character for a second time... a different topic is played... third... forth etc. all this without 'chosing what to say' if that makes any sense

Look at DisplaySpeech() function then.
Also you have to use a variable to store the state of a dialog:

in the global script
int MAN_dialog_state = 0;


on talk interaction with character MAN:

if (MAN_dialog_state == 0) {
DisplaySpeech(MAN, "hi");
DisplaySpeech(MAN, "how are you");
}
else if (MAN_dialog_state == 1) {
DisplaySpeech(MAN, "blah blah");
}
else if (MAN_dialog_state == 2) {
DisplaySpeech(MAN, "blah blah....");
}
else if (MAN_dialog_state == 3) {
DisplaySpeech(MAN, "blah blah........");
}
else {
DisplaySpeech(MAN, "leave me alone");
}

MAN_dialog_state++; //increase varible when dialog is finished




QuoteI want an object to move up and down, iv'e scripted this in my room code

it should be:

function room_a() {
// script for room: Repeatedly execute
if (GetObjectAt(94,146)==8){
MoveObjectDirect(8,94,130,1);}
else if (GetObjectAt(94,130)==8){
MoveObjectDirect(8,94,146,1);
}

} //< ---- end of room_a() function


Also I would suggest you to check if the object moving before applying the Move command inside repeatedly execute, so the thing that you may want (btw, instead of GetObjectAt() you can use GetObjectY() ):


function room_a() {
// script for room: Repeatedly execute

if (IsObjectMoving(8)==0) { //if it's not moving

if      (GetObjectY(8)==146) MoveObjectDirect(8,94,130,1);
else if (GetObjectY(8)==130) MoveObjectDirect(8,94,146,1);

}

} //< ---- end of room_a() (room_repeatedly_execute) function


-Cheers

Timosity

#2
you can use something like this.

first put this up the top of the global script

int counter;

then choose the charcter you want to talk to, click interaction, talk to character, then choose run script and use something like this:

if (counter==0) {
DisplaySpeech(EGO,"blah blah blah'");
Display("There is no reply.");
}
if (counter==1) {
DisplaySpeech(EGO,"c'mon answer me'");
Display("There is no reply.");
}  
if (counter==2) {
DisplaySpeech(EGO,"All right, that's it!'");
Display("At Last there is a response...");
DisplaySpeech(KAL,"Get lost'");
}  
if (counter==3) {
DisplaySpeech(EGO,"Knock, knock,");
DisplaySpeech(KAL,"Who's there?");
DisplaySpeech(EGO,"Not me, baby! I'm outta here!!'");
}

if (counter < 3) {counter += 1;}


I think that might be what you are looking for

Edit: you just beat me to it

Scorpiorus

Tim: we are synchronous :)

-Cheers

Nixxon

apon trying both scripts whilst compiling i get -
Error (line107); line too long 300 chars max
:(

Scorpiorus

#5
Can you post the script code between: line 100 - line 115 :P

check the length of the 107th line of the code

Nixxon

i just pasted in your code, to see if it worked before i defined my own text

 // script for character2: Talk to character
if (counter==0) {
DisplaySpeech(EGO,"blah blah blah'");
Display("There is no reply.");
}
if (counter==1) {
DisplaySpeech(EGO,"c'mon answer me'");
Display("There is no reply.");
}
if (counter==2) {
DisplaySpeech(EGO,"All right, that's it!'");
Display("At Last there is a response...");
DisplaySpeech(Gook,"Get lost'");
}
if (counter==3) {
DisplaySpeech(EGO,"Knock, knock,");
DisplaySpeech(Gook,"Who's there?");
DisplaySpeech(EGO,"Not me, baby! I'm outta here!!'");
}



Gook_dialog_state++; //increase varible when dialog is finished

Timosity

looks like you've combined my code with scorpiorus's

in that particular code

"Gook_dialog_state++; //increase varible when dialog is finished"

will do nothing and the int counter will stay at zero cause it is not being incremented.

if you copy some code make sure you check to see whether you have copied it right.

I still don't know why you get the error, I guess you have the characters EGO and Gook (I hope it's not a racist slur) in the game. also the characters names are case sensitive ie, Gook or GOOK, depends how you defined it. and if the speech line isn't over 300 characters I don't know sorry

Scorpiorus

Basically, line too long 300 chars max  error appears when a line of code exceeds 300 characters:

Example:

...
...
DisplaySpeech(..);
DisplaySpeech(..);
DisplaySpeech(..);
DisplaySpeech(..); DisplaySpeech(..); ........;......;DisplaySpeech(..); so length>300
DisplaySpeech(..);
DisplaySpeech(..);

Check it please and yeah replace Gook_dialog_state++; with counter++.

PS If it still there try to comment that line and see if it works then. Btw, can you post the line that cause problems.

Oh and, as Timosity noticed, you have to use correct script names. What is Gook name? Variable? Actually if it's character's script name it must be uppercased: GOOK. Check  it as it probably the source of a problem.

-Cheers

Nixxon

#9
Thanks guys, yeh i did have the script name wrong :)
i still get the 300 chars max error, funny thing is... the line it's on has no code on it what so ever... perhaps my script isn't spaced out properly?
very much appreciated. heres a snippet from my global... i've included the function above the one im currently having trouble with. :P

(it's now line 103, next to GUIOff) but it compiles with no hassles if I delete the convo script at the bottom

function inventory3_a() {
 // script for inventory3: Look at inventory item
GUIOn(6);
}


function character2_a() {

// script for character2: Talk to character
if (counter==0) {
DisplaySpeech(EGO,"blah blah blah'");
Display("There is no reply.");
}
if (counter==1) {
DisplaySpeech(EGO,"c'mon answer me'");
Display("There is no reply.");
}
if (counter==2) {
DisplaySpeech(EGO,"All right, that's it!'");
Display("At Last there is a response...");
DisplaySpeech(GOOK,"Get lost'");
}
if (counter==3) {
DisplaySpeech(EGO,"Knock, knock,");
DisplaySpeech(GOOK,"Who's there?");
DisplaySpeech(EGO,"Not me, baby! I'm outta here!!'");
}



}

Nixxon

I have a small brain, a feeble mind... and should be punished accordingly

i had counter++(.) at the end of the script instead of counter++(;)

really sorry about this lol

thanks again :D :D :D

Scorpiorus

Quotei had counter++(.) at the end of the script instead of counter++(;)
Was it the solution to the 300 chars max error?

Nixxon


Scorpiorus

#13
hmm, interesting :)

Just a curious was it at the end of global script exactly. Something like this:
...
...
...
...
if (counter==3) {
DisplaySpeech(EGO,"Knock, knock,");
DisplaySpeech(GOOK,"Who's there?");
DisplaySpeech(EGO,"Not me, baby! I'm outta here!!'");
}

counter++.
} //end of script for character2: Talk to character

//end of global script


Nixxon

Yep, counter++.} was the last line on my global.
is this a common error? cause the char's max error was kinda disorientating, thank thee lord for teh forums :)

Scorpiorus

Quotecause the char's max error was kinda disorientating
It might be that max-300-chars error is triggered somehow. The '.' reserved for some construction so it maybe the reason. Anyway it works now so all fine. ;)

-Cheers

Gilbert

#16
It shoule be

counter++;[color]}

not

counter++.[color]}

EDIT:

Oh just seen you'd fixed it, sorry, my fault for not reading everything thoroughly.

SMF spam blocked by CleanTalk