Jump to content

Way to tell if cell/object is loaded in memory?


Recommended Posts

Is there a way to tell whether an object (or maybe the cell the object is located in) is loaded in memory?

 

I want to make sure an OnLoad block will run, as it won't run if it's already loaded in memory.

 

Any ideas?

Link to comment
Share on other sites

You can try this:

 

int iDoOnce

Begin GameMode

if ( iDoOnce == 0 )
	;Do Whatever you want after it been loaded.
	Set iDoOnce to 1 ;Make sure it's only done once.
else
endif

End 

 

This is Fallout 3 syntax, but I guess it's the same in Oblivion or Morrowind.

Edited by Alexx378
Link to comment
Share on other sites

Is this cell inside our outside?

 

If it's inside, you can script the door(s) to reset the "doonce", if it's outside you can check the gamemode block about player being in the cell or not and reset the "doonce". I suggest creating a quest script to keep the variables.

 

Now if you tell us what you really want to achieve it may be easier...

 

Cheers.

Link to comment
Share on other sites

Scripted activators will only run if they are in an active cell. So, by virtue of anything inside a gamemode block on an activator, the block will only run when the player is nearby and isn't looking at a menu. You can test this for yourself by placing a scripted object in any unreachable cell with a gamemode block that spams the player with a message. The message will only be sent to the player when that cell is loaded.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...