MV Is there a plugin that allows you to turn on self-switch events in a show-text event?

I am trying to make talking animations for overworld sprites by using self switches. Here are two screenshots that show what I am doing to make the animation work. The only problem I have is that I would like to turn the self-switch on at the end of the dialogue so the event stops making the talking animation. How can I do this? I really need to figure this out so help would be much appreciated.
why did you turn on self switch A on at the beginning of the event? :/ You can simply turn it on at the end so that the next page is triggered. That will turn off the animation.
@cokes1999 In other words you wish to make something like in undertale:
while text is typing in message window -> play talk animation and when text is done, but window is still open -> stop talk animation.
Right?
@cokes1999 In other words you wish to make something like in undertale:
while text is typing in message window -> play talk animation and when text is done, but window is still open -> stop talk animation.
Right?
Yeah! I posted something similar in a thread that you responded to. I don't believe the moghunter plugin you linked allows me to do this.
why did you turn on self switch A on at the beginning of the event? :/ You can simply turn it on at the end so that the next page is triggered. That will turn off the animation.
I want the animation to start right before the text. So I turn on the switch before. Don't really understand what you mean. Either way, this doesn't help my issue. I want the animation to end inside of the show text event.
One simple option is just to automatically close the message window shortly after the text is done, e.g.
Code:
Show Text: Hello there!\|\^
I wouldn't recommend it, though, because people read at different speeds...just mentioning it for completeness. 😴

If the message is shown via a non-Parallel map event, I think you could toggle self-switch A of "this event" with this script call (untested):
JavaScript:
var mapId = $gameMap.mapId();
var evtId = $gameMap._interpreter.eventId();
$gameSelfSwitches.setValue([mapId, evtId, 'A'], false);
Then you just need a way to invoke that script when the text is done displaying.

One option: I have an RMMV plugin called Cae_CustomEscCodes that lets you define your own escape sequences (a.k.a. text codes, stuff like \i[x], \|, etc) for use in messages. With that, you could try making a custom "Process"-type text code (because you want it to process when the message reaches it) with the above script, then add that at the end of your messages. 🙂
One simple option is just to automatically close the message window shortly after the text is done, e.g.
Code:
Show Text: Hello there!\|\^
I wouldn't recommend it, though, because people read at different speeds...just mentioning it for completeness. 😴

If the message is shown via a non-Parallel map event, I think you could toggle self-switch A of "this event" with this script call (untested):
JavaScript:
var mapId = $gameMap.mapId();
var evtId = $gameMap._interpreter.eventId();
$gameSelfSwitches.setValue([mapId, evtId, 'A'], false);
Then you just need a way to invoke that script when the text is done displaying.

One option: I have an RMMV plugin called Cae_CustomEscCodes that lets you define your own escape sequences (a.k.a. text codes, stuff like \i[x], \|, etc) for use in messages. With that, you could try making a custom "Process"-type text code (because you want it to process when the message reaches it) with the above script, then add that at the end of your messages. 🙂
I have little to no knowledge of Javacript but this looks promising! Where would I put this script in the plugin? I would honestly commission someone if they could figure this out for me
In this post, I'll use "select" to mean double-click (or right-click > Edit).

First, I'd recommend checking what version your editor is, via Help > About.
  1. Open the Plugin Manager (Tools > Plugin Manager) and select Cae_CustomEscCodes.

  2. Select its Process Escape Codes parameter.

  3. If your editor is v1.5+ then you should see a list (if not, skip to step 4). Select an empty row in the list, then you should see some values:

    • Code - this is what is used in a message. If you enter ssOffA here, then you'd use the code in a message as \ssOffA.

    • Arguments - this can be left blank, since the provided script doesn't need additional input to decide what to do.

    • Delimiters - this will be ignored if Arguments is blank.

    • Replacer - this is what will happen when the message reaches this code. It will remove the code and replace it by running the given script. So here we want that script:
      JavaScript:
      var mapId = $gameMap.mapId();
      var evtId = $gameMap._interpreter.eventId();
      $gameSelfSwitches.setValue([mapId, evtId, 'A'], false);

  4. If your editor is older than v1.5 then you'll see a text-box. In that case, try pasting this in there:
    Spoiler: Click to see parameter text
    Code:
    ["{\"Code\":\"ssOffA\",\"Arguments\":\"\",\"Delimiters\":\"[]\",\"Replacer\":\"\\\"var mapId = $gameMap.mapId();\\\\nvar evtId = $gameMap._interpreter.eventId();\\\\n$gameSelfSwitches.setValue([mapId, evtId, 'A'], false);\\\"\"}"]
    This is just the result of me entering the value with a newer version of the editor and copying it as text.
