Jump to content

OnCellAttach / OnCellDetach


grey79

Recommended Posts

Ok I figured it out.

 

OnCellAttach is when the cell "enters" the world. Meaning it is now loaded into the engine, where before it was not.

OnCellDetach is the opposite.

 

So if I have a script on a mapmarker f.ex, containing the above events, then that event will trigger when the cell that mapmarker exists on is loaded into the game.

Link to comment
Share on other sites

So what would that mean for an exterior cell in the Tamriel worldspace? Does it "enter" the world any time the player re-emerges from an interior cell (or another worldspace, or whatever), or do exterior cells "leave" and "enter" the world based on the player's proximity to them?

 

I ask because this may be very useful for a mod I'm beginning to work on that does some serious stuff around Robber's Gorge...

Link to comment
Share on other sites

So what would that mean for an exterior cell in the Tamriel worldspace? Does it "enter" the world any time the player re-emerges from an interior cell (or another worldspace, or whatever), or do exterior cells "leave" and "enter" the world based on the player's proximity to them?

 

I ask because this may be very useful for a mod I'm beginning to work on that does some serious stuff around Robber's Gorge...

 

A cell is loaded when you are near it. So you can be pretty sure that if you are visiting Winterhold, then the cells surrounding and containing Markarth will not be loaded.

However, if you are on the outskirts of Markarth, then the cells will loaded.

 

Its an optimization trick obviously. No need to load cells the player has no way of seeing - which again means that every exterior cell is "detached (unloaded)" when you are in a dungeon or a similar interior cell.

 

Hope that clarifies it.

 

Here is a simple test I did:

Attached a script to the mapmarker on the alchemistshack.

The script contained the above events, and a simple Debug.MessageBox("") output.

 

I fast travelled to a settlement nearby, and rode closer until i got the OnCellAttach event.

Edited by grey79
Link to comment
Share on other sites

  • Recently Browsing   0 members

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