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

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

  1. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,640
    Likes Received:
    2,969
    Location:
    Philippines
    First Language:
    Tagalog
    Buffs increase stats by a coded percentage (25% iirc) unlike states where you can set the percentage. At low values, the effects of such percentage increase might not be easily detectable, especially if your damage formula uses a small multiplier for atk, or if the variance is big.

    For starters, make sure what you want cannot be achieved by states, they are easier to work with anyway..

    Also, how much is the base attack of your character, and how did you determine that the ATK buff does nothing?
     
  2. Tevi

    Tevi Fierce Demon Woof Veteran

    Messages:
    33
    Likes Received:
    5
    Location:
    The United Kingdom
    First Language:
    English
    Primarily Uses:
    RMVXA
    Does nothing was a metaphor, honestly. I could probably do it with states, if I didn't want the states to stack. 112 Base ATK, and it doesn't increase the damage output of the skill by much at all. I'm mainly wondering if it's possible to alter the percentage easily, and if not I'll just not have stacking and use states.
    Sorry for being unclear, though.
    Edit: I figured out what value I needed to change, and where to change it. Sorry for being misleading in my comment.
     
    Last edited: Oct 24, 2019
  3. Solr

    Solr Living Weapon Veteran

    Messages:
    40
    Likes Received:
    7
    First Language:
    English
    Primarily Uses:
    RMVXA
    Are we allowed to post edits of other people's scripts? And if so, where would we post them? I am somewhat able to understand the logic of ruby script but I have no real experience. It was because of this, that I was able to trial-and-error-caveman-edit myself a really useful edit of a certain cosmetic script and I feel that other VXA user's could really benefit from this as well. People have gone out of their way to help me with my project so many times, I want to try to give something back to the community.

    Edit: To clarify, I am sure I can get permission from the original script author, I just want to know if it's within the rules of this forum that I can post this material.
     
  4. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,640
    Likes Received:
    2,969
    Location:
    Philippines
    First Language:
    Tagalog
    @Tevi - what is your damage formula anyway? It could actually more of because of the damage formula and the enemy stats rather than the buff itself.

    @Solr - there are sections of the forums to post scripts, where depends on which lamguage it is written.
     
  5. Solr

    Solr Living Weapon Veteran

    Messages:
    40
    Likes Received:
    7
    First Language:
    English
    Primarily Uses:
    RMVXA
    Ah, thank you, I feel silly.
     
  6. Tevi

    Tevi Fierce Demon Woof Veteran

    Messages:
    33
    Likes Received:
    5
    Location:
    The United Kingdom
    First Language:
    English
    Primarily Uses:
    RMVXA
    My damage formula's a bit weird, to be honest:
    (Math.sqrt(a.atk * POW) * TIER - b.def * 2) * AFF
    POW = Power defined by skill. Base Attack's power is Weapon ATK (a.xstat.watk) using NASTY Extra Stats.
    TIER = Tier of the skill, so 1-6 ( Miniscule - Colossal )
    AFF = Affinity with skill. Based on elements mainly, so if one of my actors nullifies Fire, they're fire attacks would be 2 Affinity.
    I feel like I should change my damage formula honestly, since I'd rather have one that's just a bit more balanced.
     
  7. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,640
    Likes Received:
    2,969
    Location:
    Philippines
    First Language:
    Tagalog
    Yeah, the sqrt of your atk*pow is probably damping the effect of increased attack a lot...
     
  8. Tevi

    Tevi Fierce Demon Woof Veteran

    Messages:
    33
    Likes Received:
    5
    Location:
    The United Kingdom
    First Language:
    English
    Primarily Uses:
    RMVXA
    Ah, right. I'll try and think of some other damage formula, since- that's probably the simpler solution.
     
  9. Malchar

    Malchar Villager Member

    Messages:
    6
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMVXA
    I can use 'wait_for_message' in any script that's going into the database, but if I try to use it inside the script editor, then I get the error that 'wait_for_message' is undefined in <whatever class I'm working in>. I can use $game_message.add() in any script anywhere to create a message, but how do I tell the game to 'wait_for_message' when I'm working in the script editor? Please let me know if this is too confusing, and I can try to explain more. Thank you!
     
  10. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,485
    Likes Received:
    5,093
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    I don't understand what do you mean by "going into the database".

    Of course, because wait for the message is only present in Game_Interpreter and Scene_Battle, however, you can imitate the same method anywhere.

    "Script editor" is too broad. You can not expect to write a single line and works. Give more context?

    It might be better to just post your entire script. And create a thread for more visibility.
     
  11. Malchar

    Malchar Villager Member

    Messages:
    6
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMVXA
    Thank you for the reply.

    To explain more, I can use wait_for_message in these scripts:
    Untitled2.png

    but it doesn't work in these scripts:
    Untitled1.png

    How can I use wait_for_message, or get a similar effect, when I'm working in the script editor (2nd screenshot)?
     
  12. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,750
    Likes Received:
    384
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    Try using @interpreter.wait_for_message
     
  13. KK20

    KK20 Just some XP Scripter Veteran

    Messages:
    103
    Likes Received:
    42
    Location:
    Orange County, California
    First Language:
    English
    Primarily Uses:
    RMXP
    -disregard, Fibers don't work that way-

    Edit: I say to move your stuff to a common event and have the script call it. You're trying to work with Game_Interpreter methods in an area that doesn't even handle events.
     
    Last edited: Nov 14, 2019
  14. A-Moonless-Night

    A-Moonless-Night WINTER IS COMING Veteran

    Messages:
    518
    Likes Received:
    368
    Location:
    New Zealand
    First Language:
    English
    Primarily Uses:
    RMVXA
    @Malchar You might need to do something like:
    Code:
    interpreter = $game_map.interpreter if SceneManager.scene_is?(Scene_Map)
    # text and things go here
    interpreter.wait_for_message
    EDIT: updated the code; don't think you need to use the interpreter if it's at the end of battle.
     
    Last edited: Nov 14, 2019
  15. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,485
    Likes Received:
    5,093
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    Just make your own custom wait, for example
    Code:
    SceneManager.scene.update_basic while $game_message.busy?
     
  16. Malchar

    Malchar Villager Member

    Messages:
    6
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMVXA
    Thanks to everyone for the ideas. Right now I have it working pretty well where I just call a common event, and then do a bunch of stuff in there.
     
  17. mogneto

    mogneto Gureito Eventer Member

    Messages:
    13
    Likes Received:
    4
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    so, what happened to RGSS Factory?
    upload_2019-11-18_13-13-32.png
    i was looking for some vxa scripts and when i go to their links (ofc, they're from this website) i see this.

    I don't know why the site was suspended, but where did the scripts go? Is all lost?
     
  18. Malchar

    Malchar Villager Member

    Messages:
    6
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMVXA
    Thank you again for the help. Originally, I thought I had it working, but more problems arose as I moved forward. Now, it is late in the evening, so I cannot provide a full explanation of everything. However, I just thought it might be useful to give some feedback. Again, thank you to everyone for the ideas!

    I wasn't able to get this to work.

    This worked pretty well, but I eventually ran into a problem.

    I basically just need to add a custom message and change the actor's graphics whenever the actor changes class. It needs to work on the field or in battle, because I have some items that change class, and you can also change class when you level up. With my current setup, when multiple actors change class at the same time, all the classes change correctly, but the messages only show up for the last actor in the party.

    The way that I had it setup was that I simply aliased the Game_Actor.change_class method and added $game_variables[3] = self.id, $game_variables[5] = self.class.id, and $game_temp.reserve_common_event(5) at the end. Common event #5 uses game variables 3 and 5 to work out the necessary messaging and graphics changes. See below:

    Code:
    class Game_Actor < Game_Battler
     
      alias evolution_change_class change_class
      def change_class(class_id, keep_exp = false)
        $game_variables[3] = self.id # actor id
        evolution_change_class(class_id, keep_exp)
        $game_variables[5] = self.class.id # new class id
        #$game_message.add("test " + $game_variables[3].to_s)
        #SceneManager.scene.update_basic while $game_message.busy?
        $game_temp.reserve_common_event(5)
        
      end
    It worked, but it only ran the common event once using the variables and parameters that would have been setup for the last actor. All previous actors were "skipped". I'm not really sure how the reserve_common_event method works, so maybe I am simply using it wrong. The "test" messaging (when not commented out) will trigger once for each actor that levels up before the common event happens once. Perhaps when the common event is called, it is unable to break out of the script processing, and it needs to wait until the script ends? Thus, multiple common events get stacked up waiting to happen, and then they only have the most recent version of the game variables, so it only seems to apply to the most recent actor?

    This works in the field, but it doesn't work after battle.

    This worked for field and battle. I'll try moving forward with this code. I had been using a common event, but per the problem I explained above, I'll have to move everything into the script. I will provide additional updates, and I might even make a whole thread if needed. I just need some time to work out a few things first.
     
    Last edited: Nov 19, 2019
  19. Chucksaints

    Chucksaints Veteran Veteran

    Messages:
    34
    Likes Received:
    1
    First Language:
    Portuguese
    Primarily Uses:
    RMVXA
    Hi there.
    How can I change text opacity?
    For instance in Window_MenuCommand?
    I've already tried .opacity, .font.color.opacity but with no success.

    alsoo

    How can I replace window arrows with a image (not windowskin)?

    thank you ^^
     
    Last edited: Nov 27, 2019
  20. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,485
    Likes Received:
    5,093
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    You have two options. Use either of
    .contents_opacity = 128
    OR
    .contents.font.color.alpha = 128

    Complicated. First, you have to erase the arrow from the windowskin image asset, then add your own sprite to the window.
     

Share This Page