Friday, January 4, 2019

Third update to the Police Collar

Hello and Happy New Year !

Yes, this is yet another update to the Police Collar, and this one is about popular requests. There are a few of them, plus a few bug fixes, and I will develop for each one of them below.

There's a lot to say so if you don't want to read, here is the "tl;dr" version :

- The Police Collar is now able to suppress your speech after a punishment, even if you are gagged with RR gags. The speech suppression lasts until your vision returns to normal.

- The Police Collar is no longer restricted to just your user name or display name when it comes to finding out if you're speaking or not. The keyholder can now specify additional names to also monitor renamers you could be using (or RR gags with the "rename" function on).

- The Police Collar will no longer punish you when you are trying to struggle out, except when you fail a move (so it will punish you, just not as often).

- The level of punishment is chosen in a smarter way now.

- The relative position monitoring (a.k.a. "Stay close to Mistress, girl") is now working perfectly in all cases, with the right tolerance and all.

To update your collar and get these new features, you need to go to one of these locations :

My Little Shop
Chorazin's store
Roper's Dark Playground
Dark Wishes

Once there, click on the updater and follow the instructions. You need to choose "REPLACE" for this one as both the Zapper plugin and its Zapper_slave script have been modified, and the latter is contained in a child prim so the updater cannot update it without a replacement. Don't forget to save your times. If you do not get a "REPLACE" option, contact me (Marine Kelley) to get a manual replacement.

Now that this is out of the way, let's get into the specifics.

Speech suppression

I've often been asked to make it so the collar would suppress the speech after being zapped, and this makes sense as the current goes through the throat, it would be normal to paralyze it for a short time.

Problem is, what about gags ? Suppressing the direct speech is easy, but there is no way for an object to suppress the chat redirection RLV command that most gags use, so the sub would still be able to speak through a gag even after a punishment since when they speak it goes to a private channel instead of channel 0.

Well it works now, as long as the gags you use are RealRestraint gags (Deluxe gag, Ring gag, Ball gag, Tape gag, Isolation Hood or Mummy Gag), because they have a nice feature : they negotiate between each other to find out which one should garble the speech and which one should animate the mouth. If they didn't, wearing more than one gag at the same time would lead to double garbled speak unless all of them but one were set to "silent".

This is what the Police Collar will do from now on as well. When you are zapped, it pretends it is a very tight gag that supersedes all the others for a short time, that way you can't cheat. Even better, the speech suppression does not occur right away, you have 3 seconds during which you can speak and emote at will (this replaces the former allowance of 10 characters and 1 message only). After this delay, if you say something or emote something that goes beyond 20 characters ("/me" included), then whatever you say will be replaced with a predefined, random emote. That way you won't believe there is a bug or some chat lag when you try to say something after being punished, it is clear that your speech is restricted.

If the gag(s) you are using is not RealRestraint, then the speech suppression won't work, obviously, so you have a switch in the Options menu to completely deactivate it so it does not emote automatically.

The speech suppression remains active as long as your vision is blurry. You can speak again as soon as the vision returns to normal.

There is a switch in the Options menu named "Repl. chat" (replace chat). It is on by default but if you turn it off, your chat and your emotes (regardless of length) are suppressed after a punishment and are not replaced with a random emote. This is good for the case when you are using a renamer or a gag that is not from RealRestraint, as those cannot be suppressed by the collar. Keeping the switch on would add a dummy emote after everything you say through the renamer.


Tracking renamers

The second popular request was about renamers. RealRestraint gags and some other attachments are able to grab your redirected speech and say it on the public chat channel with another name than your own. For example, if you use a RR ball gag and use its "rename" function in the Gag plugin, you can rename yourself to whatever you want. If you enter "Pony", then whatever you say will be said by the gag under the name "Pony", be it direct chat or emotes.

But then, how does the Police Collar know it is you who's speaking ?

Simple, by letting the keyholder manage a list of names to monitor. By default, your user name and your display name are automatically monitored, meaning that if you speak under that name (or any of your attachments, for example a RR gag which renamer is not set), then the collar will detect that you are speaking and will punish you.

