State Increasing Variables Temporarily?

Joined
Apr 17, 2013
Messages
89
Reaction score
6
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.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,085
Reaction score
5,699
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.
 
Joined
Apr 17, 2013
Messages
89
Reaction score
6
First Language
English
Primarily Uses
N/A
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.
Nah... Adding a check on every single map sounds a bit counterproductive. Thanks though.
 

Wavelength

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
4,944
Reaction score
4,126
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Managed to find a way to hang a bed cover over my window. So no more being toasted alive in the afternoon!:kaoswt2:
So, uh, has anyone tried buying any resources from KokoroReflections? Because I've been looking for a 'buy' button on the site for like 10 minutes now and can't find one.
Any also thought it's too cringy to put the word "and you" in your credit as a special thanks?
Cause that's what I thought...
Everyone in the US right now: Please stay safe.
Symphony Celestia: Prophecy of the Falling Stars RPG Maker music pack WIP. Symphony Celestia is a new series that focuses on symphonic and orchestrated music to tell a story. Each story will include compositions that make up that story from beginning to end. Themes include: Battles, adventures, character themes, etc. Below is a video preview to the first story.

Forum statistics

Threads
97,980
Messages
948,329
Members
129,246
Latest member
Flaminguex
Top