Editing Papyrus FAQs
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 16: | Line 16: | ||
=== To whom do I send fan/hate mail about Papyrus? === | === To whom do I send fan/hate mail about Papyrus? === | ||
[https://community.bethesda.net/people/SmkViper SmkViper] created Papyrus and actively helps scripters in the | [https://community.bethesda.net/people/SmkViper SmkViper] created Papyrus and actively helps scripters in the official Fallout 4 Creation Kit forum. | ||
== First Steps == | == First Steps == | ||
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> | ||
</Imports> | </Imports> | ||
<Scripts> | <Scripts> | ||
<Script>AutoLoot\Fragments\Terminals\TERM_dubhAutoLootMenuAdvance_0100272C.psc</Script> | |||
... | |||
</Scripts> | </Scripts> | ||
</PapyrusProject> | </PapyrusProject> | ||
Line 196: | Line 196: | ||
== Advanced == | == Advanced == | ||
=== Are While loops safe to use for persistent or continuous effects? === | === Are While loops safe to use for persistent or continuous effects? === | ||
Line 285: | Line 281: | ||
=== Are arrays limited to 128 elements? === | === Are arrays limited to 128 elements? === | ||
According to SmkViper: | |||
<pre> | |||
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: | |||
To create an empty | <pre> | ||
Arrays are now dynamic. To create an empty array, pass 0 as the size. You are | |||
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 311: | Line 304: | ||
make one struct variable your key, and the other the value, and then run Find on | make one struct variable your key, and the other the value, and then run Find on | ||
the key. (Unlike maps, duplicates are permitted since it's just an array.) | the key. (Unlike maps, duplicates are permitted since it's just an array.) | ||
</pre> | |||
=== When I call Activate() on a stack of items dropped by the player, only one item in the stack is returned. === | |||
This is a known issue, but it is unknown whether there will be a fix. If there is a fix, there will be an alternate function. | |||
According to SmkViper: | |||
<pre> | |||
We don't add or change parameters to existing functions after they've been | |||
released (because it would require all scripts using that function to be changed | |||
or recompiled). That's not to say new functions cannot be added, but no promises. | |||
Because of the heavy use of Activate in scripts, I'm very wary of changing its | |||
behavior, but I'll look into it. An alternative solution might be to add an | |||
ActivateAll function instead of "fixing" Activate. | |||
</pre> | </pre> | ||
Line 335: | Line 344: | ||
</pre> | </pre> | ||
=== 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? === | ||
=== Can CallFunction() be used for reflection? === | === Can CallFunction() be used for reflection? === | ||
=== How do I use custom events instead of CallFunction()? === | === How do I use custom events instead of CallFunction()? === | ||
=== I can't figure out what scripts govern the supply lines! Halp. === | |||
== | |||
=== | |||