But the keyholder can add more names to that list and remove others (they can't remove the user name and the display name though, those are always monitored). They can do that either by entering the list by hand, with names separated by commas (","), or they can add or remove the name of the last attachment of yours that spoke at that time.


In the Speech menu, the keyholder can add a list of names, remove a list of names, set a list of names from scratch (remember, the display name of the wearer is always in the list, it can't be removed), say the list on the private chat, or add or remove the last speaking attachment for ease of use. If "monitored" appears after "Last speaker", this means that this attachment is already in the list.

For memory reasons, the list cannot contains more than 10 names, display name of the wearer not included. It will fail silently if you try to add more.

When your speech is suppressed and you try to speak or make a long emote, the collar will say a random emote instead, with the name that was used last time you were punished. That way, it will look like it is you who's making the emote.

For example, if your gag is set to name you "Pony" and you speak on the chat, your keyholder can just press the "Add last" button on the Speech menu and "Pony" will be added to the list if it is not already there. Next time you speak through that gag, the collar will know it's you and it will punish you. And then if you try to speak again, it will emote instead with the name "Pony", as if you were talking through your gag again (but it won't punish you for it this time).

There is a known limitation due to how the listener is managed. The collar can detect who is speaking only when the Speech restriction is set, otherwise the public listener is off to avoid unnecessarily listening to the chat (listening to public chat requires more script time if the area is busy and everyone is talking on the chat, even if you optimize the listener as much as you can). This means that when the speech is not monitored, when you are punished and your speech is temporarily restricted it will speak for you with your own name, as it cannot guess what name your gag or other renamer may be renaming you to.

When the sub is punished and her speech is momentarily suppressed, as I pointed out above the collar says a random emote on the chat instead... with the name of the last speaking attachment which name is monitored by the collar. Confusing ? Let me give you an example.

Suppose you are gagged and your gag renames you "Pony". If your speech is monitored by the collar and you speak on the chat and it punishes you, then your speech becomes suppressed for a few seconds until your vision is no longer blurry. If you speak during the speech suppression period, then instead of letting you speak or make a long emote, it will say an emote on the chat with the name "Pony". This name is the name of the last attachment of yours that spoke on the chat before the punishment (remember, "Pony" is the name of the gag when it speaks, not yours, and the gag is an attachment, not an avatar, yet it has to pretend to be one) and which name belongs to the list of monitored names. There may be others names, of course, depending on what your keyholder has written in it.

Problem is, if the speech is not monitored, the public listener is off, so the collar has no way to know that "Pony" has been speaking (nor should it care). But if you are punished for another reason, for example for being too far from your keyholder, your speech must be suppressed all the same, meaning that if you speak (through a gag or not), then that chat must be replaced with an emote... but with what name ? The gag does not know if you are speaking or if it is one of your attachments.

So all it does is tell all your worn RR gags "hey, gags, I'm taking over for now so be quiet" and redirect your chat to a particular channel temporarily. When you speak, it detects it and speaks for you on the public chat, either with a random emote or with your own emote if it is less than 20 characters long. If your speech was not monitored (i.e. if you are punished for any other reason), then it will not even try to guess what name you should be renamed to (because it can't know) and will just emote with your own avatar's display name. So don't be surprised if the renaming does not work all the time. It works well when the speech is monitored, and it does not work if it is not monitored, this is a known limitation.

You could ask "how about using the last name that was used by the sub in all circumstances ?", but in that case, what happens when the keyholder deactivates the speech monitoring while the sub was using a renamer, and had her name changed afterwards ? The collar wouldn't know since it wouldn't listen and it would still use the old name. It would be even more confusing than reverting back to the name of the avatar.


I have extended the penalties system of the speech monitoring to the other three monitors (relative position, absolute position and tampering). What I mean by that is that now when you get punished for the first time in a while, the punishment is light. The second one is harder and the third and subsequent ones are the hardest. Punishments are level 1 (lowest) to 3 (highest) but penalties can go over 3 so the more you get punished in a short time, the longest it takes to go back to  normal.

Every minute the "heat" goes down a notch until it reaches 1.

For example, if you are restricted to stay within a certain distance from a fixed position with a tolerance of 5 seconds, then the first time you step out of that area for more than 5 seconds you will be punished with a light zap (level 1). If you stay there for 5 more seconds, you will be zapped a second time with a medium zap (level 2). If you keep staying there you will get zapped at the highest level (level 3) every 5 seconds. And if you go back to the allowed area for 1 minute after having been zapped three times then step out again, you will get a medium zap again (and then high zaps while you stay out).

Unlike the speech monitoring, these penalties are not written in the menu because they are more like a dynamic way to choose the level of punishment, but they're there.


Until now, trying to struggle out automatically punishes the sub at each try. It is too deterministic so now the collar punishes only failed attempts, but successful attempts go unnoticed.

More over, there is now a switch in the Options menu named "Monit. Tamper.". If it is off, then the collar will not punish the sub for struggling at all.

Bug fixes

- We could get a "@clear" RLV command sent to a viewer with RLV inactive. I haven't seen or heard about this happen but it was possible in the code, so now it's conditioned by the detection of the RLV.

- The relative position monitoring did not work until at least one punishment was issued, if the keyholder was online but in another sim.

- The relative position monitoring did not work with a tolerance higher than 10 seconds.

- The default maximum distance in the absolute distance monitoring is now 20 m instead of 200 m. It was meant to be 20 m by default since the beginning (of course nothing keeps you from setting it back to 200 m manually).

- Fixed a typo when activating the Zapper.

Have fun !