X3AP: Task management for lasertowers

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
User avatar
Quinch
Posts: 353
Joined: Thu, 10. Jun 04, 01:09
x3tc

X3AP: Task management for lasertowers

Post by Quinch » Sun, 25. Aug 13, 00:54

So I'm working on a script that will add a bit of fine-tuning to lasertower behavior - and I'm unsure how to go about doing that without creating a massive resource hog. Or, to be precise -

It will run on hundreds, if not thousands of objects {lasertowers, specifically}
Each object will spend most of its time idling
But also, each tower needs to react quickly when an enemy comes into range

Right now, the only way I can think of would be to have each tower constantly check if there's an enemy in range, and act if it's true. However, that creates a sliding scale of CPU vs. reaction - shorter intervals mean more lag, longer intervals mean longer average reaction time.

So my question is, are there alternatives? How does the "Default attack" script they run on normally function when it comes to detection?
I wasn't banished to the moon yesterday.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”