Difference between revisions of "Bethesda Tutorial Papyrus Events and Properties"

m
Reformatted the table here to be consistent with the rest of the page
imported>Electrosheep
m (typo)
imported>Electrosheep
m (Reformatted the table here to be consistent with the rest of the page)
Line 181: Line 181:
</source>
</source>


<!-- No idea how to apply Template:InDepth to a table. Ideas welcome! -->
{{InDepth|
::{|style="border-collapse: separate; border-spacing: 0; border-width: 1px; border-style: solid; border-color: #000; padding: 0"
* '''objectReference''' - This is the data type of our new property.
|-
* '''myTrigger''' - As before, this is a name we've chosen for our new property.
|style="border-style: solid; border-width: 0"|[[Image:InDepth.jpg|48px]]
* '''if''' - This is the beginning of an '''"if statement'''. If the statement beneath the if is true, then the script will run. Otherwise, Papyrus skips ahead and resumes processing commands after the corresponding '''"endIf"''' below.
|style="border-style: solid; border-width: 0"|
* '''(akActionRef <nowiki>==</nowiki> myTrigger)''' - This is our test condition. The "<nowiki>==</nowiki>" is a logical operator which translates to "is equal to". In this case, it's telling the '''"if"''' statement to continue only if ''akActionRef'' and ''myTrigger'' are filled with the same reference.
{|
* '''endIf''' - This is necessary to close any '''"if"''' statement. It's possible to have multiple if statements within each other for more complicated operations, so it becomes important to keep track of your logic using these. When an '''"if"''' statement is beneath another '''"if"''' statement, it is said to be nested.}}
|align="center"|'''objectReference'''
|This is the data type of our new property
|-
|align="center"|'''myTrigger'''
|As before, this is a name we've chosen for our new property
|-
|align="center"|'''if'''
|This is the beginning of an '''"if statement"'''. If the statement behind the if is true, then the script below will run. Otherwise, Papyrus skips ahead and resumes processing commands after the corresponding '''"endif"''' below.
|-
|align="center"|'''(akActionRef == myTrigger)'''
|This is our test condition. The '''"=="''' is a [[Papyrus_Glossary#L|logical operator]] which translates to "is equal to". In this case, it's telling the if statement to continue only if ''akActionRef'' and ''myTrigger'' are filled with the same reference.
|-
|align="center"|'''endIf'''
|This is necessary to close any if statement. It's possible to have multiple if statements within each other for more complicated operations, so it becomes important to keep track of your logic using these.
|}
|}
Anonymous user