Question regarding Ace Message System Script. Looking to change name window color.

Discussion in 'RGSSx Script Support' started by McMillan, Oct 25, 2016.

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

    McMillan Veteran Veteran

    Messages:
    36
    Likes Received:
    3
    First Language:
    English
    I hope this is the right place to ask for script advice/assistance.


    Okay so, Earlier, I managed to eliminate message window bordering, and made the transparency in windows uniform by editing that Window.png file. I didn't like the result, so instead I chose to eliminate the transparency by adding "self.back_opacity = 255" to the Window_Base default script. So now the message/text windows are the way I like them.


    However.


    I also wanted to have name windows so I used yanfly's Ace Message System script to get them. Unfortunately, the name windows are the same color as the text windows. I want to change the color of the name window, but I don't know how. The script only has the following options for the name window:

        #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
        # - Name Window Settings -
        #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
        # The name window is a window that appears outside of the main message
        # window box to display whatever text is placed inside of it like a name.
        #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
        NAME_WINDOW_X_BUFFER = -20     # Buffer x position of the name window.
        NAME_WINDOW_Y_BUFFER = 0       # Buffer y position of the name window.
        NAME_WINDOW_PADDING  = 0       # Padding added to the horizontal position.
        NAME_WINDOW_OPACITY  = 0       # Opacity of the name window.
        NAME_WINDOW_COLOUR   = 15      # Text colour used by default for names.

    As a bypass, I tried to use a large picture to color the window with the \pic[x] command provided by the script, however, the picture is limited in size to the number of lines of text there are.


    Is there a script somewhere that allows me to change the background color of specific windows? Is there a command as simple as "self.back_opacity = 255" that I can use to choose which windows have which colors? I'd really appreciate some help.


    Yanfly's Ace Message System: https://yanflychannel.wordpress.com/rmvxa/core-scripts/ace-message-system/


    http://pastebin.com/5iBEcjsb
     
    Last edited by a moderator: Oct 25, 2016
    #1
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,712
    Likes Received:
    11,419
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    When you ask for help with scripts, please provide a link to the script's forum/website/blog/whatever to make it easier for people to find - no matter how popular you think they are.


    I assume you want to change the background colour rather than the text colour, as Yanfly's script appears to do that.


    The appearance of the window is based on the windowskin you're using, and the tone you set in the System tab.  I believe if you can manage a way to change the tone for the name window, that would be what you're after.


    Window_Base has an update_tone method that's run after initialization and during the update method.  So you could override this method for the name window class and instead of using $game_system.window_tone, just use a different tone.  I suggest you create a constant that is a new tone where you set all the values, then just use that in the command rather than using Tone.new(...) each time.


    In fact you could probably add a NAME_WINDOW_TONE = Tone.new(...) to the header of that script and use that.  As far as where to put the other changes and the name of the class, I don't know as I don't use the script and you didn't give a link and I'm not going to go searching for it.  Hopefully you'll be able to figure it out.


    Although, re-reading your post, you said you elimated the background from the windows by changing the opacity in the Window_Base class.  If you changed opacity of all windows, how can the name window have a colour?  Or did you only do it to some windows?  You might need to provide further information on what you've actually done (show us the method, don't just give us one line with no context) if you need more help.
     
    Last edited by a moderator: Oct 25, 2016
    #2
  3. McMillan

    McMillan Veteran Veteran

    Messages:
    36
    Likes Received:
    3
    First Language:
    English
    Right, sorry about that. Edited the question to include links to the script at the end of the post.


    I'm assuming the Tone.new(...) is where you place the rgba values?
     
    #3
  4. McMillan

    McMillan Veteran Veteran

    Messages:
    36
    Likes Received:
    3
    First Language:
    English
    Oh, the color wasn't eliminated, I eliminated the opacity by inserting " self.back_opacity = 255" into the Window_Base script so that the color of the windows would be full and not see through. Only the opacity was set to max. The color of the windows is still there, set via the database. The only thing eliminated was the window borders by erasing them in Window.png


    The main issue for now is being able to change the color of a particular window to a different color from the system default.


    Here's pictures to show the current situation:


    [Removed]


    In the 2nd image, you'll see that the middle area is a different color from the window, but that's the failed attempt I mentioned earlier where I tried to use the \pic[x] command to have a picture fill the entire window so it could be a different color. However, the picture is limited seemingly by the number of lines of text the name window has.


    So I'm hoping there's a way to change the name window background color.
     
    Last edited by a moderator: Oct 25, 2016
    #4
  5. Shaz

    Shaz Veteran Veteran

    Messages:
    37,712
    Likes Received:
    11,419
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Ah, sorry - I was thinking you set it to 0 to make the background invisible.


    What I said above should work - you just need to set that constant to the tone you want (use the System tab to play with the tone to get the correct RGBA values) and then add the update_tone method for the correct class name.


    So (thanks for adding the links - I can help you more now), where you've got all the NAME_WINDOW settings in the script, add a new line that's like this:


    NAME_WINDOW_TONE = Tone.new(a, b, c, d)


    where a, b, c, d are the red, green, blue, and alpha settings you got when figuring out the right colour.


    Then add this

    Code:
    class Window_NameMessage < Window_Base
      #--------------------------------------------------------------------------
      # * Update Tone
      #--------------------------------------------------------------------------
      def update_tone
        self.tone.set(YEA::MESSAGE::NAME_WINDOW_TONE)
      end
    end
    to the very bottom of the script.
     
    Last edited by a moderator: Oct 25, 2016
    #5
  6. McMillan

    McMillan Veteran Veteran

    Messages:
    36
    Likes Received:
    3
    First Language:
    English
    Thank you very, very much for this help! I really needed it! Solved my issue perfectly.


    Results:

    [​IMG]
     
    #6
    Shaz likes this.
  7. mlogan

    mlogan Global Moderators Global Mod

    Messages:
    13,797
    Likes Received:
    7,616
    Location:
    Texas
    First Language:
    English
    Primarily Uses:
    RMMV
    Gonna move this to script support and then close it, since you found your answer.
     
    #7
Thread Status:
Not open for further replies.

Share This Page