DE EN FR ES IT CZ
Back Back to top

Camera scrolling has suddenly changed in my game after 5.0.8 update

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  • #1, by el_gee 8 years ago Quote
    Hey guys,

    The camera movements of my game have now suddenly changed?
    It seems this has occurred due to some of the updates in 5.0.8. 

    It used to be constantly fixed on the current character, but now it kind of oddly goes in one direction before eventually catching up and centering on the character - until the character is moved again.

    First noticed this earlier today when I had to update windows platform before being able to make the build, where the eventual build had the 'new' camera settings.

    Thought it was because I had the 5.0.7 version, so I updated to 5.0.8, and now all versions and test runs are acting like this. 

    Game starts by executing this script:

    game.HorizontalScrollDistance = (game.WindowResolution.x / 2)
    game.VerticalScrollDistance = (game.WindowResolution.y / 2)

    anyone have any ideas what's happening or how to fix this? 


  • New to Visionaire Studio?

    Create point and click adventures without coding. Try the free version or get a license for your release.

    See licenses Try it for free
  • #2, by SimonS 8 years ago Quote
    game.HorizontalScrollDistance = (game.WindowResolution.x / 2)
    game.VerticalScrollDistance = (game.WindowResolution.y / 2)

    What is that supposed to do ? Try it without or reduce the border.

    The scrolling was changed because it tended to scroll back and forth ever repeating in some circumstances.

    You're probably better off scripting it via lua.
  • #3, by el_gee 8 years ago Quote
    "game.HorizontalScrollDistance = (game.WindowResolution.x / 2)
    game.VerticalScrollDistance = (game.WindowResolution.y / 2)"

    was a script I found on the forum to center the camera on the active character, which has worked fine until now.

    I've tried setting it up as a definition script as well, but nothing changes.


  • #4, by el_gee 8 years ago Quote
    If anyone has anyone ideas on how to fix this I'd be really grateful. 
    My efforts aren't seeming to affect the new scroll issues.

    LINK   (current scrolling)

    The game was pretty much finished up to this point, and even has a release date with a magazine in two weeks here in Denmark. 
    Just a bit of a stressful surprise.

  • #5, by SimonS 8 years ago Quote
    2 options: 

    1) reduce the border (experiment a little with the - 100): 

    game.HorizontalScrollDistance = (game.WindowResolution.x / 2) - 100
    game.VerticalScrollDistance = (game.WindowResolution.y / 2) - 100

    2) a main loop handler:

    function scroll()
    local x,y = graphics.getScrollPosition()
    local gr = game.WindowResolution
    local t = game.CurrentCharacter.Position
    t.x = t.x - gr.x / 2
    t.y = t.y - gr.y / 2
    local r = game.CurrentScene.Sprite:getSize()
    t.x = math.max(0, math.min(t.x, r.x - gr.x))
    t.y = math.max(0, math.min(t.y, r.y - gr.y))
    x = x * 0.9 + t.x * 0.1
    y = y * 0.9 + t.y * 0.1
    graphics.setScrollPosition(x,y)
    end
    registerEventHandler("mainLoop","scroll")
  • #6, by el_gee 8 years ago Quote
    Thanks for the input SimonS, greatly appreciated.
    I'll try it out later. 
  • #7, by afrlme 8 years ago Quote
    If anyone has anyone ideas on how to fix this I'd be really grateful. 
    My efforts aren't seeming to affect the new scroll issues.

    LINK   (current scrolling)

    The game was pretty much finished up to this point, and even has a release date with a magazine in two weeks here in Denmark. 
    Just a bit of a stressful surprise.

    Got to be honest, the camera following the character around like it's on an elastic  band feels kind of nausea inducing with all of the motion.

  • #8, by el_gee 8 years ago Quote
    It works!

    The sprites didn't used to be cropped down to a minimum, which used to work. 
    But now after cropping them + your script, it seems to be working fine.

    So relieved.

    There's a bit of funny business with some of my ''scroll scene to'' actions, but I expect I can fix that myself.

    Thank you so much for the support SimonS!!!!



  • #9, by afrlme 8 years ago Quote
    strange, cropping them shouldn't have mattered as the position is based on the animation center you specify for each individual character animation.