Jump to content

Can I get adjacent cells in a script


IWantMyMod

Recommended Posts

A round about way maybe...

You could place a small object in each cell. On this object, place a script. That script would use OnCellAttach event and use GetParentCell on the object itself. With the OnCellDetach event clear whatever variables used to store the fact that that cell was attached.

 

But that is just speculation, there may be a better method.

Link to comment
Share on other sites

If wanting the adjacent cell(s) coordinates..

 

Get the object's, XY, convert them to coordinates(posXY / 4096), then subtract/add where needed to get the adjacent cell coordinates. Additional sub/add to get the other cells, etc. You'd have to adjust the calculations for negative positions, or the coordinates will be one off.

 

If wanting the adjacent cell(s) as objects, then nevermind.

Edited by Rasikko
Link to comment
Share on other sites

  • Recently Browsing   0 members

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