Animated Background and displaying variables

Discussion in 'Visual Novel Maker Support' started by mardin, Nov 22, 2017.

  1. mardin

    mardin "...pretty please?" Veteran

    Messages:
    199
    Likes Received:
    114
    Location:
    Germany
    First Language:
    German
    Hi there,

    I want to use a sprite background (4 pictures looped), how do I pull this off? Does VNMaker support .apng?

    Also I want to display some variables, like the current day and money. How can I do that?

    Thanks for your help
     
    #1
  2. Kentou

    Kentou Admin Veteran

    Messages:
    154
    Likes Received:
    37
    You can just use 4 pictures looped, I think you want to do parallax? Check out this:

    https://asset.visualnovelmaker.com/help/index.htm#t=Parallax_Scrolling.htm

    Does that help you out? (There is no support for APNG format in VN Maker.)

    There are different ways. With the built-in commands, you can use Get Game Data command to access the current day and store it into a variable. Then you can use the Text Codes to show it up in a Message or Text. There is no Money in VN Maker by default, but you can just use a number variable for money and display it in a Message or Text. Check out Variables in Beginner's Guide.
     
    #2
  3. mardin

    mardin "...pretty please?" Veteran

    Messages:
    199
    Likes Received:
    114
    Location:
    Germany
    First Language:
    German
    I don't want to do parallax, I want 4 (or more) different background pictures, playing one after the other, just like a gif or an apng file would do on its own. I know about the animation tab, but that uses sprites, and for background pictures these files would be extremely large.

    Yes, the solution for the variables is exactly what I'm looking for! But I can't seem to get it done. Can you give me a step by step example, please? "Show Text" does nothing for me, where do I put the command ({GN:index}) ?

    Thanks for helping out
     
    #3
  4. mardin

    mardin "...pretty please?" Veteran

    Messages:
    199
    Likes Received:
    114
    Location:
    Germany
    First Language:
    German
    bump
     
    #4
  5. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,451
    Likes Received:
    14,003
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    Why not just make it a video file, use show movie and play it on the background?
     
    #5
  6. Kentou

    Kentou Admin Veteran

    Messages:
    154
    Likes Received:
    37
    Should the animation loop? If yes, then its easy, I don't know in which context you want to have that kind of animation. But you can just use Show Picture or Change Background multiple times with different images and use Wait command for the timing. If you want it loop, you can do that with a parallel common event easily, where you say:

    Code:
    Loop
      Change Background
      Wait 500ms
      Change Background
      Wait 500ms
      Change Background
      Wait 500ms
      Change Background
      Wait 500ms
    
    And thats it, done is the animation. You even have full control about it.

    For money, you can just use Number Variable command like:

    Number Variable G[0001: Money] Set To Value 1000

    Now you have 1000 gold or whatever currency in variable Money. You can now print it out in Show Text or Message as:

    "I have {GN:1} money right now!"

    with version 1037+ (currently available in beta branch) you can do:

    "I have {GN:Money} right now!"

    too.To increase money, use:

    Number Variable G[0001: Money] Add Value 100

    to add 100 to the current amount. To get the current day, use:

    Get Game Data: Field: Date - Day of Month Store in: G[0002:Current Day]

    then in a message you can do:

    "To is the {GN:2}. day of the month."

    or with version 1037+:

    "Today is the {GN:Current Day}. day of the month."

    for example. Let me know if that helps you out.
     
    #6
  7. mardin

    mardin "...pretty please?" Veteran

    Messages:
    199
    Likes Received:
    114
    Location:
    Germany
    First Language:
    German
    Yes! That Loop is exactly what I was looking for, thank you so much!

    Now, for the variables, I was just stupid there! I wanted the player to be able to see the day, money and energy every time. Turns out you can easily do that with SHOW TEXT, you just have to double click on it to unfold and enter the text (unlike the message box), so it was completely my fault.

    Thanks for helping out!
     
    #7
  8. mardin

    mardin "...pretty please?" Veteran

    Messages:
    199
    Likes Received:
    114
    Location:
    Germany
    First Language:
    German
    Is there a way to have that Loop in the background?

    So that it would loop the pictures, but I would be able to display messages and text to narrate a story?
     
    #8
  9. mardin

    mardin "...pretty please?" Veteran

    Messages:
    199
    Likes Received:
    114
    Location:
    Germany
    First Language:
    German
    hello?
     
    #9
  10. Kentou

    Kentou Admin Veteran

    Messages:
    154
    Likes Received:
    37
    Hi mardin,

    my apologies for the late reply.

    Yes you can do that if you make the common event parallel, then it will not block the scene flow and animates in the background. Let me know if that helps you out.
     
    #10
  11. mardin

    mardin "...pretty please?" Veteran

    Messages:
    199
    Likes Received:
    114
    Location:
    Germany
    First Language:
    German
    I don't really understand what that has to do with a common event. Maybe I should explain what I want in detail:

    When you use a video, it is no problem to make it run in the background while displaying messages, text pictures and so on.

    Instead of a video I want to use many repeatable pictures

    Loop
    Change Background Lightning bolt
    Wait 500ms
    Change Background Rain
    Wait 500ms
    Change Background Rain 2
    Wait 500ms
    Change Background Rain 3
    Wait 500ms

    Display Text " The weather is awful "

    Display Text " You should try to find some shelter fast"

    break loop

    Change Background Shelter


    Something like that. Whenever I try that, the loop plays forever and the scene does not progress. I feel like I am missing something obvious, because that surely is easily possible.

    Thanks for your help
     
    #11
  12. Kentou

    Kentou Admin Veteran

    Messages:
    154
    Likes Received:
    37
    Because a common event has a Runs Parallel checkbox. If you put that loop into a common event with Runs parallel checked and Trigger set to Call. Then you can use Call Common Event command to start the animation.

    Then it should do exactly what you want. Then if you want to stop that animation, use End Common Event command to after your messages. Let me know if that helps you out.
     
    #12
  13. mardin

    mardin "...pretty please?" Veteran

    Messages:
    199
    Likes Received:
    114
    Location:
    Germany
    First Language:
    German
    Ok, I see. But this would mean that I have to do a common event for every single time I want to do a looping animation. And I pretty much want to do a looping animation almost every single time the background changes. If the performance doesn't get affected by a huge amount of Common Events (and I mean in the final game there would be 500 or more) then I am pleased with that solution.

    Thanks for helping!
     
    #13
  14. Kentou

    Kentou Admin Veteran

    Messages:
    154
    Likes Received:
    37
    Hi, also not sure if you noticed but you can also setup animations in Database > Animations.

    I would say 500 common events shouldn't affect the game depending on how you set them up. But I also have to say that the largest amount of common events I have ever seen in a finished and published VNM game was ~100. As long as you uncheck Auto-Preload and set them to "Call" they actually only really affect the game at the moment where you call them.

    But maybe you can handle it with only one common event using common event parameters and Show Picture. You can setup parameters for multiple graphic files and then pass those to Show Picture.

    If that is not an option, you can create a new common event every time but you should uncheck Auto-Preload especially if each one uses a different animation graphic set.

    Also checkout: https://asset.visualnovelmaker.com/help/index.htm#t=Common_Events_Guide.htm

    For common events. (If you read about parameters there, the example shown there telsl you to setup a Number parameter for character selection but that is now under Text parameter)
     
    #14

Share This Page