Ruby/RGSSx questions that don't deserve their own thread

Discussion in 'RGSSx Script Support' started by Mr. Bubble, Mar 14, 2012.

  1. Mr. Bubble

    Mr. Bubble Makes stuff. Member

    Messages:
    853
    Likes Received:
    163
    Location:
    Portland, Oregon
    Feel free to ask any questions here that you feel do not warrant its own thread.
     
    Last edited by a moderator: Mar 15, 2012
    #1
    graithallerne likes this.
  2. Hendrik

    Hendrik Villager Member

    Messages:
    38
    Likes Received:
    1
    First Language:
    German
    Will i be able using the net library in rgss3?
     
    #2
  3. Solstice

    Solstice Warper Member

    Messages:
    4
    Likes Received:
    0
    First Language:
    English
    is it possible to use a sprite sheet, that uses 4 frames instead of 3 for animations
     
    #3
  4. Dr.Yami

    Dr.Yami 。◕‿◕。 Developer

    Messages:
    994
    Likes Received:
    736
    Location:
    Finland
    First Language:
    Vietnamese
    Primarily Uses:
    Other
    #4
  5. Kread-EX

    Kread-EX You're all bakas Veteran

    Messages:
    863
    Likes Received:
    81
    First Language:
    French
    If you mean calling functions from the .NET framework, then no. It's possible in theory of course, but in practice nobody with sense will put the effort to do so.
     
    #5
    Oriceles and Zeriab like this.
  6. ♥SOURCE♥

    ♥SOURCE♥ Too sexy for your party. Member

    Messages:
    693
    Likes Received:
    410
    Is it still possible to call functions from a custom dll? I just tested it and gives an error.
     
    Last edited by a moderator: Mar 19, 2012
    #6
  7. Kread-EX

    Kread-EX You're all bakas Veteran

    Messages:
    863
    Likes Received:
    81
    First Language:
    French
    Depending of the function, you may need to pack and/or unpack binary data.
     
    #7
  8. Mihel

    Mihel Veteran Veteran

    Messages:
    384
    Likes Received:
    45
    In the long run, is it more efficent to use text_color(n) or Color.new(n, n, n, n)?
     
    #8
  9. Kread-EX

    Kread-EX You're all bakas Veteran

    Messages:
    863
    Likes Received:
    81
    First Language:
    French
    If you work with windows, you should use text_color(n), if only because it takes color from your windowskin file and should (in theory; depends on the windowskin's creator) ensure the colored text will be readable. Color.new will be an arbitrary color chosen independently from the windowskin you are using. And if you work with Sprites, you'll have to do it that way.
     
    #9
  10. Mihel

    Mihel Veteran Veteran

    Messages:
    384
    Likes Received:
    45
    I work 99% with text and gauges (readability in this case is of secondary importance since I edit the graphics with external programs), so it's mostly about windows. I was mainly wondering about performance, say in a scene where there are many gauges being drawn at the same time would it be best to stick with text_color or it's not particularly relevant?

    Thanks for the reply.
     
    #10
  11. Kread-EX

    Kread-EX You're all bakas Veteran

    Messages:
    863
    Likes Received:
    81
    First Language:
    French
    Well, performance-wise, text_color returns a Color object anyways since it's the return value of the get_pixel. I'd need to benchmark to determine the exact performance gain but I'd say just creating the Color object yourself via Color.new should be faster.
     
    #11
  12. Velex

    Velex Veteran Veteran

    Messages:
    71
    Likes Received:
    2
    Location:
    New York
    First Language:
    English
    Hope this is an ok place to ask this, but how do I apply a downloaded .rb file to my game? I got how to paste code snippets and such, but I don't know what to do with an actual .rb file. (Specifically in VXAce).
     
    #12
  13. Mihel

    Mihel Veteran Veteran

    Messages:
    384
    Likes Received:
    45
    Just open it with notepad.
     
    #13
  14. Velex

    Velex Veteran Veteran

    Messages:
    71
    Likes Received:
    2
    Location:
    New York
    First Language:
    English
    Thanks!

    Also, to be honest, your grumpy avatar is making me feel ashamed of myself right now.
     
    #14
  15. Space Lizard

    Space Lizard Warper Member

    Messages:
    1
    Likes Received:
    0
    Location:
    SPAAACE
    First Language:
    English
    In RMVX Ace, is there a code snippet I can use to change the opacity of the "shadow" squares? Thanks.
     
    #15
  16. Kread-EX

    Kread-EX You're all bakas Veteran

    Messages:
    863
    Likes Received:
    81
    First Language:
    French
    The shadow squares are hard-coded in the Tilemap class. It's possible to 'overwrite' them after the map is loaded but it can be a time consuming process. I don't see why you would need to do that by the way.
     
    #16
  17. Zeriab

    Zeriab Huggins! Veteran

    Messages:
    1,200
    Likes Received:
    1,253
    First Language:
    English
    Primarily Uses:
    RMXP
    Yes. Win32API seems to work just as it did before.

    What did you do to get an error?
     
    #17
  18. Kenen

    Kenen Veteran Veteran

    Messages:
    255
    Likes Received:
    152
    First Language:
    English
    Primarily Uses:
    RMMV
    Something I'm having trouble with: changing the font color of part of a string that Window_BattleLog spits out.



    Code:
    #--------------------------------------------------------------------------
    # * Display Skill/Item Use
    #--------------------------------------------------------------------------
      def display_use_item(subject, item)
    	if item.is_a?(RPG::Skill)
    	  add_text(subject.name + item.message1)
    I'd like to set item.message1 to be a different color. I've tried this:



    Code:
    add_text(subject.name)
    change_color(system_color)
    add_text(item.message1)
    Which works, but causes a line break (Which I recently learned is because of how add_text behaves).

    Thanks.
     
    #18
  19. Kread-EX

    Kread-EX You're all bakas Veteran

    Messages:
    863
    Likes Received:
    81
    First Language:
    French
    You'll have to use a color escape character. Replace the line by something like this:



    Code:
    add_text(subject.name + "\\C[n]" + item.message1)
    n being the color number (determined by your windowskin).
     
    #19
    Kenen likes this.
  20. Kenen

    Kenen Veteran Veteran

    Messages:
    255
    Likes Received:
    152
    First Language:
    English
    Primarily Uses:
    RMMV
    Thank you!
     
    #20

Share This Page