Once you've done that, exit out of the Plugin Manager by "OK"-ing out of all those windows. Remember to save your project to apply plugin changes!

Finally, you can add the new text code to your messages, e.g.
Code:
◆Control Self Switch:A = ON
◆Text:Actor1(1), Window, Bottom
:    :Hey there, welcome to the exclusive potato-
:    :collector's lounge!\ssOffA
I did a quick test and it seemed to work as intended~ 😂
In this post, I'll use "select" to mean double-click (or right-click > Edit).

First, I'd recommend checking what version your editor is, via Help > About.
  1. Open the Plugin Manager (Tools > Plugin Manager) and select Cae_CustomEscCodes.

  2. Select its Process Escape Codes parameter.

  3. If your editor is v1.5+ then you should see a list (if not, skip to step 4). Select an empty row in the list, then you should see some values:
    • Code - this is what is used in a message. If you enter ssOffA here, then you'd use the code in a message as \ssOffA.

    • Arguments - this can be left blank, since the provided script doesn't need additional input to decide what to do.

    • Delimiters - this will be ignored if Arguments is blank.

    • Replacer - this is what will happen when the message reaches this code. It will remove the code and replace it by running the given script. So here we want that script:
      JavaScript:
      var mapId = $gameMap.mapId();
      var evtId = $gameMap._interpreter.eventId();
      $gameSelfSwitches.setValue([mapId, evtId, 'A'], false);

  4. If your editor is older than v1.5 then you'll see a text-box. In that case, try pasting this in there:
    Spoiler: Click to see parameter text
    Code:
    ["{\"Code\":\"ssOffA\",\"Arguments\":\"\",\"Delimiters\":\"[]\",\"Replacer\":\"\\\"var mapId = $gameMap.mapId();\\\\nvar evtId = $gameMap._interpreter.eventId();\\\\n$gameSelfSwitches.setValue([mapId, evtId, 'A'], false);\\\"\"}"]
    This is just the result of me entering the value with a newer version of the editor and copying it as text.
Once you've done that, exit out of the Plugin Manager by "OK"-ing out of all those windows. Remember to save your project to apply plugin changes!

Finally, you can add the new text code to your messages, e.g.
Code:
◆Control Self Switch:A = ON
◆Text:Actor1(1), Window, Bottom
:    :Hey there, welcome to the exclusive potato-
:    :collector's lounge!\ssOffA
I did a quick test and it seemed to work as intended~ 😂
Wow. This works perfect. Always surprises me when random people put so much effort into helping others online. Once I figure out how to make my own dialogue sound effects my cutscenes will be on point. You're awesome.
t
t
In this post, I'll use "select" to mean double-click (or right-click > Edit).

