Difference between revisions of "Talk:Variables and Properties"
Jump to navigation
Jump to search
Talk:Variables and Properties (edit)
Revision as of 17:27, 14 February 2012
, 17:27, 14 February 2012→"Warnings" Unclear: new section
imported>Doulos |
imported>Cipscis (→"Warnings" Unclear: new section) |
||
Line 29: | Line 29: | ||
Ah, I think I figured it out. I'll keep all of this up here in case someone else might benefit from it. I'm so used to Oblivion and how quests own variables. So I was assuming that I should be able to something like MyQuest.IntProp. But that's not the case. I have to attach a quest property (value MyQuest) to my AME script because that's the quest wherein the variable of interest lies. However, the property "IntProp" doesn't belong to MyQuest, it belongs more specifically to the script to which it it attached. So, if I want to use the properties of MyQuest, I have to cast the QST property as MyQuestScript, since the script contains the property I want. --[[User:Doulos|Doulos]] 14:49, 11 February 2012 (EST) | Ah, I think I figured it out. I'll keep all of this up here in case someone else might benefit from it. I'm so used to Oblivion and how quests own variables. So I was assuming that I should be able to something like MyQuest.IntProp. But that's not the case. I have to attach a quest property (value MyQuest) to my AME script because that's the quest wherein the variable of interest lies. However, the property "IntProp" doesn't belong to MyQuest, it belongs more specifically to the script to which it it attached. So, if I want to use the properties of MyQuest, I have to cast the QST property as MyQuestScript, since the script contains the property I want. --[[User:Doulos|Doulos]] 14:49, 11 February 2012 (EST) | ||
== "Warnings" Unclear == | |||
At the moment, the "Warnings" at the bottom of the page reads like this: | |||
"Be careful with variables and auto properties on scripts that are extended by other scripts - especially where some script somewhere else may have a property pointing to the base script, or trying to cast to the base script. This is because it would be possible to have two copies of a script attached to the same object, thereby creating two copies of the variable/auto property - and the other scripts that refer to the base script may randomly pick which one to talk to. | |||
This is doubly-true of scripts with native functions, as the game can attach these to in-game objects at any time if it needs to, thereby creating another copy of the variable or auto property." | |||
To me, at least, this seems rather unclear. Could anyone help me decipher it? | |||
-- [[User:Cipscis|Cipscis]] 17:27, 14 February 2012 (EST) |