Jump to content

[LE] Will using arrays speed up script performance/speed?


Recommended Posts

Performance or speed really depend upon what it is you are trying to do. The advantage to using arrays and even form lists is that you can use a while loop to iterate through each entry rather than listing out an "If block" for each object / variable. Which in turn makes it easier to add new entries down the road.

Link to comment
Share on other sites

For all 20+ actors, I am checking for each actor if they have a bow equipped,and if so, they will perform X, otherwise they will perform Y. Wondering since I have already written an if statement for each actor already if this is worthwhile. The time to check takes at least a second or more in most cases, wondering if arrays can speed this process up so it takes less than a second or instant if possible.
Link to comment
Share on other sites

For all 20+ actors, I am checking for each actor if they have a bow equipped,and if so, they will perform X, otherwise they will perform Y. Wondering since I have already written an if statement for each actor already if this is worthwhile. The time to check takes at least a second or more in most cases, wondering if arrays can speed this process up so it takes less than a second or instant if possible.
Link to comment
Share on other sites

Are your actors custom actors? What event are you using? A way to speed it up is to put a script on each actor as Events are multi threaded, instead of referencing 20 actors in the same script. If they're vanilla actors, you can put each one in a reference alias in a quest, then put a script on each reference alias with the event.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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