I have a plugin I've made, and have been improving over some weeks now, Sensor SelfSwitch.
Currently, it checks the event note and page comments for tags, every update cycle.
This has kind of bugged me before, but a simple regex check shouldn't be a performance issue.
My recent work that I have not released yet changed the tag checking to use 1 regex variable to check against.
Today, I had the thought, since I'm already making a property on the event for the sensor range, and width where applicable, should I only check notes of all the events when a map loads and change the event property to be an array that indicates the type, range, width and direction of the sensor area. For the comment tags I would make it check when the page changes (if I can) and make the property part of the page.
I would still have to check every update cycle to see if the player has entered the sensor area.
So essentially all I'm cutting out is the tag check, but I would be able to add the ability to change the values in the array with a plugin command.
Another way to change it, would be to remove the property from the event and just pass the values through the functions. Since I'm only using the values when checking the tags now, having them as properties is pointless, they aren't changeable with a script call or anything.
I'm looking for thoughts on the subject, how would you handle this?
Clearly my design of the plugin wasn't great, this was primarily due to the fact that I wasn't expecting to add all the features of different sensor zones and whatnot.
Currently, it checks the event note and page comments for tags, every update cycle.
This has kind of bugged me before, but a simple regex check shouldn't be a performance issue.
My recent work that I have not released yet changed the tag checking to use 1 regex variable to check against.
Today, I had the thought, since I'm already making a property on the event for the sensor range, and width where applicable, should I only check notes of all the events when a map loads and change the event property to be an array that indicates the type, range, width and direction of the sensor area. For the comment tags I would make it check when the page changes (if I can) and make the property part of the page.
I would still have to check every update cycle to see if the player has entered the sensor area.
So essentially all I'm cutting out is the tag check, but I would be able to add the ability to change the values in the array with a plugin command.
Another way to change it, would be to remove the property from the event and just pass the values through the functions. Since I'm only using the values when checking the tags now, having them as properties is pointless, they aren't changeable with a script call or anything.
I'm looking for thoughts on the subject, how would you handle this?
Clearly my design of the plugin wasn't great, this was primarily due to the fact that I wasn't expecting to add all the features of different sensor zones and whatnot.