How Do I Get A Dialogue Box To Only Appear Once?

Post » Fri May 27, 2011 1:05 am

There's another dark elf right next to Jiub in the mod I have. I want to be able to click on him after the guard says "this is where you get off. Come with me" and have him say a line of dialogue. But after that, if I click on him again, I don't want anything to happen. As of right now, his dialogue box starts right away. But after wards, nothing happens when I click on him, which is what I want. But I don't want his dialogue box to start automatically. I want to be able to click on him, have him say what he has to say, and then not have the dialogue box appear thereafter when I click on him again. How can I do that?
This is the script I have. I know it needs revising.

Begin ICMQ_Chargen_Rapistshort noloreshort greetonceIf ( MenuMode == 1 )    returnendifIf ( OnActivate == 1 )    returnendifIf ( GetDisabled == 0 )If ( Greetonce == 0 )If ( GetDistance Player <=83 )     ForceGreeting     set greetonce to -1endifendifendifif ( ChargenState == -1 )disableendifEndelseIf ( GetDisabled == 1 )Endendif

User avatar
Adam Baumgartner
 
Posts: 3344
Joined: Wed May 30, 2007 12:12 pm

Post » Fri May 27, 2011 10:54 am

The automatic dialogue is because of the forcegreeting. Try something like this:
Begin ICMQ_Chargen_Rapistshort noloreshort greetonceif ( MenuMode )	returnelseif ( OnActivate )  ;this triggers when you click on him	if ( greetonce == 1 )  ;already done once so don't activate		return	else		set greetonce to 1		activate	endifelseif ( GetDisabled == 0 )	if ( CharGenState == -1 )		disable	endifendifend


Or alternatively, you could just declare the greetonce variable in the local script, and set it to 1 from the greeting's resultbox, and put an empty greeting near the top of greeting 0 filtered for "greetonce = 1" (that will also stop the player talking to him when greetonce is true).
User avatar
Aliish Sheldonn
 
Posts: 3487
Joined: Fri Feb 16, 2007 3:19 am

Post » Fri May 27, 2011 3:44 pm

Thanks. The code above worked just fine.
User avatar
Kahli St Dennis
 
Posts: 3517
Joined: Tue Jun 13, 2006 1:57 am


Return to III - Morrowind