State Increasing Variables Temporarily?

Discussion in 'RGSS3 Script Requests' started by Gravemaster, Aug 20, 2018.

  1. Gravemaster

    Gravemaster Lord Veteran

    Messages:
    67
    Likes Received:
    5
    Location:
    Tripoli, Greece
    First Language:
    English
    Primarily Uses:
    N/A
    Hey, how's it going?

    1)In my game, Broken Reality, I have included the "Intoxication" state, which is caused by consuming alcochol. I want it, apart from its normal effects (the ones I can induce with VX Ace's original capabilities), to also temporarily raise two variables by one, when applied on a SPECIFIC character (the first of the party/first in the database of actors (that will always be the same character)). When the effect ends, the variables should decrease back to normal. The variables should return to normal no matter how the state ends (resting in an inn, walking the required number of steps or manually removing it with another item), and the effect does not stack (as in, if the first character is already intoxicated, applying the state again will not give an extra variable bonus).

    (specifically "intoxication" is the state with 011 ID, and I want it to temporarily increase the variables 0029 and 0030 by 1 when applied, "estrogen" and "testosterone" respectively, which determine how male or female characters react to the player)

    2)This is a secondary request for the script, but with the same conditions (state applied on the first party member specifically) can it also induce a motion-blurring effect from Zeus81's Map Effects Script and similarly remove them when the effect ends?

    In case it matters somehow, I am using Hime's Permanent States Script. The intoxication state is not one of them.

    Your name will be added to the credits of my Broken Reality RPG, by its next version (when the script will start being used). If such a script already exists I apologize, Google was pretty unhelpful.
     
    #1
  2. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,153
    Likes Received:
    4,588
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    Code:
    class Game_Variables
      alias :ed_var :[]
      def [](id)
        if (id == 29 || id == 30) && $game_actors[1].state?(11)
          return ed_var(id) + 1
        end
        return ed_var(id)
      end
    end
    
    This does not include map refresh. So any event page wont be switched whether the state is applied or gone. However, you can use it for conditional branching since it does increase the variable.
     
    #2
  3. Gravemaster

    Gravemaster Lord Veteran

    Messages:
    67
    Likes Received:
    5
    Location:
    Tripoli, Greece
    First Language:
    English
    Primarily Uses:
    N/A
    Nah... Adding a check on every single map sounds a bit counterproductive. Thanks though.
     
    #3
  4. Wavelength

    Wavelength Pre-Merge Boot Moderator

    Messages:
    3,910
    Likes Received:
    3,282
    Location:
    Florida, USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    You could feasibly use my Encounter Rate Items script, set the items to a regular 1.00 multiplier (meaning no effect on encounter rate), and use the Common Event functions available in my script to run the Common Events when the effect ends to decrease the variable, after increasing the variable when you use the item in the first place. (Some simple eventing inside the Common Event makes it possible to check who the item was used on - if you need the details on how to do this, let me know.) Note, however, that since this bypasses the use of an actual state, you wouldn't be able to remove it by resting at an Inn. It would naturally wear off over time (which I think is steps on the map).

    However, the way I would recommend doing it based on your intended effect (of changing the way that NPCs respond to you, etc.), is to avoid scripts entirely, as well as avoiding actually increasing the variable while Intoxicated. Instead, whenever you are going to check the Estrogen/Testosterone levels, do the following:
    • Copy that variable into a temporary holder variable (easy to do from the Control Variables event command)
    • Check whether the appropriate character has the Intoxication state applied (easy to do from Conditional Branch); if so, increase the TEMPORARY HOLDER variable by 1 (Control Variables)
    • Finally, check the Temp Holder variable (Conditional Branch), and give responses as appropriate (like you're doing now with the original variables)
    This is probably the easiest, safest, and most intuitive way to consider Intoxication when checking those variables.
     
    #4

Share This Page