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

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

  1. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,071
    Location:
    Toronto
    First Language:
    English
    Galv's script call should do what you want.


    And don't write extra 0's in front of a number that makes it an octal and not a decimal.
     
    Last edited by a moderator: Mar 14, 2013
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,953
    Likes Received:
    11,614
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    No, that's not the right syntax - Galv wrote it exactly as you should key it in.


    If you're using a move route, then whatever character the move route is applied to (in your drop-down box at the top of the move route) is the character that the balloon will appear over. And the number on the right is what animation you want to show from that balloon sheet. So 1 will be the exclamation.


    So, if you want to show an exclamation over the player, you'd do this:

    Set Move Route (Player): Script: @balloon_id = 1
    And if you want to show it over event 2, you'd do this:

    Set Move Route (EV002): Script: @balloon_id = 1
    Notice there's no change in the @balloon_id = 1 to say whether it's over the player or an event - it's the move route itself that determines it.
     
    Last edited by a moderator: Mar 14, 2013
  3. seita

    seita Donn_M Veteran

    Messages:
    2,255
    Likes Received:
    611
    Location:
    California
    First Language:
    English
    Thanks for the heads up, I wasn't aware that the script call was from one of Galvs scripts. I'm assuming its the Galv's Move Route Extras? I'll give it a shot.

    Edit: Bleh I'm so out of it. Nevermind, I got it to work. Thanks guys!
     
    Last edited by a moderator: Mar 14, 2013
  4. Galv

    Galv Veteran Veteran

    Messages:
    1,180
    Likes Received:
    1,116
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    N/A
    Sorry, I should have been more specific. You don't require a script for that one - it will work by default. Glad you worked it out, though
     
  5. Allerka

    Allerka Veteran Veteran

    Messages:
    289
    Likes Received:
    71
    First Language:
    English
    Got an RPG XP qustion! Not sure if it's been answered elsewhere; I've tried looking for an answer, but haven't seen anything.

    Anyway, it has to do with Window_Message, i.e. the text box that appears when you have someone talking, or a message appearing, etc. There's a bit of a gap between the bottom of the box and the bottom of the screen, about 16 pixels or so. Despite my best efforts, I can't get the darn thing to sit along the very bottom of the screen, even after altering Window_Message itself to SPECIFICALLY TELL IT to move down.

    I've seen other games pull it off. Am I missing something?
     
  6. 255

    255 Occasional user Veteran

    Messages:
    36
    Likes Received:
    2
    First Language:
    Italian
    Uh... :unsure: Nope. There is not even a single pixel. The border in the defult system graphic is 6 pixel, not even close to 16 and it's the border anyway, so it's not an actual gap.
    Maybe it's some script you're using?


    ---


    My question


    How do you debug a situation where the game "halts" in the menu giving no errors? Excluding loosing hours trying to guess the cause of the bug.
     
    Last edited by a moderator: Mar 18, 2013
  7. Shaz

    Shaz Veteran Veteran

    Messages:
    37,953
    Likes Received:
    11,614
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    What do you mean, "halts" in the menu? I'm guessing you've added your own functions and you're doing some kind of update loop inside them, rather than relying on the way windows are updated by default, and you don't have a way to exit the loop (or you haven't added a 'cancel' response)
     
  8. 255

    255 Occasional user Veteran

    Messages:
    36
    Likes Received:
    2
    First Language:
    Italian
    I mean that the window (which is a selectable one) doesn't move its cursor (the cursor doesn't even blink) and doesn't answer to inputs (I've set the handlers). Maye "freezes" was a better verb.
    Yes, I'm trying to create a custom menu command using various references (looking at other scripts).
    No.

    Among various things I tried, I tried to aliasing the update method putting a messagebox inside and the message does appear, so it seems that the scene is not actually frozen, but still the cursor does not blink. Yes I did ".activate".


    My actual question is: is there any debug method I could use excluding guessing and msgbox-style debugging? Because I already lost more than two hours on this and I feel I'll never find the cause of the "freezing".
     
    Last edited by a moderator: Mar 18, 2013
  9. Allerka

    Allerka Veteran Veteran

    Messages:
    289
    Likes Received:
    71
    First Language:
    English
    I'm not talking about a gap within the window, I mean the gap between the window itself and the edge of the screen. Like this:

    View attachment 4422

    Even a default project, with zero modification, has it. So it's not a script I'm using.

    View attachment 4423

    I want the edge of the window to be touching the bottom of the screen. I've SEEN other games do it, so I know it's possible.
     
  10. Shaz

    Shaz Veteran Veteran

    Messages:
    37,953
    Likes Received:
    11,614
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    255, there is no 'debug' facility, other than just putting print statements into your code and testing with the console open to see what's happening. There's no way to 'step through' the code.


    If you can't figure it out yourself and you don't want to spend more hours trying, I suggest you start a new thread and post your scripts so we can take a look. Be sure to wrap your code in code tags to preserve formatting (makes it so much easier to read), and if it's very long, maybe put all of that inside spoiler tags too. Without actually seeing the code, we'd just be guessing at what's wrong.
     
    Last edited by a moderator: Mar 18, 2013
  11. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,071
    Location:
    Toronto
    First Language:
    English
    Unresponsive windows are usually due to not activating a window somewhere.
     
  12. 255

    255 Occasional user Veteran

    Messages:
    36
    Likes Received:
    2
    First Language:
    Italian
    @Allerka


    Oh, I now see that you use RMXP, so I cannot help. In VX Ace the window is already on the bottom.


    @Shaz:


    I see, thanks.


    @Tsukihime


    Thanks to your suggestion, today, with fresh mind, I've guessed and confirmed that I wrote ".active" instead of ".activate". =__='


    That's bad luck, because "active" actually exists, it's a boolean and so it wasn't giving me an error. Otherwise it would've been easier to find the bug.
     
    Last edited by a moderator: Mar 18, 2013
  13. Rigor Mortex

    Rigor Mortex Mankind's Mirror Veteran

    Messages:
    58
    Likes Received:
    3
    Location:
    Dark World
    First Language:
    English
    Here are two things I'm curious about (since I may want to modify the first, and definitely the latter).

    Where exactly is the code that states how much TP is generated from taking damage, and where is the code that says how much TP actors start battles with? The latter in particular I want to eliminate for those classes that don't use TP at all.
     
    Last edited by a moderator: Mar 18, 2013
  14. ??????

    ?????? Diabolical Codemaster Veteran

    Messages:
    6,267
    Likes Received:
    2,318
    Location:
    Your OS
    First Language:
    Binary
    Primarily Uses:
    RMMV
    in class

    Game_Battler

    or 

    Game_BattlerBase 

    Ctrl + F and you can search for tp 

    (cant remember which one but its in one of those classes :p )
     
    Last edited by a moderator: Mar 18, 2013
  15. Shaz

    Shaz Veteran Veteran

    Messages:
    37,953
    Likes Received:
    11,614
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    How would you capture an array out of a string with a regular expression?


    I want:


    "<key 1 2 3 4 5>" to result in [1, 2, 3, 4, 5]


    "<key 1 2 3>" to result in [1, 2, 3]


    Everything after the key will always be digits (could be multiple digits, like 10, 11, etc), but there could be any number of them.
     
    Last edited by a moderator: Mar 19, 2013
  16. Dr.Yami

    Dr.Yami 。◕‿◕。 Developer

    Messages:
    994
    Likes Received:
    738
    Location:
    Finland
    First Language:
    Vietnamese
    Primarily Uses:
    Other
    Maybe this would help:

    Code:
    def blah(string)  string =~ /<key (.*)>/i  return $1.scan(/\d+/).collect { |i| i.to_i }end
     
  17. Shaz

    Shaz Veteran Veteran

    Messages:
    37,953
    Likes Received:
    11,614
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    That did it. Thank you :) Pity there isn't a way to do it all in a single line.
     
  18. Dr.Yami

    Dr.Yami 。◕‿◕。 Developer

    Messages:
    994
    Likes Received:
    738
    Location:
    Finland
    First Language:
    Vietnamese
    Primarily Uses:
    Other
    Single line:

    Code:
    def blah(string)  /<key (.*)>/i.match(string)[1].scan(/\d+/).collect {|i| i.to_i}end
     
  19. Shaz

    Shaz Veteran Veteran

    Messages:
    37,953
    Likes Received:
    11,614
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    awww, just beautiful :D


    Thank you again :)
     
  20. AeonSpark

    AeonSpark Veteran Veteran

    Messages:
    102
    Likes Received:
    5
    First Language:
    English
    Quick question.

    I'm using input numbers for an ATM machine event.

    I have ones for entering PIN codes (different PIN codes as quest rewards etc) and an input number for withdrawing and depositing cash.

    Whenever using the 'Input Number' event, the number I input stays the same, (for this example 6266) even after coming back to the event the number stays the same.

    So is there a way to 'reset' the input number event to just 0's?

    Thanks for any and all help.
     

Share This Page