Jump to content

Weird line silently breaking while loop and script


Recommended Posts

an idea I'd like to run past ya

 

Could you get rid of one of the checks in your mod by doing this?

 

if the first reference is ALWAYS your player anyways

that is IF arSomeArray[0][["actor"] IS AWAYS player/playerref

how bout skip the first array assignment/check altogether

 

let iIndex := 1

 

Now you are just looking through your array for your companion references rather

than yourself.

Link to comment
Share on other sites

Yeah, I could do that to save 3 lines of code, but only if the player will always be at index 0. The actors array is not designed to be that way. It just tracks stats for actors independent of the order in which they're put inside. Right now the Quest script puts the player into it at the very first coming occasion. But there's no telling there're won't be other scripts coming later, which might, due to race conditions or whatever, sometimes happen to come first, before the player, so another actor would take index 0. It's just not safe to assume I can "always" start from 1 for companions I'm afraid.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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