Automated Tasks

Hey Folks! A good chunk of the day was on admin stuff, but I did manage to wrap-up most of the automated task system I was planning.

I ended up having to change the way IDs are assigned to objects when they mode switch. I needed the old ID applied to the new object before it started receiving conditions, so tasks triggered by adding a condition would have the right ID.

It took a bit of finagling, but once that was done, I could have items modeswitch and trigger a task without losing the ID info. This was particularly useful for cases where the new object needed to remove a task. We'd know the type of task we were looking for, but not a direct reference to the relevant task. With this new ID fix, we could just search existing tasks for the right mix of ID and task type, and delete it that way.

A sort of related problem was detecting when a condition was removed, so we could add and remove tasks based on that. Everything I had done so far required a condition to be added, not removed.

It turns out this wasn't too hard once the above changes were working. I just needed to add an extra parameter to the item to say whether the trigger is adding or removing the specified condition.

So as of now, we can add or remove tasks based on adding or removing a condition to an item, or adding/removing the item entirely. And currently, this is applied to damaged floors, triggering a repair task. Probably the next step is to setup some additional tasks for variety and quantity, and start seeing if the crew behave accordingly.