Changing variable values in the dialog script.

Started by subspark, Mon 01/09/2003 04:56:23

Previous topic - Next topic

subspark

Hi everyone. It's been quite a while since I've spoken on these forums. I need some help with variables. I am trying to make my character (ego) speak to another character but once at a certain point in the dialog script it triggers a value that makes the next time I click talk to on the character he says something different and it loads a different topic.

My current script:

// dialog script file
@S  // dialog startup entry point
return
@1  // option 1
wiz: You must seek Nara in the woodlands of Keiyma.
wiz: She knows of a secret entrance that will take you to the very core of the keep.
ego: Can't you just tell me? You know all remember!
wiz: You are best to learn of this yourself. Nara will be of most help to you.
wiz: I know much, but not all.
(Wizard Talked = 1) // this is my problem
goto-dialog 5
return
@2  // option 2
wiz: That would be wise.
stop


Note dialog 5 is the topic that the variable value sets as the first when you talk to the wizard a second time.

Ishmael

Um... using option-off's and option-on's, so you can bring up the needed option, and turn off all the others, so it automatically jumps into that point when the dialog starts.
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.

subspark

#2
No I've sort of figured it out.

All I need to know now is how to set a variables value.
Im using the runscript in dialog option. Much faster and easier.

If I simply remove options in the dialog, then they won't be there if the ego hasn't spoken to the point where the value changes and when he next talkes he'll just say thanks goodbye.

Does anyone know how the actual code of setting a variable value to 1
A section of my global script:

function dialog_request (int WizardTalked) {
 //these are all the functions that dialog topics can refer to.
WizardTalked = 1; //EGO has already talked to the wizard. PROBLEM!!!
}

subspark

My New Dialog Script that still doesnt work.

// dialog script file
@S  // dialog startup entry point
return
@1  // option 1
wiz: You must seek Nara in the woodlands of Keiyma.
wiz: She knows of a secret entrance that will take you to the very core of the keep.
ego: Can't you just tell me? You know all remember!
wiz: You are best to learn of this yourself. Nara will be of most help to you.
wiz: I know much, but not all.
run-script 1 //Change the Wizard Talked value to 1.
goto-dialog 5
return
@2  // option 2
wiz: That would be wise.
stop

Ishmael

I'm sorry to see, but most people unfamiliar with the dialog_request do it wrong...

It goes:

fucntion dialog_request (int drval) {
if (drval==1) {
// do what's meant to do when run-script 1 passed
} else if (drval==2) {
// do what's meant to do when run-script 2 passed
}
}

etc.

What do you exactly need to do with the value? If you need to set so when once taked to the wizard, the second time the player talks to him runs another dialog? This can be done by just adding one more option to the current dialgo, leaving it black, unchecking the 'show' and 'say' boxes and putting in the scritp:

@3 // or whatever number is the new one
goto-dialog x

Where x is the new dialog, of cource, and when the point is passed, where the new dialog is meant to become active, put enough option-off's to turn off all other options than the one we need here, and use option-on to turn it on.
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.

subspark

#5
Yeah I say the option which changes the dialog when you talk to him for the second time by simply going to dialog 1 and showing and hiding options except the options don't change when it goes back to dialog 1.

The script:

// dialog script file
@S  // dialog startup entry point
return
@1  // option 1
wiz: You must seek Nara in the woodlands of Keiyma.
wiz: She knows of a secret entrance that will take you to the very core of the keep.
ego: Can't you just tell me? You know all remember!
wiz: You are best to learn of this yourself. Nara will be of most help to you.
wiz: I know much, but not all.
goto-dialog 1
option-off 1
option-off 2
option-off 3
option-on 4
option-on 5
return
@2  // option 2
wiz: That would be wise.
stop

ive made games b4 im not a newbie but this gets me where it hurts.

I just need to set a variable value to 1 in the dialog script.

Lets Say:

// The variable value has been set to 1 so this script runs:


 // script for character1: Talk to character
MoveCharacter (EGO, 170, 130);
while (character[EGO].walking) Wait (1); //Waits until the character has arrived to the location
FaceCharacter(EGO,WIZ);

//When I want to put anything before the dialog choices, I usually put them right here.

DisplaySpeech (0,"Excuse me...");
DisplaySpeech (2,"Anything more?"); // as if hes already acknowledged you have talked!!
RunDialog (5); //The dialog I put into topic 1 and hid)

Seems so much easier and more flexible.
I need to know how to set a variable's value in the dialog script.

Ishmael

@S
return
@1
MAN: Hi...
option-off 1
option-on 2
option-on 3
return
@2
MAN: What do you offer for it?
EGO: I have nothing to give...
MAN: So forget it...
option-off 2
return
@3
MAN: So?
EGO: I'd like to know more about it
MAN: What do you want about it?
option-off 3
option-off 2
option-off 4
option-on 5
return
@4
MAN: See you...
stop
@5
goto-dialog 3
stop

as an example
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.

subspark

Problem.
When you talk for the second time it always starts at topic 1 unless you change it with the interactions script. Which I would except you guys are saying this is easier.

Any ideas?

Ishmael

The scritp I wrote runs dialog 3 when you talk to him after saying the dialog topic 3. You see, when you talk to him that time, it skips to dialog 3, and dont display any options for the currrent, since all else exept the one containing the goto-dialog is on.
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.

subspark

#9
but if you don't get to the stage where it triggers the change,
I want it so that you still have those options.

I don't want it to change if you havent finished talking.

I could just assume that the player will click every option but that would be unreasonable.

I think your missunderstanding me:

I mean to say that I wish for the player to get to a certain point in the conversation going through 4 topic changes and topic number 4 triggers the next time you talk to the wizard he says something different before the dialog options come on for example:

Without triggered action.

Talk to wizard:

Ego: Excuse me?
Wiz: Yes?

-dialog options come on-

Ego chooses top sialog option: are you the wizard?
Wiz replies: yes, who are you?

-topic change-

New dialog options appear relative to the wizard's question:

Ego choose top option again: Im ferdinand. Howd you guess?

-topic 3 changes to topic 4- (the topic that will be called the next time they talk)
Sets the "WizardTalked" variable to 1 so that it is possible
New dialog options appear

Ego chooses topic 4's top option: How did you do that again?
Wiz: I know many things. Goodbye

Dialog closes/ends.


VALUE IS SET TO 1

Ego Talks to Wizard.

Ego: Excuse me?
Wiz: Something else?

Topic 4 is loaded:

Ego chooses top option again: How did you do that again?
Wiz: I know many things. Goodbye



Along those lines. Are you following. Thats why I thought the dialog runscript would be beneficial...

Any ideas?

I just need to know how to set a variabl's value to 1 from the dialog script. If anyone has a better way of doing the above then please reply.

Ishmael

In the script I wrote, when you select option 3, the current dialog is 'disbled', and number 3 enabled, so when you click the number 3, the dialog skips to topic 3 when you next time talk to him. If you haven't clicked number 3, then the current dialog will run. Someone else explain this......
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.

subspark

yeah you answered b4 i modified my reply dude!

SMF spam blocked by CleanTalk