script processing - when object unloaded the script runs onc

Post » Fri Jun 04, 2010 9:35 pm

I have this script on a book - I use a book which is a persistent reference - the script sets 2 variables on my quest script
scn UDUNobjectSCRBegin gameMode	set UDUNcTQUEST.container to GetContainer	set UDUNcTQUEST.cell to getParentCellend

I have the quest script to print in game mode :
printc "cell : %i" cellprintc "container : %i" container
When I put the book in a container (in exterior cell) it prints smth like :
cell : 00005E3D
container : 000C08E1
I (the player) then move to another (interior) cell and call pcb. The quest script prints :
cell : 00000000
container : 00000000
why ?
I know the ref to the book gets unloaded from memory, but why (when) does it report its cell and container as 0 ?
User avatar
Kortknee Bell
 
Posts: 3345
Joined: Tue Jan 30, 2007 5:05 pm

Post » Fri Jun 04, 2010 1:49 pm

still wondering :whistling:

btw crossing a number of cells (so initial cell gets naturally unloaded) results in the same behavior
User avatar
Nikki Morse
 
Posts: 3494
Joined: Fri Aug 25, 2006 12:08 pm

Post » Fri Jun 04, 2010 6:45 pm

still wondering :whistling:

btw crossing a number of cells (so initial cell gets naturally unloaded) results in the same behavior

%i sees that the contents of the variable passed in don't correspond to any object in memory and prints zero.
If you want to see the contents of the variables regardless of whether or not they refer to valid objects use %x.

The game is weird about invoking scripts attached to objects in inventories. Sometimes it does so in situations that cause the game to CTD (obse patches this); other times doing so is harmless but still doesn't make much sense. Dunno if that answers your question.
User avatar
Sista Sila
 
Posts: 3381
Joined: Fri Mar 30, 2007 12:25 pm

Post » Fri Jun 04, 2010 3:06 pm

It does, thank you very much indeed :)

I wanted to see the contents yes - so I could track the reference at all times - still working on it though I hit http://www.gamesas.com/index.php?/topic/1087887-quick-questions-quick-answers-the-22nd/page__view__findpost__p__15949491. This one is probably related to the one I realized today - I drop my book in an exterior cell go into an interior reload and go to the exterior again - the book is nowhere to be seen. Is this already reported ? Maybe it is not obse related still...

EDIT : the point above should be added in the docs btw
User avatar
anna ley
 
Posts: 3382
Joined: Fri Jul 07, 2006 2:04 am

Post » Fri Jun 04, 2010 11:09 pm

%i sees that the contents of the variable passed in don't correspond to any object in memory and prints zero.
If you want to see the contents of the variables regardless of whether or not they refer to valid objects use %x.

Ooops, %x prints just 0
User avatar
Samantha Wood
 
Posts: 3286
Joined: Sun Oct 15, 2006 5:03 am

Post » Fri Jun 04, 2010 9:32 pm

Ooops, %x prints just 0

Oops, yeah. Sorry - %x expects numeric data.
I guess %i should be updated to print whatever's in the ref variable without checking if it's valid.

Regarding the bug you linked to in the other thread: it's a vanilla issue. The game is kinda sloppy about resetting data for references in the current cell when reloading a game saved in that cell. You might want to rig something up with GetGameLoaded/GetGameRestarted if it interferes with the functioning of your mod.
User avatar
naomi
 
Posts: 3400
Joined: Tue Jul 11, 2006 2:58 pm

Post » Fri Jun 04, 2010 1:50 pm

Oops, yeah. Sorry - %x expects numeric data.
I guess %i should be updated to print whatever's in the ref variable without checking if it's valid.
:nod: and update the docs for the time being

Regarding the bug you linked to in the other thread: it's a vanilla issue. The game is kinda sloppy about resetting data for references in the current cell when reloading a game saved in that cell. You might want to rig something up with GetGameLoaded/GetGameRestarted if it interferes with the functioning of your mod.
Thanks indeed - I had no idea where to start debugging that one - it still doesn't make much sense - the reference is in my test cell and gets moved to the (exterior in that case) cell - why would it move the first and not the second time (load) ? - anyway I moved an actor and had him drop the book lol. Took some debugging goes without saying.

How about the second one - I drop my book in an exterior cell go into an interior reload and go to the exterior again - the book is nowhere to be seen. Is this a vanilla issue also ? Am I going crazy ?
Those things should be in the troubleshooting\common bugs - if you know anyone who qualifies :whistling:

I used in my quest script
set rCell to tomeAppr.getParentCellprintc "cell : %i" rCellif rCellprintc "rCell notzero"endif
and seems rCell is indeed zero when I drop the book in an exterior and call pcb from a linked interior - but maybe related to the disappearing book bug - the one that makes me wonder about my sanity. GetParentCell should return the exterior cell shouldn't it ?
User avatar
Vicki Blondie
 
Posts: 3408
Joined: Fri Jun 16, 2006 5:33 am


Return to IV - Oblivion