Difference between revisions of "Papyrus FAQs"

245 bytes added ,  01:47, 7 June 2016
m
Fixed indentation on script elements
imported>Digitalparanoid
(added Troubleshooting section)
imported>Kicoax
m (Fixed indentation on script elements)
 
(4 intermediate revisions by 2 users not shown)
Line 167: Line 167:
<PapyrusProject xmlns="PapyrusProject.xsd" Flags="Institute_Papyrus_Flags.flg" Output="D:\Steam\steamapps\common\Fallout 4\Data\Scripts" Optimize="true" Release="true" Final="true">   
<PapyrusProject xmlns="PapyrusProject.xsd" Flags="Institute_Papyrus_Flags.flg" Output="D:\Steam\steamapps\common\Fallout 4\Data\Scripts" Optimize="true" Release="true" Final="true">   
   <Imports>   
   <Imports>   
    <Import>D:\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\Base</Import> 
     <Import>D:\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User</Import>   
     <Import>D:\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User</Import>   
    <Import>D:\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\Base</Import>   
   </Imports>   
   </Imports>   
   <Scripts>   
   <Scripts>   
  <Script>AutoLoot\Fragments\Terminals\TERM_dubhAutoLootMenuAdvance_0100272C.psc</Script>   
    <Script>AutoLoot\Fragments\Terminals\TERM_dubhAutoLootMenuAdvance_0100272C.psc</Script>   
  ...   
    ...   
   </Scripts>   
   </Scripts>   
</PapyrusProject>
</PapyrusProject>
Line 285: Line 285:
=== Are arrays limited to 128 elements? ===
=== Are arrays limited to 128 elements? ===


According to SmkViper:
* Arrays that are created by scripts via the <code>New</code> operation or <code>Add()</code> function '''are''' limited to 128 elements.
<pre>
* Arrays returned by native functions, and editor-filled array properties, are '''not''' limited to 128 elements.
There is still an internal 128 limit on array items. Attempting to make an array larger than that will spit out an error at runtime.
</pre>


=== How do I create a dynamic array? ===
=== How do I create a dynamic array? ===


According to SmkViper:
Dynamic arrays grow to fit the number of elements.
 
To create an empty dynamic array, pass <code>0</code> as the size.
 
<code>
ObjectReference[] dynamicArray = new ObjectReference[0]
</code>
 
Also:


<pre>
* You can pass in a variable or calculation for the array size.
Arrays are now dynamic. To create an empty array, pass 0 as the size. You are
* You can call <code>Add()</code> and <code>Remove()</code> on the array to add and remove items.
now allowed to pass in a variable or calculation for an array size, and you can
call add and remove on the array to add and remove items.
</pre>


=== How do I create key-value pairs? ===
=== How do I create key-value pairs? ===
Line 345: Line 348:


=== Can CallFunction() be used for reflection? ===
=== Can CallFunction() be used for reflection? ===
According to SmkViper:


<pre>
<pre>
Line 357: Line 362:


=== How do I use custom events instead of CallFunction()? ===
=== How do I use custom events instead of CallFunction()? ===
According to SmkViper:


<pre>
<pre>
Anonymous user