Difference between revisions of "Useful Scripts"

Jump to navigation Jump to search
784 bytes added ,  19:46, 16 June 2011
no edit summary
imported>Henning
imported>Gribbleshnibit8
Line 446: Line 446:
End
End
</pre>
== Iterate Through Disable Objects==
Script Type: Object
;Script requires the [[Fallout Script Extender]].
<small>To be placed on an [[Activator]], and linked to a reference.
Usage involves linking the activator to a disabled reference. The disabled reference is linked in a loop with several other disabled references. Each activation will disable the previous reference and enable the next reference.</small>
<pre>
ScriptName LoopThroughReferences
ref currentRef
ref previousRef
ref nextRef
Begin OnActivate player
set previousRef to getSelf
Label 1
set currentRef to previousRef.getLinkedRef
set nextRef to currentRef.getLinkedRef
if currentRef.getDisabled == 0
currentRef.disable
nextRef.enable
else
set previousRef to currentRef
goto 1
endif
End
</pre>
</pre>

Navigation menu