Difference between revisions of "Checking if a Mod is affecting an Object"
Checking if a Mod is affecting an Object (edit)
Revision as of 04:44, 10 August 2010
, 04:44, 10 August 2010no edit summary
imported>Cipscis (Changed scripts to use GetIsReference) |
imported>Omzy |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 19: | Line 19: | ||
short sDoOnce | short sDoOnce | ||
ref rIsAffected | |||
Begin BlockName | Begin BlockName | ||
Line 28: | Line 29: | ||
; without preventing the OnLoad block from running | ; without preventing the OnLoad block from running | ||
else | else | ||
set rIsAffected to ObjectRefID.rIsAffected | |||
if rIsAffected.GetIsReference IsAffectedRef | |||
; Object has not been overridden | ; Object has not been overridden | ||
else | else | ||
Line 38: | Line 40: | ||
If you want to check whether or not a Mod is affecting an Object in a condition (for example, for a button on a message) then you'll have to use a bit of a workaround. Because these sorts of conditions can't check if a variable is equal to a reference, you'll have to do something like create a quest script declaring an "sObjectIsAffected" variable, and a result script like this: | If you want to check whether or not a Mod is affecting an Object in a condition (for example, for a button on a message) then you'll have to use a bit of a workaround. Because these sorts of conditions can't check if a variable is equal to a reference, you'll have to do something like create a quest script declaring an "sObjectIsAffected" variable, and a result script like this: | ||
set sQuestName.sObjectIsAffected to (ObjectRefID.rIsAffected | set sQuestName.sObjectIsAffected to (ObjectRefID.rIsAffected == IsAffectedRef) | ||
Now, you can check if "sQuestName.sObjectIsAffected == 1" in your condition. | Now, you can check if "sQuestName.sObjectIsAffected == 1" in your condition. | ||
== See Also == | == See Also == | ||
*[[Running_an_OnLoad_block_on_a_disabled_item|Running an OnLoad block on a disabled item]] | *[[Running_an_OnLoad_block_on_a_disabled_item|Running an OnLoad block on a disabled item]] | ||
[[Category: | [[Category:Advanced_Modding_Techniques]] |