Show animation through variable requires a number

Discussion in 'VNMaker Support' started by FoxySeta, Aug 8, 2018.

Thread Status:
Not open for further replies.
  1. FoxySeta

    FoxySeta Cleric, script kiddie and fudanshi Veteran

    Messages:
    227
    Likes Received:
    88
    Location:
    Lugo, RA, IT
    First Language:
    Italian
    Primarily Uses:
    RMMV
    I know I've had difficulties with this stuff some days ago as well, but I still can't figure out something. Why does the animation selector requires a number when using a variable? Looking at the code, one would expect that UIDs are used instead.
    Thanks again!
     
    Last edited: Aug 8, 2018
    #1
  2. Kentou

    Kentou Admin Staff Member Veteran

    Messages:
    98
    Likes Received:
    31
    Hi FoxySeta,

    good point, I think that is a bug. I think Show Animation command has not been used often which is why it probably has not been figured out until now. I put it on the bug list and it will be fixed with the next update. You can fix it yourself or now if you go to the Extension View > Scene Commands > Picture > Show Animation and then the { ....... } entry after "OBJECT_NUMBER" there is a field "variableButton" and the data source is set to "numbers". Just change it to "strings".
     
    #2
  3. FoxySeta

    FoxySeta Cleric, script kiddie and fudanshi Veteran

    Messages:
    227
    Likes Received:
    88
    Location:
    Lugo, RA, IT
    First Language:
    Italian
    Primarily Uses:
    RMMV
    Thanks! I remember giving a look at the scene command creation guide so I should be able to do it. Can I safely edit the original instead than creating a new one since it's going to be fixed in the next update?

    EDIT: could it be that you also need to forcely preload your animations shown through variable just like if they were characters?
    Also, to make it work I had to change at Component_CommandInterpreter this line
    Code:
    record = RecordManager.animations[@params.animationId]
    in this one
    Code:
    record = RecordManager.animations[@interpreter.stringValueOf(@params.animationId)]
    Also, I had to do something similar with Pan Screen as well. Would you mind checking them all soon or later?
     
    Last edited: Aug 8, 2018
    #3
  4. Kentou

    Kentou Admin Staff Member Veteran

    Messages:
    98
    Likes Received:
    31
    Hi FoxySeta, sorry I didn't check the command implementation in the interpreter, I just assumed it is already using stringValueOf so I think your change should be fine there.

    Yes!

    Yes, not sure if I mentioned that only Show Picture supports the calculation of the filename by variable without preloading. However, you could add the same experimental logic to Show Animation yourself.

    Just look for PlayPictureAnimation in Component_CommandInterpreter. There look for the line where the picture is create using @interpreter.createPicture and add the following under it: (Take care of the correct indentation of the code):
    Code:
    if !picture
        @interpreter.pointer--
        @interpreter.isWaiting = yes
        @interpreter.waitCounter = 1
        return
    
    That will check if the graphic is already loaded, if not it will pause the interpreter. I haven't tested it but it is the same code used in Show Picture tho. However, keep in mind that depending on the amount and size of graphic()s the entire game might get stuck for a short moment especially if it is a web game because then the graphic needs to be loaded from the server first.

    What is the issue with Pan Screen?
     
    #4
  5. FoxySeta

    FoxySeta Cleric, script kiddie and fudanshi Veteran

    Messages:
    227
    Likes Received:
    88
    Location:
    Lugo, RA, IT
    First Language:
    Italian
    Primarily Uses:
    RMMV
    It's about something like a missing
    Code:
    @interpreter.numberValueOf()
    if I remember correctly. Not sure if it was pan screen or scroll background though.
     
    #5
  6. Kes

    Kes Global Moderators Global Mod

    Messages:
    17,475
    Likes Received:
    9,106
    First Language:
    English
    Primarily Uses:
    RMVXA

    This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

     
    #6
Thread Status:
Not open for further replies.

Share This Page