VN Default Input Text- 'Clear All' and 'Append'

Discussion in 'Visual Novel Maker Support' started by Vaena, Aug 13, 2019.

  1. Vaena

    Vaena Veteran Veteran

    Messages:
    46
    Likes Received:
    105
    First Language:
    English
    Primarily Uses:
    Other
    Evening! I am hoping someone here can aid in my understanding of this section of default code:

    TLDR: Is there any easy way to remove only the last input command from text input?

    Label: process_letter
    Condition: if number L:0004 Letter Counter is Lesser than L:0002 Number of Letters
    >Variable: L:0004 Letter Counter Add Value 1
    >Condition: if switch L:0001 ABC Selected is equal to ON
    >>Number Variable: L:0001 Letter Sub Value 1
    >>Get from List: L:0001: Letters index L:0001 Letter Value Text Store in L:0002 Letter
    >>Text Variable: Text L:0003: Text Append Variable L:0002: Letter
    {LT:2}
    >Else: Number Variable: L:0001 Letter Sub Value 1
    >>Get from List: L:0002 Symbols index L:0001 Letter Text store in L:0002 Letter
    >>Text Variable: text L:0003 Text Operation Append Variable L:0002 Letter
    [object Object]

    >>Refresh Text: 300
    Idle

    I can't really find much information on the 'append' command. I follow that it is adding a text key to the end of a phrase here, and possibly 'append' always adds to the end. (I see no place where it specifies unless I am misinterpreting a line somewhere.) I also am not sure what this line is doing at all:
    >>Text Variable: text L:0003 Text Operation Append Variable L:0002 Letter
    [object Object]

    As I do not know json, at least not yet.

    My reason for asking is I noticed there is no delete hot key in the default input. It has 'clear all', but all that does is set the text back to nothing. In theory I could let them delete a key by somehow assigning each letter to a switch or common event, but yikes. So my main question: Is there any easy way to remove only the last input command from text input?



    Side note- I typed it out as above because to me it is much easier to read. If someone would prefer actual screenshots I certainly can do so.
     
    #1
  2. Kentou

    Kentou Admin Veteran

    Messages:
    173
    Likes Received:
    43
    Hi, yes it can be done easily but I am not sure if that works in STABLE as well. I only tested it in BETA. Just add the following into the Input Text Common Event and connect the delete-label to a new hotspot which should be the "Delete" button on your image map. It will remove the last letter from the text. You have to create a new local list variable "Current Letters". The "Store in" variable from Pop from List command should be something unused like an unused variable because its not needed anyway.

    (Also, there is Copy as Text right-click menu action which allows you to copy selected commands as simple text)

    TextInputDelete.PNG
     
    #2
    Vaena likes this.
  3. Vaena

    Vaena Veteran Veteran

    Messages:
    46
    Likes Received:
    105
    First Language:
    English
    Primarily Uses:
    Other
    Oh, I believe I follow- you are basically tossing the letter into the trash, haha. That's great, and I don't see any way it wouldn't work. Thank you, @Kentou!

    Another idea this gives me is to put the characters into a list before assigning them to text somehow, but that feels more intensive/tricky (should work, though, with 'remove from list' (last item index). It would do kinda the same thing, toss the letter out into the void. Just an idea I could try if this trick doesn't work in the end game.

    Ah, yes, I have discovered this accidentally but as I cannot read code really I mostly ignored it. (Pasted into Show Message or Comment a few times, lol). I have actually been considering using that to learn some scripting but that can come later.

    Thanks again for the help. ^_^
     
    Last edited: Aug 13, 2019
    #3

Share This Page