Disabling Dialog Topics Completely

Started by Sylvr, Sat 09/09/2006 17:11:57

Previous topic - Next topic

Sylvr

Sorry... yet another question that I can't figure out.

I was wondering how to disable topics completely. In my case:
-Initial Dialog with character
-Item obtained either within dialog script or an interact with object
-Conditional: If player has inventory(#)
->"SetDialogOption(6,1,eOptionOffForever);
     SetDialogOption(7,1,eOptionOffForever);
     SetDialogOption(8,1,eOptionOffForever);
     RunDialog(16); "

But the  Dialogs 6,7,8 still run anyway. I've heard talk about setting variables being able to take care of that, but I can't figure it out from other posts. So what does it look like? ???

Thanks much.
| Ben304: "Peeing is a beautiful thing, Sylvr" |

Ali

You could be confusing Dialogue Options with Dialogues themselves. That code doesn't change any of the options in Dialogue 16, which I guess is what you wanted to do. I think it would switch off the first topic from dialogues 6, 7 and 8. You could try this instead. I think it might do the trick:

SetDialogOption(16 ,6, eOptionOffForever);
SetDialogOption(16 ,7, eOptionOffForever);
SetDialogOption(16 ,8, eOptionOffForever);

Though it might be better to try and code this using the new style scripting along these lines:

dTheDialogueName.SetOptionState (6, eOptionOffForever);
dTheDialogueName.SetOptionState (7, eOptionOffForever);
dTheDialogueName.SetOptionState (8, eOptionOffForever);

I hope I haven't misunderstood your problem. If I have, I'm sure someone who knows more than me will be help.

Sylvr

#2
I do mean to permenantly disable Topics 6,7,8 (the dialogs themselves, as you say); they are just continuations of the same conversations. Topic 16 is what is supposed to happen when my player gets the item from said character.Ã,  I'll give your suggestion a try, though. Thanks.

Edit: No, I won't try your suggestion, because it's not what I'm trying to do. I figured out what you were saying. :) I hope this time I've been clearer.
| Ben304: "Peeing is a beautiful thing, Sylvr" |

Ashen

#3
Another thing to consider:
Quote from: KhrisMUC
It's not safe to rely on if (player.InventoryQuantity[...]==1), because as soon as you've used the item somewhere and thus it has been removed from the inventory, you'll be able to obtain it again.
Use GlobalInts or better, global variables, to keep track of things like that.

Which - from your first post - you've kind of though of. Bascially, instead of using the conditonal to turn options off, as you are doing, you'd use 'Conditional: If variable is set to a certain value (var, val)' (or, better yet, the scripting equivilant), when you'd launch the Dialogs, to decide whether they should be run or not. That way, the topic won't be run again, even if you've lost the item again.

Possibly, that's just confused you more, though. Can you be a bit clearer as to what, exactly, you want to happen (what topics and options you want on, and under what conditions, and when you want them to turn off).
I know what you're thinking ... Don't think that.

Sylvr

I do understand that, I just don't know how the script will look, or where it goes. And, in this case, I think it would be safe to use (player.InventoryQuantity[...]==1), because in this game it's a case of finding 4 items, and bringing it back to the character that requested it. And then the game ends.

I looked at the 'Conditional: If variable is set to a certain value (var, val)', but again, I don't know how or where to set such variables.
| Ben304: "Peeing is a beautiful thing, Sylvr" |

Khris

#5
Looks like you want a different outcome after clicking on a dialog option.
I guess there are dialog options which run another dialog, so in your dialog script, you probably have something like:
Code: ags
...
@2
goto-dialog 6
return
@3
goto-dialog 7
return
...

Correct?
Disabling the other dialogs directly isn't possible (although you could theoretically turn off all their options and the game would immediately return to the first one), but the problem is: won't the character say something pointless first, if the other dialog was disabled? So why don't you just turn off the dialog 16's option that calls one of the others?

About the other things:
You won't have to worry about the placement of the code, you can simply select "RunScript" instead of using the other actions, then click the Edit...-Button and AGS will take you inside the function that is called instead of the other actions.
Apart from a descriptional comment in the first line, the script window will be empty, and after you entered the corresponding script commands, select "Save and Exit" from the first menu and you're done.

Setting variables for use with the conditional action is easy, too, there's a command called "Game - Set variable value", the first parameter is the variable's name, the second is the value it's going to hold. Choose whether it's supposed to be a global variable which is accessible from everywhere or if it's only needed in the current room, create a new one and enter the value.
If it's going to be a room variable, setting it to zero in the room's "First time player enter screen"-interaction would be the best.
Then set it to one after the player has got the item and check it each time something depends on its value.

Sylvr

All of the dialogs that I want to use only have one option (sierra-style, I suppose it is). I would've used less topics, but I wanted things to happen in the middle of the conversation, so I thought it was necessary to use other topics rather than options within the same topic, and then write code to make it run together.

Here's what my interaction screen looks like:

I hope it shows up okay.

All I need is for topics 6 & 7 to be stopped. The other scripts don't matter.
| Ben304: "Peeing is a beautiful thing, Sylvr" |

Khris

Just add a "Game - Stop running more commands" (I think it's called) interaction after the highlighted RunScript.

Sylvr

Wow... it worked. I can't believe I missed that. Thanks! :D
| Ben304: "Peeing is a beautiful thing, Sylvr" |

Khris

You're welcome, glad to have helped :D

SMF spam blocked by CleanTalk