Editing Reference functions
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 1: | Line 1: | ||
Most script functions are reference functions. This refers to the fact that they must be run on an [[Reference|object reference]]. Reference scripts (object scripts and dialogue result scripts) can use implicit reference syntax. For example: | Most script functions are reference functions. This refers to the fact that they must be run on an [[Reference|object reference]]. Reference scripts (object scripts and dialogue result scripts) can use implicit reference syntax. For example: | ||
: GetFactionRelation player | |||
GetFactionRelation is a reference function -- whose faction relation are you asking for? In this case, since we did not specify a reference, it is implied that we are really saying: | GetFactionRelation is a reference function -- whose faction relation are you asking for? In this case, since we did not specify a reference, it is implied that we are really saying: | ||
:thisReference.GetFactionRelation player | |||
You can always use explicit reference syntax, meaning that you explicitly specify the reference to run the function on. [[Non-reference scripts]] MUST use explicit reference syntax, since they are not running on an object reference. For example: | You can always use explicit reference syntax, meaning that you explicitly specify the reference to run the function on. [[Non-reference scripts]] MUST use explicit reference syntax, since they are not running on an object reference. For example: | ||
:LucasSimmsRef.GetFactionRelation player | |||
Here we are asking for Lucas Simm's faction relation towards the player. This syntax could be used in any script, because we have made the function's reference explicit. | Here we are asking for Lucas Simm's faction relation towards the player. This syntax could be used in any script, because we have made the function's reference explicit. |