script processing - when object unloaded the script runs onc

Post » Tue Nov 29, 2011 4:02 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
ILy- Forver
 
Posts: 3459
Joined: Sun Feb 04, 2007 3:18 am

Post » Wed Nov 30, 2011 12:21 am

still wondering :whistling:

btw crossing a number of cells (so initial cell gets naturally unloaded) results in the same behavior
User avatar
Elizabeth Lysons
 
Posts: 3474
Joined: Fri Feb 02, 2007 7:16 am

Post » Tue Nov 29, 2011 3:14 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
YO MAma
 
Posts: 3321
Joined: Thu Dec 21, 2006 8:24 am

Post » Tue Nov 29, 2011 5:00 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
Nicola
 
Posts: 3365
Joined: Wed Jul 19, 2006 7:57 am

Post » Wed Nov 30, 2011 1:02 am

%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
Sammykins
 
Posts: 3330
Joined: Fri Jun 23, 2006 10:48 am

Post » Tue Nov 29, 2011 4:08 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
jeremey wisor
 
Posts: 3458
Joined: Mon Oct 22, 2007 5:30 pm

Post » Tue Nov 29, 2011 4:06 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
Devin Sluis
 
Posts: 3389
Joined: Wed Oct 24, 2007 4:22 am


Return to IV - Oblivion