[Ace] Yanfly Ace Message System displaying message box incorrectly

Discussion in 'RGSSx Script Support' started by Ech0es, Apr 5, 2014.

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

    Ech0es Moon Veteran

    Messages:
    37
    Likes Received:
    0
    Location:
    Earth
    First Language:
    English
    Primarily Uses:
    N/A
    So I am using the Ace Message System by Yanfly Engine Ace, and the issue I am having can be seen below in the picture. I removed all scripts but this one to make sure.


    Whenever I show a normal message box, that displays fine. But whenever showing a message with a dim background, it appears to be off screen instead of spanning the entire screen like usual. There is no problem until I load a saved game. So it only happens after a game is loaded. Any ideas what is causing this? Any help would be greatly appreciated. Thanks.


    Before loading game:


    <image removed at OP's request>


    After loading saved game:


    <image removed at OP's request>
     
    Last edited by a moderator: Jun 26, 2014
    #1
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Please provide a link to the script so others can take a look at it without having to go searching.


    Are these save files of games started AFTER the script was added?


    It almost looks like the message window itself or the viewport have been moved. Do you have any other scripts that affect messages?
     
    Last edited by a moderator: Apr 5, 2014
    #2
  3. Ech0es

    Ech0es Moon Veteran

    Messages:
    37
    Likes Received:
    0
    Location:
    Earth
    First Language:
    English
    Primarily Uses:
    N/A
    The script here posted at pastebin:

    http://pastebin.com/XPNffTMs

    No, these are not save files after the script was added.I've had this script in my project for awhile but just now noticing this problem. I tested this a lot to make sure which script was causing the problem. I do have two other message scripts (Special Message Codes & Text Formatting by modern algebra). But I removed those two and tested, and the error still persisted. I eventually removed ALL scripts from my game but Yanfly's, and the problem still occured. So it's not any other script that is causing the problem.

    Like I stated above, all works perfectly fine until I load my game.

    I can probably narrow the problem down more for you... A feature in the script allows you to set a variable and adjust the width of the message box. I am setting a variable to 400 so the message box appears smaller. Once I remove the variable and test, save, and load, there is no problem
     
    Last edited by a moderator: Apr 6, 2014
    #3
  4. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Are you sure you're not using that variable for something else as well, or that it's not used anywhere else in your scripts? That's a sadly common problem.
     
    #4
  5. Ech0es

    Ech0es Moon Veteran

    Messages:
    37
    Likes Received:
    0
    Location:
    Earth
    First Language:
    English
    Primarily Uses:
    N/A
    Nope, not using that variable anywhere else. It is definitely a problem with the script because I even took the script and put it in an entirely new project just to test it and make sure it wasn't my game. If you have the time, test it for yourself: Take the script, put in new project, make an event with a message, one with a normal background, and a dim background, put variable 1 at top with a constant of 400. View the messages, save game, shut down game, load game and view messages again. The dim background should be displayed incorrectly like above in the photos.
     
    Last edited by a moderator: Apr 6, 2014
    #5
  6. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Okay ... it looks like it's doing exactly what you're telling it to do.


    That text box has not been moved, as the text itself is still in the same position. It's just been shortened - to 400 pixels. IF you have that variable set to 400 right at the beginning of your game, what I don't understand is why the problem doesn't happen until AFTER you load a saved game.


    I still suspect something funny is going on with either the variable being changed in several places, or your saves having different values for it. In fact, if you HADN'T set the variable at all, the script would make the message box go across the entire screen. So I believe wherever you have it set to change it to 400 is probably wrong - it's not getting done right at the start of the game, but only after you load the save file for some reason.


    Your screen is larger than the default - you're using a script call to change it from 544x416 to 640x480. Even if you didn't have that call, 400 is still not wide enough to cover the screen. 400 IS the width of the message box in the lower image, so that one is doing exactly what you're telling it to do by setting the variable to 400. If you want it to be the width of the screen, you either have to change that variable to 640, or to 0 (which makes it default to the full width).


    What happens to NORMAL messages (not a dim background) if you leave the variable at 0?
     
    #6
  7. Ech0es

    Ech0es Moon Veteran

    Messages:
    37
    Likes Received:
    0
    Location:
    Earth
    First Language:
    English
    Primarily Uses:
    N/A
    Yeah, the problem is definitey with the variable feature. I don't get why it only occurs after the game has been loaded either. It works perfectly fine until a game is loaded -- normal messages are shortened like they should be, and dim backgrounds exapnd the entire screen as they should. I have experimented by using all different numbers for the constant, but all return the same problem.

    I can opt out of using this feature entirely, then all would be fine I'm sure. But I would like to use it if I can. I tried searching this but no one else seems to have reported this problem. So I dunno if it is just happening on my end? But it also occurs in new projects, so who knows.

    What happens to normal messages if I leave the variable at 0? Nothing. The message box stays the same and expands the entire window length.
     
    #7
  8. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Is that what you WANT to happen?


    Where is your command to set the variable to 400?


    Why do you want to use this feature? How do you expect it to behave when you use it?
     
    #8
  9. Ech0es

    Ech0es Moon Veteran

    Messages:
    37
    Likes Received:
    0
    Location:
    Earth
    First Language:
    English
    Primarily Uses:
    N/A
    What I want to happen is for it to work like it should. Setting message width to 400 shouldn't affect the dim background at all, only the normal message box. Something is causing it to affect the dim box. What is? I dunno, hence the creation of this thread. I thought maybe the coding in the script was wrong or something missing. But I dunno too much about that.

    Why do I want to use this feature? Because I want to. It makes the messages look better, in my opinion.
     
    #9
  10. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    It IS working like it should. It seems what it SHOULD do and what you THINK it should do are two different things.

    The message box is the message box - there is only one, and it doesn't matter whether it has a dim, transparent or normal background. If you tell it to have a width of 400, that's what it's going to do. Nowhere in the script does it say the setting is only used for certain types of messages.

    What you REALLY want is for it to NOT behave the way it's designed, and to do something different depending on the background.

    What do you want to happen if the background is transparent? Should it also assume the message box width takes the full width of the screen and center the text accordingly? Same as what you want to happen with a dim background?

    If that's the case (you ONLY want it to look at the variable when using a normal background), find this method in the script:

    Code:
      def self.message_width    return Graphics.width if YEA::MESSAGE::VARIABLE_WIDTH <= 0    return Graphics.width if $game_variables[YEA::MESSAGE::VARIABLE_WIDTH] <= 0    return $game_variables[YEA::MESSAGE::VARIABLE_WIDTH]  end
    and add this line:
    Code:
      def self.message_width    return Graphics.width if $game_message.background != 0    return Graphics.width if YEA::MESSAGE::VARIABLE_WIDTH <= 0    return Graphics.width if $game_variables[YEA::MESSAGE::VARIABLE_WIDTH] <= 0    return $game_variables[YEA::MESSAGE::VARIABLE_WIDTH]  end
     
    #10
  11. Ech0es

    Ech0es Moon Veteran

    Messages:
    37
    Likes Received:
    0
    Location:
    Earth
    First Language:
    English
    Primarily Uses:
    N/A
    It's not working like it should, because if it was, then it wouldn't adjust the dim background. I don't think you fully understand --

    "The message box is the message box - there is only one, and it doesn't matter whether it has a dim, transparent or normal background. If you tell it to have a width of 400, that's what it's going to do."

    Yes, there is only one. This variable should only adjust the NORMAL message box. Because when it works before loading a game, the message box is shortened, but the dim box expands the entire screen. I'm sure it's not meant to work the way it does after a game is loaded. Why else does it work that way before the game is loaded (short normal, expanded dim)?

    This is what happens BEFORE the game is saved: (normal, then dim)

    [​IMG]

    [​IMG]

    What happens AFTER the game is saved then loaded:

    [​IMG]

    [​IMG]

    And this is how I have it set up:

    [​IMG]
    If you claim the variable is going to adjust the message box no matter what, then why doesn't it happen to begin with, yet only after it is saved? I'm fairly certain the way it is supposed to work is the first set of images I posted above. You can tell it shouldn't happen because the dim box is shortened and not even centered. I'd be ok with it being shortened if the dim message would appear centered, but it's not.

    I added in that line you provided me, and it didn't appear to do anything. Any way I can get it to work the way in the first set of images I posted, even AFTER a loaded game? If not, how can I adjust the dim message so it appears centered?

    I do appreciate your help thus far.
     
    Last edited by a moderator: Apr 6, 2014
    #11
  12. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    No, it shouldn't. Where in the script do you get the idea that the variable is only intended to affect the NORMAL message box? There is no such statement.


    And once again, WHERE is your statement that sets the variable to 400? As I said, I suspect something is happening with that - it's not being done in the right place.


    The point where you change that variable to 400 is somewhere between the last dim message showing correctly and the next one not showing correctly. I really don't think it's got anything to do with saving the game at all - unless there is a script or something else you do on saving/loading that changes that variable. You have said there isn't, but I'm afraid I can't put much faith in that (based on the number of times people have sworn they didn't have scripts that did certain things, and only when pushed actually looked properly and discovered that they actually did).
     
    #12
  13. Ech0es

    Ech0es Moon Veteran

    Messages:
    37
    Likes Received:
    0
    Location:
    Earth
    First Language:
    English
    Primarily Uses:
    N/A
    I don't know where that is at in the script, I didn't study it. I only go on that assumption because why doesn't it change the dim box originally? Why does it only change AFTER the game is loaded? Either way, it isn't working the way it should. It doesn't shorten the dim box, then it does after saved. So which is it supposed to be? How can it be made to do one or the other?

    How can you not put faith in what I've stated about the scripts? I stated many times that I have deleted ALL SCRIPTS from my project, except the Ace message. The problem still persisted. ThenĀ  created a brand new project, put that script in it, and tested. That same problem still occured. So no, it isn't any other script causing the problem, because there are no other custom scripts.

    Why don't you test this for yourself? Make a new project and test it out. Or if not, how can I have the dim box messaged shortened to 400 (and centered) like the normal message box?
     
    #13
  14. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    I've asked you several times now WHERE you set the variable to be 400.


    Maybe you can zip up your project and load it up somewhere so I can take a look ...
     
    #14
  15. Ech0es

    Ech0es Moon Veteran

    Messages:
    37
    Likes Received:
    0
    Location:
    Earth
    First Language:
    English
    Primarily Uses:
    N/A
    And I showed you an image where I have it set up... In the spoiler tags above. One of the last images there. I have it set in the events, before the text messages. I have also tested it between two maps as well, one map with the variable, then text messages, then transfer to another map with just the text messages. I would save on the 2nd map and load. Still no luck.

    I made a new project with the script. See if it occurs on your end. Just load the game up, talk to the person, save game, shut down, load, then talk to person again.

    https://www.mediafire.com/?8exes8alctsbqw3
     
    #15
  16. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    That just shows me the event. You didn't even include the whole event window. So that tells me nothing about when it gets run.
     
    #16
  17. Ech0es

    Ech0es Moon Veteran

    Messages:
    37
    Likes Received:
    0
    Location:
    Earth
    First Language:
    English
    Primarily Uses:
    N/A
    It's set to action button. Not an autorun or parallel process. You can see how I have it set up in the project I uploaded in my last post.
     
    #17
  18. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    yeah. Leave it with me for a bit. It IS detecting the size it SHOULD show. I suspect the resize just isn't actually resizing the window as it should, or is drawing the background incorrectly.

    edit:

    alright - fixed (though it's a bit of a hack and if I had more time I'd investigate it more thoroughly). It wasn't recreating the background correctly. What I'm not sure about is why it was changed in the first place ...

    Find this method in the script and replace it with what I have below:

    Code:
      #--------------------------------------------------------------------------  # new method: adjust_message_window_size  #--------------------------------------------------------------------------  def adjust_message_window_size    self.height = window_height    self.width = window_width    dispose_back_bitmap    create_back_bitmap    @back_sprite.bitmap = @back_bitmap    create_contents    update_placement    self.x = (Graphics.width - self.width) / 2    start_name_window  end
     
    Last edited by a moderator: Apr 6, 2014
    #18
  19. Ech0es

    Ech0es Moon Veteran

    Messages:
    37
    Likes Received:
    0
    Location:
    Earth
    First Language:
    English
    Primarily Uses:
    N/A
    Alright, it's resizing the dim background like the rest of the messages... but it's still showing up alligned on the left, instead of the window box being centered like the other message boxes. Is there a way to have it centered?
     
    Last edited by a moderator: Apr 6, 2014
    #19
  20. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    The message box takes up the whole width of the screen. There is no centering because there's no unused space on either side.
     
    #20
Thread Status:
Not open for further replies.

Share This Page