Detecting when the player loads from a saved game

Post » Thu Dec 31, 2009 6:02 pm

According to MWSFD:

Setjournalindex will set the index to the new value, no matter if an entry exists for this value or not, but when you reload, the index will be reset (see SetJournalIndex for more information).


However, when I tried this just now, with a totally blank journal entry (as in, no entries for "Info / Response"), the index did not get reset when I loaded from a save game (an autosave, specifically).

Any ideas why this is / whether this ACTUALLY works?

Cheers,

Danjb
User avatar
lauren cleaves
 
Posts: 3307
Joined: Tue Aug 15, 2006 8:35 am

Post » Fri Jan 01, 2010 3:09 am

Did you SetJournalIndex to a value that has a line in Journal? It shouldn't have, in order to work as you want to.
User avatar
Carlos Rojas
 
Posts: 3391
Joined: Thu Aug 16, 2007 11:19 am

Post » Thu Dec 31, 2009 2:53 pm

No, there was no line whatsoever in the journal to which I set it.
User avatar
Lizbeth Ruiz
 
Posts: 3358
Joined: Fri Aug 24, 2007 1:35 pm

Post » Thu Dec 31, 2009 2:01 pm

It is my understanding that there must be a valid journal entry for the game to reset the value to for this to work. So if you had a journal entry NI_MovableContainerLoadTest and that Journal had an entry for the index 10 "I've found a bag that I can take with me." This journal could be set as Journal NI_MovableContainerLoadTest 20. When the game is loaded the index of this journal entry would be reset to 10, I've not tested this and it may end up putting the "I've found a bag I can take with me." journal entry into the journal every time the game is loaded.
User avatar
Kortniie Dumont
 
Posts: 3428
Joined: Wed Jan 10, 2007 7:50 pm

Post » Thu Dec 31, 2009 3:43 pm

Thanks, I'll experiment with this a bit later. I think MWSFD could use another update ;)
User avatar
Robert Garcia
 
Posts: 3323
Joined: Thu Oct 11, 2007 5:26 pm

Post » Thu Dec 31, 2009 7:27 pm

Ok, I still can't get this to work...

Here's an object which sets your journal up to start with:
if ( OnActivate == 1 )	if ( GetJournalIndex "private_stash_journal" < 10 )		Journal "private_stash_journal" 10		SetJournalIndex "private_stash_journal" 10	endif	Activateendif


Here's the container which checks if you're loaded a game:
if ( OnActivate == 1 )	if ( GetJournalIndex "private_stash_journal" != 100 )		MessageBox "You need to activate the key!"	else		Activate	endifendif


Here's the "key" that sets your journal index to 100 (to be used after loading a game):
if ( OnActivate == 1 )	SetJournalIndex "private_stash_journal" 100endif


However, when I load my game and activate the container, I don't get the message "You need to activate the key!"
User avatar
Emily Rose
 
Posts: 3482
Joined: Sat Feb 17, 2007 5:56 pm

Post » Thu Dec 31, 2009 4:24 pm

I've found that for me the SetJournalindex trick described in the MWSFD didn't work at all.

However, it is not difficult to create reliable game load detection using start scripts.

For example you can just create an empty script:

Begin examplescriptEnd

Then set up the above script as a start script. Then, from another global script you can check if the script is running and stop it if it does:

Begin anotherexamplescriptif ( ScriptRunning, "examplescript" == 1 )	MessageBox, "The game has just been loaded!"	StopScript, "examplescript"endif;do other stuff hereEnd

User avatar
Becky Cox
 
Posts: 3389
Joined: Thu Jun 22, 2006 8:38 am

Post » Thu Dec 31, 2009 10:41 pm

I've found that for me the SetJournalindex trick described in the MWSFD didn't work at all.

However, it is not difficult to create reliable game load detection using start scripts.


Heh, I'm glad I'm not the only one; like I said, it seems like MWSFD could use another update!

Thanks, I guess I'll try this little trick or Get/SetScale.
User avatar
Sandeep Khatkar
 
Posts: 3364
Joined: Wed Jul 18, 2007 11:02 am


Return to III - Morrowind