Complete Example Scripts: Difference between revisions

Jump to navigation Jump to search
m
imported>JustinOther
m (→‎Cycle Through a List of Objects and Perform an Action on Each Object(FormLists): Got rid of extraneous var/loop/akReference = ListOfObjectsFLST.GetAt(0) As ObjectReference)
imported>JustinOther
Line 135: Line 135:
If akActionRef == Game.GetPlayer())
If akActionRef == Game.GetPlayer())
iIndex = ListOfObjectsFLST.GetSize() ; Indices are offset by 1 relative to size
iIndex = ListOfObjectsFLST.GetSize() ; Indices are offset by 1 relative to size
While(iIndex > 0)
While(iIndex > 0)
iIndex -= 1
iIndex -= 1
akReference = ListOfObjectsFLST.GetAt(iIndex) as ObjectReference ; Note that you must typecast the entry from the formlist using 'As'. I use ObjectReference so that IsEnabled() becomes accessible. Use Actor if you want to perform actor functions and the formlist contains actors.
akReference = ListOfObjectsFLST.GetAt(iIndex) as ObjectReference ; Note that you must typecast the entry from the formlist using 'As'.
If akReference.IsEnabled()
If akReference.IsEnabled()
akReference.Disable()
akReference.Disable()
Else ; If akReference.IsDisabled()
Else ; If akReference.IsDisabled()  
akReference.Enable()
akReference.Enable()
EndIf
EndIf
EndWhile
EndWhile
EndIf
EndIf
EndIf
EndEvent</source>
EndEvent</source>
Anonymous user

Navigation menu