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 | 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 | 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 | 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: |