Moving the screen in Battle

Discussion in 'Learning Javascript' started by LackeDragon, Feb 22, 2018.

  1. LackeDragon

    LackeDragon Veteran Veteran

    Messages:
    30
    Likes Received:
    2
    First Language:
    French
    Primarily Uses:
    RMMV
    Hello!

    I was playing around with the zoom function included in RPG Maker MV.
    I got no problem with it on maps, but it's another question in battle.

    I found out that you can zoom in battle by either using :
    $gameScreen.startZoom( ) or $gameScreen.StartBattleZoom( )

    My problem is, I didn't find something like that in battle.
    However, on maps with $gameScreen.startZoom( ) I can move the zoom for a X and Y position.
    $gameScreen.StartBattleZoom( ) sure do a proper zoom in battle but there is no way to indicate a position to zoom to it.
    Am I missing something?

    Thanks!
     
    #1
  2. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,315
    Likes Received:
    818
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    Maybe it's just me, but I can't find a StartBattleZoom function?

    I just quickly experimented with a troop event in a new v1.5.1 project. Condition: Turn 0 and Scope: Battle, with a single script command:
    Code:
    $gameScreen.startZoom(204, 156, 2.0, 30);
    This caused the screen to zoom in x2 to the top-left of the screen as soon as the emerge message closed. Does it work for you? =)
     
    #2
  3. LackeDragon

    LackeDragon Veteran Veteran

    Messages:
    30
    Likes Received:
    2
    First Language:
    French
    Primarily Uses:
    RMMV
    But that's exactly what I tried before..
    Wait a second...

    ...

    Oh! All seem clear now!
    The $gameScreen.StartBattleZoom( ) was actually a plugin function.
    The same plugin was denying the $gameScreen.startZoom(); to do his intended work!
    Didn't thought it would deny that!

    Thanks for that!
    Gonna put that quoted plugin aside now I can do without it. (Yanfly Battle Core + Action Sequence)
     
    #3
  4. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,315
    Likes Received:
    818
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    Ah, so Action Sequence Pack 3 is the culprit! Good to know. =)

    Happy RPG Making! ^_^
     
    #4
  5. LackeDragon

    LackeDragon Veteran Veteran

    Messages:
    30
    Likes Received:
    2
    First Language:
    French
    Primarily Uses:
    RMMV
    I continue the topic because I still have a problem.
    $gameScreen.startZoom works perfectly fine to do a zoom in a specific position.
    However, it seems unable to do a pan when putting two of them one after the other.
    So, is there a similar command to pan the camera, like, I don't know ""$gameScreen.startPan" haha

    Thanks in advance!
     
    #5
  6. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,315
    Likes Received:
    818
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    It looks like there's no function available in the base code to achieve this directly. The zoom coordinates are immediately set to the new ones, which is why it jumps. However, this sort of thing worked fairly well for me in a troop event:
    Code:
    ◆Loop
      ◆If:Script:$gameScreen._zoomX > 200
        ◆Script:$gameScreen._zoomX -= 4;
        ◆Wait:1 frame
        ◆
      :Else
        ◆Break Loop
        ◆
      :End
      ◆
    :Repeat Above
    [Edit: you could probably figure it out yourself, but the zoom coordinates are $gameScreen._zoomX and $gameScreen._zoomY.]

    Alternatively you could go back to Yanfly's Sequence Pack 3...I've had another look at it and maybe something like this would work (I haven't tested it, though):
    Code:
    ◆Script:BattleManager._cameraX = x;
    :      :BattleManager._cameraY = y;
    :      :$gameScreen.setCameraDuration(frames);
    Just replace x, y, and frames with the values you want to use. ^_^
     
    Last edited: Mar 6, 2018
    #6
  7. LackeDragon

    LackeDragon Veteran Veteran

    Messages:
    30
    Likes Received:
    2
    First Language:
    French
    Primarily Uses:
    RMMV
    I will test that thanks!
    Unfortunately I can't get back ti Yanfly Action Sequence if it needs the battle core as it is not compatible with the others plugins I have.
     
    #7
  8. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,315
    Likes Received:
    818
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    OK, hope it works for you! =)
     
    #8

Share This Page