Jump to content

How to place massive actors in different places


Delzaron

Recommended Posts

Posted

Hi

 

I wish to place 40 skeevers on 4 different places, and to call them back once the quest finish.

 

Ok, I could make lines for each skeever, but it will be an heavy script.

 

I think there is a solution with a while loop, but mine don't work (I can't set an actor).

 

Function SkeeversInvasion1()
    int i = aNovel_Skeevers1to10.length
    int pos = -1
    while i
        i-=1
        Actor a = toBeAssigned.getActorReference()
        if !a || a.isDead()
            pos = i
            i = 0
        endIf
    endWhile
        if pos==-1
            ; No empty slots
            debug.notification("No skeever found!")
            return
        endIf
    toBeAssigned.moveto(aNovel_Skeever_InvasionSpot1REF)
    debug.messagebox("some skeevers are coming")
Endfunction
 

Posted

Green: Set the Creation of a outside of loop. Should be faster.

Red: Perhaps using the index is missing?

 


Function SkeeversInvasion1()
    int i = aNovel_Skeevers1to10.length
    int pos = -1

    Actor a;
    while i
        i-=1
        a = toBeAssigned.getActorReference()
        if !a || a.isDead()
            pos = i
            i = 0
        endIf
    endWhile
        if pos==-1
            ; No empty slots
            debug.notification("No skeever found!")
            return
        endIf
    a.moveto(aNovel_Skeever_InvasionSpot1REF)
    debug.messagebox("some skeevers are coming")
Endfunction

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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