That'll Buff Out
Hey Folks! Mostly a dev day today, though I did need to get a few important emails out.
I continued work on the tasking system from yesterday, this time trying to get automatic task generation setup. So far, we've generated new tasks whenever items of a certain type were added to or removed from the ship. This works if you explicitly define a listener for each named item type, but we're expecting to have multiple variants of each item type in some cases. And that could add-up fast.
What's more, there are some situations where a task should be generated outside of when items are added/removed. For example, a periodic maintenance check on an item, or a course correction on a nav station. These are likely to be flagged by the appearance of a condition, not the spawning of an item.
So I did a bit of tweaking today to add listeners to CondOwner (CO), the class that controls game object logic. I struggled a bit with how best to handle this, as there are a few different ways things are triggered on a CO.
I eventually noticed that my "update commands" fit the bill, and I could just add another one of those to listen for certain conditions, and fire an "AddTask" call when it appears. E.g. if nav station's timer expires and gives it a "check me" condition, this listener will create a new task for that.
This is almost working, though it appears to be assigning the wrong target ID to the task, resulting in a task with a null target. I think it's just a matter of changing the order in which certain values are set, to ensure the ID is correct. I'll also have to figure out how reliable this is for removing said task if the item ever loses the condition before the task is done (if applicable).
More on that tomorrow!