Issues with Yanfly's row formation's position

Discussion in 'Javascript/Plugin Support' started by Alphaistimz, Jun 12, 2019.

  1. Alphaistimz

    Alphaistimz AlphaDio Production Veteran

    Messages:
    69
    Likes Received:
    4
    Location:
    Indonesia
    First Language:
    Indonesian
    Primarily Uses:
    RMMV
    Hi, guys.
    Currently I'm working on a game with Yanfly's row formation, but I just can't get the right 'home' position for the rows like she has in the showcase video, where it's more symmetrical. My game has 2 rows and the 'Y' isn't so natural since the first battler in the row "stuck" on top. my screen resolution in Yanfly core is 1280 x 720 and yes, my game is 8 vs 8, so without being centered, it looks mouthful... Giving the right code for 3 rows also helps for future games! Changing my X also helps if it makes it visually better. Thanks in advance :)
     

    Attached Files:

    • AA.PNG
      AA.PNG
      File size:
      110.4 KB
      Views:
      10
    • BB.PNG
      BB.PNG
      File size:
      15.6 KB
      Views:
      10
    • DD.PNG
      DD.PNG
      File size:
      1.9 MB
      Views:
      10
    #1
  2. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,035
    Likes Received:
    642
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    I would suggest using screenWidth rather than screenX...screenWidth / 2 will be the middle of the screen, making it easy to keep things symmetrical. :kaojoy:

    E.g. X position formula for actors:
    Code:
    screenWidth / 2 + rowId * 180 + rowIndex * 0
    ...and for enemies:
    Code:
    screenWidth / 2 - rowId * 180 - rowIndex * 0
    Just adjust the numbers as needed~
    • "rowId * 180" means there's 180 px of spacing between rows;
    • "rowIndex * 0" means there's 0 px of difference in x-position between successive members of a row.
     
    #2
  3. Alphaistimz

    Alphaistimz AlphaDio Production Veteran

    Messages:
    69
    Likes Received:
    4
    Location:
    Indonesia
    First Language:
    Indonesian
    Primarily Uses:
    RMMV
    Yup... It works well :kaoblush:Thanks! (I need some times to configure it out)
    It looks beautiful and organized :kaothx: love itt!
     
    #3
  4. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,035
    Likes Received:
    642
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    Happy to help! :kaopride:
     
    #4
  5. Alphaistimz

    Alphaistimz AlphaDio Production Veteran

    Messages:
    69
    Likes Received:
    4
    Location:
    Indonesia
    First Language:
    Indonesian
    Primarily Uses:
    RMMV
    Do you have a suggestion for Y too? I'm using this code:
    Code:
    centerY + ((rowSize / -2 + 2) + rowIndex) * 60
    it works well for the actors, but for the enemies, it changes depending on how many enemies are present... and only stays at the desired place if they have full 8 battlers...
     
    #5
  6. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,035
    Likes Received:
    642
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    You could try swapping rowSize (number of battlers in that row) for a fixed number. Could try swapping centerY for a fixed number, too. E.g.
    Code:
    350 + rowIndex * 60
    Not sure about the numbers, but you can experiment there. :kaoswt:
     
    #6
  7. Alphaistimz

    Alphaistimz AlphaDio Production Veteran

    Messages:
    69
    Likes Received:
    4
    Location:
    Indonesia
    First Language:
    Indonesian
    Primarily Uses:
    RMMV
    Yeah, it does work, but I want it to be symmetrical as well... any idea on how to do that?
    I think it has something to do with centerY
    Actually, I just realize that I need the Y fixed more than X...
     
    Last edited: Jun 13, 2019
    #7
  8. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,035
    Likes Received:
    642
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    centerY is just a number representing the y-position of the middle of the screen. Maybe try something like this?
    Code:
    480 + (((rowSize - 1) / 2) - rowIndex) * 80
    Quick check~
    • rowSize = 1 => rowIndex = 0 at y = 480.
    • rowSize = 2 => rowIndex = 0 at y = 520; rowIndex = 1 at y = 440.
    • rowSize = 3 => rowIndex = 0 at y = 560; rowIndex = 1 at y = 480; rowIndex = 2 at y = 400.
    That's the sort of thing you wanted, right? :kaophew:
     
    #8
  9. Alphaistimz

    Alphaistimz AlphaDio Production Veteran

    Messages:
    69
    Likes Received:
    4
    Location:
    Indonesia
    First Language:
    Indonesian
    Primarily Uses:
    RMMV
    Code:
    400 + (((rowSize - 1) / 2) - rowIndex) * 60
    is the perfect one! Thanks!
     
    #9
    caethyril likes this.
  10. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,035
    Likes Received:
    642
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    Great, happy RPG Making! :kaothx:
     
    #10

Share This Page