[HELP] Join List missing parameter SEPARATOR

Discussion in 'VNMaker Support' started by Tomcat, Mar 2, 2018.

  1. Tomcat

    Tomcat Villager Member

    Messages:
    10
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    VNM
    Join List missing Separator Parameter.

    After looking the online manual for JOIN LIST command

    I notice that the Separator parameter is missing from the Join List command. In the Text to List command appears correctly.

    [​IMG]

    What I'm trying to do is create a List, lets say with 3 items. Work with that list and in some point convert that list to a String separate with spaces, commas, dash or tabs. e.g:

    1. Item1
    2. Item2
    3. Item3

    List to String = Item1, Item2, Item3 or Item1 - Item2 - Item3 (you got the idea).

    I try to edit in the extension manager the Scene Command -> List -> Join List entry but couldn't make it work. My knowledge in this is zero.

    Thanks.

    System Info.
    MacBook Pro 15’, Intel Core i7, 16Gb RAM, Graphics AMD Radeon R9 M370X 2 GB Intel Iris Pro 1536 MB.
    OS MacOs High Sierra V10.13.3
    VN Maker V 1.0.1045
     
    #1
  2. Kentou

    Kentou Admin Staff Member Veteran

    Messages:
    97
    Likes Received:
    31
    Hi, thanks for reporting this. We will look into that and fix that behavior with a future update.

    Not sure how much your coding knowledge is but in Component_CommandInterpreter there is a function:

    Code:
        ###*
        * @method commandListJoin
        * @protected
        ###
        commandListJoin: ->
            list = @interpreter.listObjectOf(@params.listVariable)
            value = if @params.order == 0 then list.join("") else list.reverse().join("")
         
            @interpreter.setStringValueTo(@params.targetVariable, value)
    
    As you can see, the separator is "" by default, means nothing. If you edit he Join List command and add a separator field there, you just have to edit this command to read and use the separator. Put @params.separator instead of "" for example. Assuming "separator" is the correct field which would be the case if you copy the field from "Text to List" command.

    NOTE: Keep in mind that if you edit scripts directly, the migration might override your changes with a future update. So it is recommended to create a copy of the scripts and only re-implement the methods you want to change so that other functionality can be still updated. Which could look like this:

    Code:
    class Component_CustomCommandInterpreter extends gs.Component_CommandInterpreter
        
        ###*
        * @method commandListJoin
        * @protected
        ### 
        commandListJoin: ->
            list = @interpreter.listObjectOf(@params.listVariable)
            value = if @params.order == 0 then list.join("") else list.reverse().join("")
          
            @interpreter.setStringValueTo(@params.targetVariable, value)
    
    gs.Component_CommandInterpreter = gs.Component_CustomCommandInterpreter
    
    If you put that in an own script and make sure that script is BELOW the default script your are safe in case of migration.
     
    #2
  3. Tomcat

    Tomcat Villager Member

    Messages:
    10
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    VNM
    HI Kentou,

    Thanks a lot for your answer. It partially solved what I was looking for. I can sort the list now with "," at least. I'll keep looking to see if I can make it work with other characters.

    The new update change the UI, and is given me some troubles. I don't know why they change it. Actually in the previous version was more useful as now the only icons available are for Resource manager, Music player, Play and Help. The rest are only available through the view menu. Even after editing a script the only way to go back to Scene is through the view menu.
     
    #3
  4. Kentou

    Kentou Admin Staff Member Veteran

    Messages:
    97
    Likes Received:
    31
    Hi, do you use Mac OS X? The toolbar issue is not a UI change but a UI bug we get on OS X now with latest version for unknown reason. We are working on a fix for that.
     
    #4
  5. Kentou

    Kentou Admin Staff Member Veteran

    Messages:
    97
    Likes Received:
    31
    Ok the issue with the toolbar has been fixed. It should be back to normal now.
     
    #5
  6. Tomcat

    Tomcat Villager Member

    Messages:
    10
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    VNM
    Hi Kentou,

    The issue with the toolbar is fixed with the v1.0.1071 update, now is working as usual. Thanks, nice to see how fast these problems are fixed.
     
    #6

Share This Page