GetSelf glitch

Post » Sat Feb 19, 2011 12:46 am

I've just found a glitch on the GetSelf function:

If used (1) in an item script and (2) the item is in a container in an exterior cell and (3) the container cell is loaded as the player approaches on foot and (4) GetSelf is used in the very first frame >> the game CTDs.

Notice that those are AND conditions. The game does not CTD if
- the item is in the world, or
- the player teleports to the area, or
- there is a frame delay and GetSelf is used in the second frame after load.

All I can guess is that the cell load process is different for teleporting into it (cell load screen and all) and the cells loaded as the player walks around in exterior areas. I guess that when GetSelf is used in the very first frame, somehow, the load process has not finished, causing the CTD.

This is confirmed and reproducible: I created a brand new mod with those conditions. The item script has only one line: "let MyRef := GetSelf (and some debugging code, of course) and the CTD happens 100% of the tries.

Has anybody heard about this before?
Is it worth mentioning in the GetSelf article in the WIKI? Or only in the GetSelf talk page?
Any thoughts?
User avatar
Laura Hicks
 
Posts: 3395
Joined: Wed Jun 06, 2007 9:21 am

Post » Sat Feb 19, 2011 9:56 am

The WIKI page for http://cs.elderscrolls.com/constwiki/index.php/GetSelf says it does not work when in the 'inventory' of something. That would be in a container for example.
I have noticed a few instances where the game will CTD when you load a game at the location of a script, or fast travel to it, instead of walking up to it slowly. I think you are right that the game has fits during a load process and CTD's instead.
User avatar
Dawn Porter
 
Posts: 3449
Joined: Sun Jun 18, 2006 11:17 am

Post » Sat Feb 19, 2011 1:46 am

Yes, GetSelf returns 0 for everything except for non-dynamic item in the world, therefore, it 'does not work' for those items. And it is this "feature" I am using to detect just that.

In my Rock Your Ship mod I have an item that has the script to rock the ships in the vicinity. I deployed a few in the CS (near vanilla ships) and some in a container, so the player may take them to non-vanilla docks.
The pre-deployed ones (non-dynamic) are supposed to work automatically, while the others (dynamic) must wait for the player to activate them. So I use GetSelf to detect which is which (this was before the GetModIndex OBSE function).

What I did not know was that GetSelf would CTD under the mentioned circumstances (easily fixed with a one frame delay, btw)

As you say, this problem may well be the cause of some mysterious crashes in the past.
User avatar
Bereket Fekadu
 
Posts: 3421
Joined: Thu Jul 12, 2007 10:41 pm


Return to IV - Oblivion