Dialogue For Novices!

Started by mysticjim, Tue 28/11/2006 01:45:21

Previous topic - Next topic

mysticjim

Hello everyone,

I'm very new to AGS, so please be gentle!

I've some questions about using dialogue options and how to switch them on and off.Ã,  I know this has been raised before, after checking both the manual and the forums, but I've hit upon a few snags and would really love some guidance!

I'm really trying to learn the scripting alternative to everything instead of just using interaction options, but for the novice I'm finding this is a bit of a minefield because I'm using the latest Version of AGS, and a lot of the previous posts and the copy of the manual I initially found were for an older version.Ã,  For example, I spent an hour trying to get the RunDialog command to work only to find it had been replaced by the .Start() command!!!! What confused me was that the Game- Run Dialog option still gives the code example using the RunDialog command!

Anyways, I'll stop blabbering and cut to the chase;

I set up a character interaction - when you talk to the character it runs a dialogue script;

Ã,  // script for Character 1 (Jon): Talk to character
dJon1.Start();

That was easy, so I thought I try and be clever! I wanted to disable option 2 of that dialogue - I searched for a command to do it and found

Dialog.SetOptionState

The example was a little confusing

if (GetGlobalInt(10)==1)
Ã,  Ã, dialog[4].SetOptionState(2, eOptionOn); //will enable option 2 of topic number 4 if the Global Integer 10 is 1.

All I wanted to do was basically replicate the Game Diasable Dialogue option in my above script before running the dialogue script itself.Ã,  I figured I could lose the If command stuff, I tried this;

// script for Character 1 (Jon): Talk to character

dialog[0].SetOptionState(2, eOptionOff); //switch off option 2 of Dialogue script 0
dJon1.Start(); //then run the dialogue script, hopefully with option 2 disabled

To my relief, this didn't crash my game, but it didn't work either! I can achieve this by using the Game Diasable Dialogue function then running my script, but this seems silly, and the reason for me trying to do this is because I'm planning on being able to use it to switch on or off multiple options depending on where in the game the player is, for example

if a variable is set to 0 then I want to enable options 1 and 2 but disable options 3 and 4.Ã,  Then later maybe vice versa if that variable has increased to 1.Ã, 

Where am I going wrong with the use of the Dialog.SetOptionState command?
- Winner of the 10/12/06 Tune Contest

mysticjim

Its ok! I've sorted it!

I got it wrong, I didn't realise I had to repace the word Dialog with the actual name of the dialogue script!

Right, carry on!
- Winner of the 10/12/06 Tune Contest

SMF spam blocked by CleanTalk