I was nearly driven to tears at one point today, by this scripting project. So much so I ended up lying in bed with a pad of paper, scribbling notes, because I couldn't stand sitting in front of the computer one moment longer.
Today I managed to devise a 'standard' for how the linkmessages within the HUD will be done. The challenge and response messages are nearly identical, but one sends a integer, and the other returns a key. I decided to use the 'integer' and 'key' elements of linkmessages to accomplish this, which was actually quite a stunning solution that I'd spent hours fighting with before I realized I could just use the integer and key slot intrinsic to every linkmessage. duh.
I also came up with a rather elegant (I think) way to compound the productID and partID into a single prefix expression, and how to test for it.
if (prefix != productID + partID && prefix != productID) return;
I'm seriously proud of that.
I managed to get the texture controls working with this system, able to integrate an included partname in the texture change controls, into the message being sent, and using the above test, telling the receiver how to deal with the information, and whether to act on it, or ignore it.
This should drastically reduce 'heat' in multi-part products when a message is only meant for a certain part (the boots, in the siren AV, for example).
My next task will be to integrate this technique into the other existing HUD controls. The buttons and toggles and such should be FAIRLY easy. The bitwise stuff I'm expecting to be QUITE challenging, as will be the radio button stuff. The Color changer will probably be the hardest of all to add this functionality to. I may end up "cheaping out" and just having those harder controls generate some 'heat' in unaffected parts... just because I'm having a very hard time picturing how I could integrate that information into a bitwise set.
Maybe get the target information from the clicked control and assume it's the same on all searched and found controls in the same bitwise or radio set? If that's greek to you, don't worry. it's pretty hard to follow for me too. but there might be a trick hiding in that statement, that I can use tomorrow.
cryptic note to self: on searching prim descriptions, find ?'s and check for matching partID before parsing the tags in the control? or just ignore everything before and including the "?" perhaps?
No comments:
Post a Comment