Jump to content

Trying To Work With SKSE, Getting No Method Found In Log


Recommended Posts

Hey everyone!

​I've run into quite a frustrating issue that I cannot figure out despite all my best efforts.
I'm trying to find all object references in a given cell and keep getting met with "method GetNumRefs not found on Cell" in the logs. I know this is an SKSE function and have installed and reinstalled it many times by now trying to get this to work, but clearly I'm overlooking something.
My script is as follows.

Scriptname test extends ObjectReference  

Cell Property StagingCell  Auto  

ObjectReference[] f ;Furniture, 40

Event OnInit()

	f = new ObjectReference[100]
	RegisterForUpdate(0.5)

EndEvent

Event OnUpdate()

	GetFurniture()

EndEvent

Function GetFurniture()

	;Get furniture objects into an ObjectReference array
	int i = StagingCell.GetNumRefs(40)
	
	while i
	
		i -= 1
		f[i] = StagingCell.GetNthRef(i, 40)
		Debug.Trace(i)
		Debug.Notification(f[i].x + ":" + f[i].y + ":" + f[i].z)
	
	endwhile
	
EndFunction

In case more detail is needed, I've made a staging cell which houses multiple objects. I'm attempting to find these object references, duplicate them, then place them around the player at run-time. This script is attached to an x marker in the cell itself, in case that matters.

If anyone has any idea why this isn't working, I would greatly appreciate it.


Thanks, and take care!

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use