Is it possible to have a two part script?

Post » Wed Jan 13, 2010 1:23 pm

So on a door in my mod, It disables and enables according to the journal entry you currently have. Is it possible to also have a part that when you activate it, it gives you another journal entry?

Begin 01mc_01mcdoor1if ( GetDisabled == 0 )	if ( GetJournalIndex "mc_dissidentpriest" < 160 )		Disable	endifelseif ( GetDisabled == 1 )	if ( GetJournalIndex "mc_dissidentpriest" >= 160 )		Enable	endifendifEnd 01mc_01mcdoor1


And i was wodnering if something like this would work: (remember, Slaanesh= no scripting knowledge)
Begin 01mc_01mcdoor1if ( GetDisabled == 0 )	if ( GetJournalIndex "mc_dissidentpriest" < 160 )		Disable	endifelseif ( GetDisabled == 1 )	if ( GetJournalIndex "mc_dissidentpriest" >= 160 )		Enable	endifendifif ( activate == 1 )        Journal "mc_dissidentpriest" 170        set activate to 0endifif ( activate == 0 )endifEnd 01mc_01mcdoor1


I just typed that based off of what I think I know, so please correct me about my wrongness :/
User avatar
Nick Pryce
 
Posts: 3386
Joined: Sat Jul 14, 2007 8:36 pm

Post » Wed Jan 13, 2010 9:31 pm

Yep, the concept is sound. You can combine quite a few parts into a single script, but there are limits to watch out for.

Many variables trips the 34th var bug. There is a max text length for the whole script, usually falling somewhere around 800-1800 lines. Some triggers, such as "if ( OnActivate )" can only appear once, and will be unreliable or just not work otherwise (you can use variables to get around that easily).

Your script would look something like this, I believe:
Begin "01mc_01mcdoor1"; Variables here so you can use the triggers more often, and avoid calling functionsShort isDisabledShort isActivatedShort journalIndexSet isDisabled To GetDisabledSet isActivated To OnActivate ; Not sure as to syntax here, check SFDSet journalIndex To GetJournalIndex "mc_dissidentpriest" ; Just to save typing ;)if ( isDisabled == 0 )        if ( journalIndex  < 160 )                Disable        endifelseif ( isDisabled == 1 )        if ( journalIndex >= 160 )                Enable        endifendifif ( isActivated == 1 )        Journal "mc_dissidentpriest" 170endifEnd "01mc_01mcdoor1"

User avatar
A Lo RIkIton'ton
 
Posts: 3404
Joined: Tue Aug 21, 2007 7:22 pm

Post » Thu Jan 14, 2010 5:03 am

Yep, the concept is sound. You can combine quite a few parts into a single script, but there are limits to watch out for.

Many variables trips the 34th var bug. There is a max text length for the whole script, usually falling somewhere around 800-1800 lines. Some triggers, such as "if ( OnActivate )" can only appear once, and will be unreliable or just not work otherwise (you can use variables to get around that easily).

Your script would look something like this, I believe:
Begin "01mc_01mcdoor1"; Variables here so you can use the triggers more often, and avoid calling functionsShort isDisabledShort isActivatedShort journalIndexSet isDisabled To GetDisabledSet isActivated To OnActivate ; Not sure as to syntax here, check SFDSet journalIndex To GetJournalIndex "mc_dissidentpriest" ; Just to save typing ;)if ( isDisabled == 0 )        if ( journalIndex  < 160 )                Disable        endifelseif ( isDisabled == 1 )        if ( journalIndex >= 160 )                Enable        endifendifif ( isActivated == 1 )        Journal "mc_dissidentpriest" 170endifEnd "01mc_01mcdoor1"


Thank's for not making me feel retarted :D I appreciate the script, I seriously need to learn this stuff for myself though :/
User avatar
Brιonα Renae
 
Posts: 3430
Joined: Mon Oct 22, 2007 3:10 am


Return to III - Morrowind