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

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

  1. Chucksaints

    Chucksaints Veteran Veteran

    Messages:
    32
    Likes Received:
    1
    First Language:
    Portuguese
    Primarily Uses:
    RMVXA
    Tales of vesperia, a meh game but with good graphics at least.

    sorry for asking, drawi face method? draw_actor_face?
    such a noob :x


    I would like to be cache images but since I have no experience in making scripts it's difficult to get there..
    sorry to bother & my English also xD
     
  2. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,362
    Likes Received:
    4,926
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    The question you asked is actually a bigger question than you thought. All those answers are just a hint with an assumption you know the fundamental and how to script in general like how to handle windows and sprites. Maybe you can try to consider:
    1. Learn the basics of how to write a script
    2. Request a script by creating a new thread request if you're not going to learn how to write a script.
     
  3. Chucksaints

    Chucksaints Veteran Veteran

    Messages:
    32
    Likes Received:
    1
    First Language:
    Portuguese
    Primarily Uses:
    RMVXA
    ok, thank you for your hint ^^
     
  4. Triacular

    Triacular Villager Member

    Messages:
    27
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMVXA
    Is there a way to automatically print something on a connected printer with RPG VXA?
    It would be cool to have this function for various reasons. I wouldn't be surprised is there's no way to do so.
     
  5. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,362
    Likes Received:
    4,926
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    Why would u do that though.
     
  6. Triacular

    Triacular Villager Member

    Messages:
    27
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMVXA
    For my game, there would be a place to read cooking recipes.
    When confirming that you want to see one, it will display the recipe. It will then ask if you want to print it off for convenience.
    A nice little bit for those who like to cook.
     
  7. Juanita Star

    Juanita Star Witch of compilations. Veteran

    Messages:
    88
    Likes Received:
    137
    First Language:
    Spanish
    Primarily Uses:
    RMVX
    I’m using Quest Journal from Modern Algebra (VX, version 2.1c). I don’t really get this one (I blame the language barrier): can the script give the rewards automatically after completing the quest or I have to event it? On the demo example, there is a mission for a Long sword, and it appears to be done automatically (no change weapon: Long Sword +1). But for other examples, is done manually. So, I got confused by that.
     
  8. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,362
    Likes Received:
    4,926
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    @Juanita Star you may get a better answer if you create a thread for better visibility. Since it's involving someone's script.
     
    Juanita Star likes this.
  9. Juanita Star

    Juanita Star Witch of compilations. Veteran

    Messages:
    88
    Likes Received:
    137
    First Language:
    Spanish
    Primarily Uses:
    RMVX
    For the record, I managed to find the solution after a good time of experimenting. I made objectives starting from 1 instead of 0, that was my mistake. I feel dumb xD
    On the good side, it was a good practice to learn a good part of the script.
     
  10. Otto

    Otto Veteran Veteran

    Messages:
    119
    Likes Received:
    70
    Location:
    Italy
    First Language:
    Engilsh
    Primarily Uses:
    RM2k3
    It's a dumb questio but... hell, I asked a lot of dumb questions so hopefully noone will mind one more lol

    what's the "opposite" script call to Graphics.freeze ?

    basically I wanted the screen to freeze, do some stuff in background then unfreeze so that the player sees the change instantly.
    I know that I can use Graphics.transition but I was wondering if there is an actual "instant" transition (without the fading effect you normally see on transition).
     
  11. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,362
    Likes Received:
    4,926
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    Graphics.transition(1) ?
     
    Otto likes this.
  12. Otto

    Otto Veteran Veteran

    Messages:
    119
    Likes Received:
    70
    Location:
    Italy
    First Language:
    Engilsh
    Primarily Uses:
    RM2k3
    thanks, that actually worked :D
     
  13. ZirconStorms

    ZirconStorms VX & VX Ace Scripts Veteran

    Messages:
    321
    Likes Received:
    104
    First Language:
    English
    Primarily Uses:
    RMVXA
    How do you go about modifying Window_Help so that you can center help text?
     
  14. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,698
    Likes Received:
    374
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    Window_help uses draw_text_ex, which does not seem to have the option for alignment.
    draw_text does.

    So perhaps try changing the refresh from draw_text_ex(4, 0, @text)
    to draw_text(x, y, width, fitting_height(line_number), @text, 1)

    Have no idea if that will work.
     
    ZirconStorms likes this.
  15. Sixth

    Sixth Veteran Veteran

    Messages:
    2,130
    Likes Received:
    798
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    It should work, but message codes will not be recognized that way.
    Message codes are the reason why that method got no alignment option in the first place, I guess.
    It is possible to make the text centered even with the draw_text_ex method, but it requires additional calculations after the text has been fully processed to get the width of the displayed text correctly.
     
    ZirconStorms likes this.
  16. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,362
    Likes Received:
    4,926
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    RIght, the text codes need to be removed first and every time you use \I[n], you add the text width by 24 (draw icon), as well as if you're using \N[x], for draw actor name. Possible, but not simple.
     
  17. Sixth

    Sixth Veteran Veteran

    Messages:
    2,130
    Likes Received:
    798
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    It's much more elegant to just track the X position of the text than to process the whole text again for message codes, not to mention that there are tons of other message codes (mostly custom made from other scripts) that may alter the text position in different ways.
    The text position is already tracked in draw_text_ex, so you just need to use that to calculate the final position of the centered text. It's actually fairly simple if you approach it this way. I use this method in my custom scripts made for commissions to provide every possible options for my customers with their text settings, even with message codes.
    If you want to save some processing time, you can also make a flag that will make the method skip the real drawing and will only calculate the necessary variables for text positioning, than disable that flag, store the variables, and run the method again now with the corrected X/Y positions.

    Or you can use a dummy window that will draw the text, get the necessary data from there. You can use that data to position the text and you can also copy the contents of that dummy window too instead of going through draw_text_ex again for drawing the text. This is what I saw many people do in some of their scripts on older engines.
     
    ZirconStorms and TheoAllen like this.
  18. ZirconStorms

    ZirconStorms VX & VX Ace Scripts Veteran

    Messages:
    321
    Likes Received:
    104
    First Language:
    English
    Primarily Uses:
    RMVXA
    For the sake of what I'm looking to achieve, Roninator2's solution works for me, but thank you for the detailed info/explanations, TheoAllen & Sixth. (It was near impossible to get info on why alignment didn't work for the help window.)
     
  19. ZirconStorms

    ZirconStorms VX & VX Ace Scripts Veteran

    Messages:
    321
    Likes Received:
    104
    First Language:
    English
    Primarily Uses:
    RMVXA
    How would you check if a whole number value is an odd or even number?
     
  20. Sixth

    Sixth Veteran Veteran

    Messages:
    2,130
    Likes Received:
    798
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    Code:
    if num % 2 == 0
    Where num is the number you check.
    Basically, if you can divide the number with 2 and there is no remainder, it is even, else it's odd.
     
    ZirconStorms likes this.

Share This Page