Jump to content

Why are AI packages slow to start


SMB92

Recommended Posts

Hi folks,

 

I am curious to know the answer to the topic. I am spawning actors at hand placed points (xmarkers) and while the function itself completes very quickly, actors don't start their packages until a few seconds later. They don't fire in parallel either as each actor starts moving one by one.

 

In general we have noticed AI packages to be slow to start in all cases in the game.

 

Any ideas how to improve this or what the deal is? Is the package script/engine really this latent?

Link to comment
Share on other sites

Actors evaluate their packages every few seconds so they they won't make a change (assuming all conditions, etc support that change) until the next time they do their scheduled package evaluation which happens every few seconds.

 

The two ways I know of to force that evaulation are:

 

1) script that change with evaluatepackage()

 

2) use scenes to get them to do stuff because as they go in/out of scenes they will automatically change packages as the scene starts/ends and do it pretty much immediately on start/end

Link to comment
Share on other sites

Thx for the reply. So what about using the start fragment on the package? Or seems it is applied by refalias, adding the script there? Or I suppose I could issue the command straight after I've applied the package...

 

I'm looking at ways I can place a small script on each actor the will keep them persistent for a small amount of time while they are in the loaded area, dead ir alive, so that when the spawnpoint issues its deletewhenable command the NPC won't magically disappear until the cell is unloaded.

Link to comment
Share on other sites

After spawning the actor, call EvaluatePackage() on it. E.g:

Function DoSpawn(ObjectReference akObjRef)
    Actor actorSpawned = PlayerRef.PlaceAtMe(akObjRef)as Actor
    actorSpawned.EvaluatePackage()
EndFunction
Edited by FiftyTifty
Link to comment
Share on other sites

  • Recently Browsing   0 members

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