Jump to content

Formlist of NPCs, how to convert to each entry to actor ?


F4llfield

Recommended Posts

Posted (edited)

Hi,

I created a Formlist of NPCs and I need to iterated in loop and extract an actor from that list, how can I do that ?

I know how to do the loop for each formlist entry, but how can I convert a form to an actor is my question. Since there is no ActorList function.

Edited by F4llfield
Link to comment
Share on other sites

You mean something like this?

Scriptname testScript


FormList Property ActorList Auto Const




Function LoopActorsInList()

	Int ListSize = ActorList.GetSize()
	Int Index = ListSize - 1

	While Index >= 0
		Actor LoopActor = ActorList.GetAt(Index) as Actor		; cast the Form as Actor
		If LoopActor

			; found actor in list

		EndIf
		Index = Index - 1
	EndWhile

EndFunction

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...