Difference between revisions of "Talk:Extending Scripts (Papyrus)"
m
kinggath
imported>Qazaaq (→Using constant scripts and inheritance overrides: new section) |
imported>Qazaaq m (kinggath) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
EndFunction | EndFunction | ||
</source> | </source> | ||
<source lang="papyrus"> | |||
ObjectReference[] LinkedRefs = SomeObject.GetLinkedRefChildren() | |||
int i = 0 | |||
while(i < LinkedRefs.Length) | |||
LinkedRefs[i].Disable() | |||
i +=1 | |||
endwhile | |||
</source> | |||
For example, let's say you have the example above, your Disable function will not be called unless you explicitly cast the object as that type in a call to disable. | For example, let's say you have the example above, your Disable function will not be called unless you explicitly cast the object as that type in a call to disable. | ||
If instead you remove Const, when the native Disable function is called, it will use your override version as expected. [[User:Scrivener07|Scrivener07]] ([[User talk:Scrivener07|talk]]) 2018-07-05T01:06:38 (EDT) | If instead you remove Const, when the native Disable function is called, it will use your override version as expected. If a DisableCheck object was among those, the overridden version of Disable() will be called. As long as DisableCheck is not a Const type. Notes from Kinggath: [[User:Scrivener07|Scrivener07]]([[User talk:Scrivener07|talk]]) 2018-07-05T01:06:38 (EDT) |