Jump to content

Recommended Posts

Posted

GetType() tells you via Int. Container is 28. If whatever reason not wanting to use SKSE you can cast as container

 

Refs btw you have to check their baseobject, not the ref directly

Posted

Here is a listing of script objects: https://www.creationkit.com/index.php?title=Category:Script_Objects

 

Every pre-placed object is an ObjectReference. This includes containers. ObjectReference is a child of Form. Children can be cast upwards to their parents.

Container is a child of Form. Parents can be cast downwards to their child. But will fail if the object is not valid for that child. (See Cast Reference)

 

Given that bit of information, assume an object reference is stored in a variable called myRef.

If ((myRef as Form) as Container)
  ;is a container do something
Else
  ;is not a container do something else
EndIf

And as already mentioned SKSE's GetType can inform you if an object is a container.

If (myRef.GetBaseObject().GetType() == 28)
  ;is a container do something
Else
  ;is not a container do something else
EndIf
  • Recently Browsing   0 members

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