First, I'd recommend checking what version your editor is, via Help > About.
  1. Open the Plugin Manager (Tools > Plugin Manager) and select Cae_CustomEscCodes.

  2. Select its Process Escape Codes parameter.

  3. If your editor is v1.5+ then you should see a list (if not, skip to step 4). Select an empty row in the list, then you should see some values:
    • Code - this is what is used in a message. If you enter ssOffA here, then you'd use the code in a message as \ssOffA.

    • Arguments - this can be left blank, since the provided script doesn't need additional input to decide what to do.

    • Delimiters - this will be ignored if Arguments is blank.

    • Replacer - this is what will happen when the message reaches this code. It will remove the code and replace it by running the given script. So here we want that script:
      JavaScript:
      var mapId = $gameMap.mapId();
      var evtId = $gameMap._interpreter.eventId();
      $gameSelfSwitches.setValue([mapId, evtId, 'A'], false);

  4. If your editor is older than v1.5 then you'll see a text-box. In that case, try pasting this in there:
    Spoiler: Click to see parameter text
    Code:
    ["{\"Code\":\"ssOffA\",\"Arguments\":\"\",\"Delimiters\":\"[]\",\"Replacer\":\"\\\"var mapId = $gameMap.mapId();\\\\nvar evtId = $gameMap._interpreter.eventId();\\\\n$gameSelfSwitches.setValue([mapId, evtId, 'A'], false);\\\"\"}"]
    This is just the result of me entering the value with a newer version of the editor and copying it as text.
Once you've done that, exit out of the Plugin Manager by "OK"-ing out of all those windows. Remember to save your project to apply plugin changes!

Finally, you can add the new text code to your messages, e.g.
Code:
◆Control Self Switch:A = ON
◆Text:Actor1(1), Window, Bottom
:    :Hey there, welcome to the exclusive potato-
:    :collector's lounge!\ssOffA
I did a quick test and it seemed to work as intended~ 😂
Quick question, would this also work with normal switches? I'd like to use them as well.
Quick question, would this also work with normal switches? I'd like to use them as well.
👋 I'd suggest a separate code, since switches and self-switches are treated separately, but yes it is possible! Make a new "process" type code with:
  • Code - again, whatever string of letters you like, e.g. switch.
  • Arguments - lets have two this time: Integer and Text.
  • Delimiters - you can just leave this at the default value, [].
  • Replacer - try this:
    JavaScript:
    var switchId = parseInt(arguments[1], 10);
    var turnOn = String(arguments[2] || '').trim() === 'on';
    $gameSwitches.setValue(switchId, turnOn);
Example use in a message:
Code:
◆Text:None, Window, Bottom
:    :Hey!\switch[1,on]
:    :\|Who let you in here?\switch[5,off]
Notice that this time, because there are two arguments specified, the script can reference those to refine the effect: in this case, to decide which switch to target and whether to turn it on or off. 🙏

Wow. This works perfect. Always surprises me when random people put so much effort into helping others online. Once I figure out how to make my own dialogue sound effects my cutscenes will be on point. You're awesome.
There's an example for "play SE" in the plugin's help, but if you need further help with it then check out this thread~
If you want something more like letter "typing" sounds, though, then I'd suggest a different approach.
👋 I'd suggest a separate code, since switches and self-switches are treated separately, but yes it is possible! Make a new "process" type code with:
  • Code - again, whatever string of letters you like, e.g. switch.
  • Arguments - lets have two this time: Integer and Text.
  • Delimiters - you can just leave this at the default value, [].
  • Replacer - try this:
    JavaScript:
    var switchId = parseInt(arguments[1], 10);
    var turnOn = String(arguments[2] || '').trim() === 'on';
    $gameSwitches.setValue(switchId, turnOn);
Example use in a message:
Code:
◆Text:None, Window, Bottom
:    :Hey!\switch[1,on]
:    :\|Who let you in here?\switch[5,off]
Notice that this time, because there are two arguments specified, the script can reference those to refine the effect: in this case, to decide which switch to target and whether to turn it on or off. 🙏


There's an example for "play SE" in the plugin's help, but if you need further help with it then check out this thread~
If you want something more like letter "typing" sounds, though, then I'd suggest a different approach.
Thank you so much! Works like a charm. I'll check out that thread for sound effects as well. I was referring to typing/letter sounds but its nothing related to your plugin. I know how to utilize them, I'm just having trouble finding a program where I can make unique sounds for a bunch of characters. Hopefully I figure that out soon. Thanks again for the help!!!!!!

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-plugin-that-allows-you-to-turn-on-self-switch-events-in-a-show-text-event.128552/