Problem with dialog: option-on / option-off

Started by Stratocaster, Thu 22/09/2011 23:46:57

Previous topic - Next topic

Stratocaster

What I'm trying to accomplish should have a simple solution but I have been stumped the past few days on figuring it out.

Here is what I want to do:

Scenario 1: If you select Option 1 ["Have you heard any rumors about any stolen rings?"] in the dialog and you DON'T have a specific item [Necklace], the NPC tells you his [Necklace] is missing and wants it back in exchange for information. This turns on Option 3 ["What is it I'm looking for again?"]. You must find the [Necklace] and bring it back to him.  The next time you talk to him with the [Necklace], Option 3 should be turned off, and it should turn on Option 2 [I believe I found your necklace (GIVE NECKLACE)].

Scenario 2: If you select Option 1 ["Have you heard any rumors about any stolen rings?"] in the dialog and you DO have the [Necklace] the NPC needs, the NPC will have unique dialog and skip right to giving you the information he was just promising and ending the dialog with him completely for the rest of the game.

The problem I have is, I can't figure out how to turn Option 2 on without conflicting with Scenario 2.

When triggering Option 1 WITH the necklace this code comes into effect. (Scenario 2.)

Code: ags

  if  (player.InventoryQuantity[iGoldNecklace.ID] == 1){
      cCalvan.Say("I think I have acquired such a necklace already.");
      ......yadda yadda yadda......
      cCalvan.LoseInventory(iGoldNecklace);
      dDialog9.SetOptionState(1,eOptionOffForever);
      dDialog9.SetOptionState(2,eOptionOffForever);
      dDialog9.SetOptionState(3,eOptionOffForever);
      return RUN_DIALOG_STOP_DIALOG;
  }


This works as it should.

When triggering Option 1 WITHOUT the necklace Option 1 dialog plays normally (Scenario 1.)

Code: ags

.....yadda yadda yadda.....
.....yadda yadda yadda.....
.....yadda find necklace.....
option-off-forever 1
option-on 3


So in (Scenario 1.), after Option 1 has been triggered (without necklace) and Option 3 comes on, how would I go about turning on Option 2 when the player speaks to the NPC again WITH the necklace without conflicting with (Scenario 2.)?

Right now I am using this code in @S //

Code: ags

  if  (player.InventoryQuantity[iGoldNecklace.ID] == 1){
  dDialog9.SetOptionState(3,eOptionOffForever);    
  dDialog9.SetOptionState(2,eOptionOn);
  }


Which of course turns on Option 2 in (Scenario 2.), which is what I DON'T want.

I'm not how to go about this.

This is the best way I can explain it so sorry for any confusion. Thanks to anyone who can help.

Creator

#1
The only thing I can think of is because you set option to to option-off-forever. That means that you'll never be able to turn it on again, even if you ask for it.
Could you post you entire dialog script so we can have a better understanding?

EDIT - Reread your first sentence again. I think you have a conditional "if" script in dialog option one, yeah? Because you set it to eOptionOffForever (option-off-forever), the script will never run again. Firstly because you turned it off, but to make it worse, you turned it off forever which means calling option-on 1 still won't turn it on again. You need to turn option 1 back on to get the "if" to run.

Stratocaster

Thanks for the response. Well, I turned Option 1 off forever because I don't want the player to be able to ask that more than once. If the player has the necklace and chooses Option 1, everything will play out accordingly and will end the dialog with the NPC forever as he leaves the game.

If the player doesn't have the necklace when choosing Option 1, I still want that option to be turned off forever and for Option 3 to be turned on. So then when the player finds the necklace, talks to the NPC again, I want Option 3 to be turned off and Option 2 to be turned on.


SMF spam blocked by CleanTalk