Editing Structs (Papyrus)

Jump to navigation Jump to search

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 52: Line 52:
</source>
</source>


You can, of course, make a property that is a struct. The editor will show a special UI for it that allows you to edit it.
You can, of course, make a property that is an struct. The editor will show a special UI for it that allows you to edit it.


Example:
Example:
Line 107: Line 107:
</source>
</source>


Usually you'll be assigning these directly to new struct variables, but if a function wants a struct, you can make the new struct in the function call, like so:
Usually you'll be assigning these directly to new struct variables, but if a function wants an struct, you can make the new struct in the function call, like so:


Example:
Example:
Line 145: Line 145:


=Casting Structs=
=Casting Structs=
Structs can be cast to strings, bools, or vars. If you cast a struct to a string, it will put each member in the struct inside brackets, separated by commas, prefixed by the member name, in the order they were specified in the script. If the struct is especially large, it may trim the string a little early and put an ellipsis on the end. If you cast a struct to a bool, it will be true if the variable is pointing at any non-none value, and false if it is none.
Structs can be cast to strings, bools, or vars. If you cast a struct to a string, it will put each member in the struct inside brackets, separated by commas, prefixed by the member name, in the order they were specified in the script. If the struct is especially large, it may trim the string a little early and put an ellipsis on the end. If you cast an struct to a bool, it will be true if the variable is pointing at any non-none value, and false if it is none.


Example:
Example:

Please note that all contributions to the Fallout4 CreationKit Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see FalloutCK:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)