Difference between revisions of "Papyrus FAQs"

971 bytes added ,  12:33, 11 May 2016
imported>Digitalparanoid
imported>Digitalparanoid
Line 322: Line 322:
</pre>
</pre>


=== Why do the FindAllReferences* functions appear to return references in the player's inventory? ===
=== In the Papyrus log, why do the FindAllReferences* functions appear to return references in the player's inventory? ===
 
According to SmkViper:
 
<pre>
When a persistent reference is moved into a container, the container basically
ends up pointing to the original, now mostly-deleted, reference in the world.
FindAllReferences* is simply finding that mostly-dead reference in world and
returning it. If you were to pick up the item, and run far enough away,
FindAllReferences* likely will not find it, because the original reference is
nowhere near your location.
 
The inventory system is not designed to be iterated over in such a manner, and
Papyrus is generally is set up to discourage that kind of access by not providing
it at all, and (in F4) preventing you from receiving inventory events without
filters in place.
 
The good news is that several Papyrus functions can now interact more reliably
with the inventory in F4 so, for example, GetBaseObject will always work, no
matter if the object is in the world, in a container, persistent, or not persistent.
</pre>
 
=== Does the FindAllReferencesWithKeyword function accept a Formlist as a parameter? ===
=== Does the FindAllReferencesWithKeyword function accept a Formlist as a parameter? ===
=== Can structs store arrays, other structs, and var types? Can arrays store arrays? ===
=== Can structs store arrays, other structs, and var types? Can arrays store arrays? ===