Difference between revisions of "Reference Variables"
no edit summary
imported>DragoonWraith (this needs to be updated a la the Terminology Discussion) |
imported>Longcat |
||
(2 intermediate revisions by one other user not shown) | |||
Line 42: | Line 42: | ||
if myReferenceVariable != player | if myReferenceVariable != player | ||
</pre> | </pre> | ||
Note: This is not working consistently. It is advised to use: | |||
<pre> | |||
myReferenceVariable.GetIsReference player | |||
</pre> | |||
Example: | Example: | ||
Line 59: | Line 62: | ||
end | end | ||
Keep in mind, that References to non-persistent objects aren't accessible when the object is not in memory (i.e. in another cell) The same applies to inventory items that are currently within a container. Trying to access a non-accessible reference might have no effect at all, but it's equally probable that it will crash the game. While there are safeguards in the CS to prevent you from accessing such references directly, you can bypass them by using reference-variables. | Keep in mind, that References to non-persistent objects aren't accessible when the object is not in memory (i.e. in another cell). | ||
The same applies to inventory items that are currently within a container (i.e., items that an actor is carrying). This means that scripted functions which require a reference, such as: | |||
itemRef.pms ghosteffect 10 | |||
will only work on an item when it is not in inventory. The CS will warn you about this when using a reference variable on a carryable item, but it will not warn you if you use an implied reference, such as: | |||
pms ghosteffect 10 | |||
Trying to access a non-accessible reference might have no effect at all, but it's equally probable that it will crash the game. While there are safeguards in the CS to prevent you from accessing such references directly, you can bypass them by using reference-variables. | |||
Do so at your own risk... | Do so at your own risk... | ||
[[Category:Variables]] | [[Category:Variables]] |