Some Dialogue Questions # 2

Post » Sat Feb 06, 2010 7:03 pm

I'm writing a script where the player falls asleep under certain conditions and gets a visit from an NPC - I'm just wondering how to avoid too many things happening at once and would like a sanity check or some advice on whether breaking the script up with state steps ensures the correct actions happen in order or whether it is just overkill - here's the script:

short stateif ( GetPCSleep == 0 )	returnendifif ( state == 20 )   set state to 0; reset for next time   returnendif;DREAM OF SEDUCTION...if ( state == 0 )	if ( GetJournalIndex CT_Amelia >= 18 )		if ( GetJournalIndex CT_DinnerDate = 24 )			if ( GetJournalIndex CT_Dreams = 1 )				PlayBink "CT_Mephala1.bik" 0				set state to 10			endif		endif	endifElseif ( state == 10 ) 	player->PositionCell 3426 3692 12115 337 "Dunhaven, The Captain's Table Lower Level"   	"CT_Mephala"->PositionCell 3349 4003 12115 138 "Dunhaven, The Captain's Table Lower Level"	WakeUpPC	MessageBox "You sense someone or something is watching you, trying to pretend that they are Amelia. As you struggle to shake off the dream and stumble to your feet, you feel yourself panting for breath." "Ok"	Journal CT_Dreams 2	set state to 20endifend

User avatar
Laura Wilson
 
Posts: 3445
Joined: Thu Oct 05, 2006 3:57 pm

Post » Sun Feb 07, 2010 12:32 am

A question about the results box.

I want to activate a variable for an NPC while talking with another NPC

In the MWSFD I can't seem to find a section explaining how the period works yet I have seen some scripts in results boxes which make use of it

Can i go in the results box?

Actor id->."their variable"

What does the period in scripting do?
User avatar
Amy Melissa
 
Posts: 3390
Joined: Fri Jun 23, 2006 2:35 pm

Post » Sat Feb 06, 2010 7:58 pm

It spells like this:

Set "Actor ID".variable to XXX

If ( "Actor ID".variable == XXX )

The period is used to address variables in other (objects') scripts, while -> addresses functions focused on those objects.

And yes, it works in action boxes too.
User avatar
Sierra Ritsuka
 
Posts: 3506
Joined: Mon Dec 11, 2006 7:56 am

Previous

Return to III - Morrowind