Transfer specific options from one dialog to another

Started by Kumpel, Fri 15/04/2016 15:02:01

Previous topic - Next topic

Kumpel

Hello,

I have once again a problem with my interview situation. Before he goes to the interview, the character has to choose which documents he wants to take with him. I made a dialog with 12 options (dDocPrep) from which he can choose. Now I want these options to be transferred to another dialog (dDocInterview). I made one, that has the exact same options (but not the same dialog script content) of course initially with no option shown.

Now I tried to save the decisions and transfer them to the second dialog in two ways:

1. I put an array bool DocsChosen[12] in the global script  and let it check in r_e_a via
Code: ags

int k;
while (k < 13){ 
  k++;
  if (dDocChosen[k] == true){
    dDocInterview.SetOptionState([same array number],eOptionOn)
  }
}


result: No option is shown.

2. In dDocsPrep I saved the option number in an int var "opt".  In the sub-dialog where the player can choose if he wants to take a document or doesn't (Yes/No) and he chooses "yes", I coded "dDocInterview.SetOptionState(k,eOptionOn)".

result: No option is shown.

so what am I doing wrong?



Khris

You should probably show us all the relevant code.

Although, given that it's only 12 questions, maybe just do it manually:

Code: ags
// dDocPrep script
@5:
  dDocInterview.SetOptionState(5, eOptionOn);
  ...

dayowlron

I would put a breakpoint on line 5 in option 1. dDocInterview.SetOptionState....
then run the program and see if this line is even called.
If so then there is something wrong with the call. If not then there is something wrong with the array being passed in is not the same array that was set in the other dialog. This would at least narrow down where the problem lies.
Pro is the opposite of Con                       Kids of today are so much different
This fact can clearly be seen,                  Don't you know?
If progress means to move forward         Just ask them where they are from
Then what does congress mean?             And they tell you where you can go.  --Nipsey Russell

Snarky

You're missing a semi-colon inside your loop, but if it compiles that's probably not the problem here. (I'm not sure why you've changed the code to say "[same array number]" when surely it should simply be "k". And is it deliberate that you're not using index 0?)

Quote from: Kumpel on Fri 15/04/2016 15:02:01
2. In dDocsPrep I saved the option number in an int var "opt".  In the sub-dialog where the player can choose if he wants to take a document or doesn't (Yes/No) and he chooses "yes", I coded "dDocInterview.SetOptionState(k,eOptionOn)".

result: No option is shown.

so what am I doing wrong?

Well, for one thing, you say you saved the current option number as "opt", but you're using "k" when setting the corresponding option on.

Kumpel

Sry Snarky. I made a mistake in my explanation. I actually got it to work while trying to explain the problem to you guys (roll) :D :-[
It was a simple thing of "goto-previous" that has been copied wrong to dDocInterview's @S. So it never displayed the options but jumped to a dialog that isn't there and therefore it stopped the dialogs.

Thanks anyway. Case Closed! :D

SMF spam blocked by CleanTalk