4/8/19

A State Of Many Possibilities

Back in The Fates We Weave, my webbing state used plenty of states and notetags.  There were three webbing states for the head, hands and feet, where obtaining the required amounts in each would evolve the webbing states to a cocoon state.  The requirements used a tag that changed how many limbs need to be webbed down, though there was also an alternative tag that would count how many webbed states there are (in case you were fighting a snake).  Of course, there was also code to ensure that any extra webs would be applied to a limb that still needs webbing.  You can imagine how compact the code is.

For this project, I was going to have restraints Fix equipment, meaning I would have to have 5 states to fix 5 slots plus a six as a "merged state".  So instead, I went about seeing if I can drop that to 1 state (2 technically, but since I have a script merging state charges with character graphics, I think I can reduce the amount to 1).  And I got it to work.

So first, I set up a tag on a state.  I also set up a double-array in my battlers, where the first array is based on the state id and the second array holds a "parts count".  If that state has no tag, it returns an empty array.  If that state does hold the tag, it will add a new number (preset - current and add a sample) or remove an old one (remove a sample) based on its size, and also empty the array if the state is not on.  And in the case of the actor...I can disable the ability to change equipment if the array includes the slot id!  For example, two state charges of Ropes can Fix the head and feet (2 and 4).

And of course, that did get me thinking: if a Rope Cocoon would cause me to hop, wouldn't having ropes on my ankles also cause me to hop?  So I added a second notetag, this time storing a string of letters.  Each letter was a shorthand for another feature of a script like muting with Gagspeak or getting Stuck in the Bondage Movement System, and each letter would also relate to a specific slot id.  And then I would check each state if the notetag includes that letter and if the tie-up array includes that slot.

Hm, I can ship this with state charges, but it may be possible to make this work without state charges, but probably not for this project.  Regardless, there are two other features I can add:  Changing the amount of ropes needed (which increases the starting array and thus the current array as well) and a tag to activate bondage features if the array is full (For instance, a mummy is wrapped up with legs separate but is forced to hop when fully mummified).