RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VXA] Variable & Switch Binding 1.0

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Variable & Switch Binding
Version: 1.0a
Author: modern algebra
Date: June 8, 2012

Version History


  • <Version 1.0a> 2012.06.08 - Fixed a bug that would occur with non-conforming comments.
  • <Version 1.0> 2012.04.20 - Original Release

Description


This script allows you to bind in-game switches and variables to specified expressions such that they will always correspond. As an example, if you want a particular variable to always track the MP of a specified actor, you can use this script to bind it to that value, and whenever the MP of the actor increases or decreases, so will the value of the variable without any further interference by you.

Features

  • Conveniently allows you to create variables and switches which permanently correspond to other values in the game.

Instructions

Paste this script into its own slot in the Script Editor, above Main but below Materials.

Please refer to the header for detailed instructions on use.

Script


Code: [Select]
#==============================================================================
#    Variable & Switch Binding
#    Version: 1.0a
#    Author: modern algebra (rmrk.net)
#    Date: June 8, 2012
#    Support: http://rmrk.net/index.php/topic,45809.0.html
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#   
#    This script allows you to bind in-game switches and variables to specified
#   expressions such that they will always correspond. As an example, if you
#   want a particular variable to always track the MP of a specified actor, you
#   can use this script to bind it to that value, and whenever the MP of the
#   actor increases or decreases, so will the value of the variable without any
#   further interference by you.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#   
#    Paste this script into its own slot in the Script Editor, above Main but
#   below Materials.
#
#    This script may require some scripting knowledge in that you may need to
#   know the code for desired expressions.
#
#    Please keep in mind that while a switch or variable is bound, it cannot be
#   operated on; you need to unbind the variable before you can operate on it.
#``````````````````````````````````````````````````````````````````````````````
#  Binding Switches:
#
#    At its most basic level, the following codes, placed in a script call, are
#   all that you need to know in order to bind or unbind switches:
#
#        bind_switch(switch_id, "expression", monitor?)
#        unbind_switch(switch_id)
#
#   switch_id  : replace this with the integer ID of the switch you are binding
#     (or unbinding).
#   expression : replace this with the particular scripting expression that you
#     are seeking to track.
#   monitor?   : replace this with true or false. You should set this to true
#     if the switch or variable you are binding are conditions on an event page
#     or common event and you expect the value to change in the relevant map.
#     This should be set to true only when necessary, as it can cause lag if
#     you are monitoring hundreds of these values.
#
#  EXAMPLES:
#
#      bind_switch(7, "Input.press?(:CTRL)", true)
#
#        Switch 7 would be true whenever the player is pressing CTRL and false
#       otherwise. Since monitor? is true, event pages and common events will
#       be automatically updated whenever the player is pressing CTRL. If
#       monitor? had been set to false, that would not happen.
#
#      unbind_switch(7)
#
#        Switch 7 would no longer be bound to anything - its value will be the
#       current value of the previously bound expression, but it is freed from
#       it and can now be modified again.
#
#    Also, please be aware that if expressions are longer than one line, you
#   will need to split them up. You can do this by setting them to a local
#   variable, like so:
#
#      a = "(Graphics.frame_count / 60)"
#      a += " % 2 == 0"
#      bind_switch(13, a)
#
#    That would bind the value of switch 13 to being ON when the number of
#   seconds played is even and OFF when odd.
#``````````````````````````````````````````````````````````````````````````````
#  Binding Variables:
#
#    Variables can be set in a similar way with the codes:
#
#        bind_variable(variable_id, "expression", monitor?)
#        unbind_variable(variable_id)
#
#    However, with variables, you can also bind it to any of the regular Control
#   Variable options by simply placing one of the following comments above a
#   regular Control Variable event command:
#
#      Bind Variable
#      Bind and Monitor Variable
#
#   Naturally, the latter will both bind and monitor the next variable, while
#   the former only binds it. Please note two things however. Firstly, it will
#   only bind if you are setting it to a variable, to game data, or to a script.
#   If you are setting it directly to an integer or setting it to a
#   random number, then it will not bind. Secondly, if you are not directly
#   setting but are performing some other operation like addition or division,
#   then the current value of the variable will always be added to the
#   expression. See the second example.
#
#  EXAMPLES:
#
#    @>Comment: Bind variable
#    @>Control Variable: [0007: Map] = Map ID
#
#      Variable 7 would now be bound to the map ID, so that it will always
#     return the ID of the map the party is currently within.
#
#    @>Control Variable: [0016: Hand Axes] = 3
#    @>Comment: bind and monitor variable
#    @>Control Variable: [0016: Hand Axes] -= [Hand Ax] in Inventory
#
#      Variable 16 would always be equal to 3 minus the current number of hand
#     axes in the inventory. Further, this is monitored so if you have an event
#     page with a condition like Variable 16 is 1 or above, then that event
#     will update to that page as soon as the party has less than 3 Hand Axes.
#
#  You can still only unbind variables with the call script noted at line 76.
#==============================================================================

$imported ||= {}
$imported[:MA_VariableSwitchBinding] = true


MAVSB_MONITOR_SCENES = [:Scene_Map, :Scene_Battle]
MAVSB_MONITOR_DEFAULT = false

#==============================================================================
# *** DataManager
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - self.create_game_objects; self.extract_save_contents
#    new method - self.init_mavsb_data
#==============================================================================

class << DataManager
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Create Game Objects
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mavsb_creategmobj_1ji8 create_game_objects
  def create_game_objects(*args, &block)
    mavsb_creategmobj_1ji8(*args, &block)
    init_mavsb_data
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Extract Save Contents
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mavsb_extracsave_4hs6 extract_save_contents
  def extract_save_contents(*args, &block)
    mavsb_extracsave_4hs6(*args, &block) # Call Original Method
    init_mavsb_data if !$game_variables.is_a?(MA_SwitchVariableBinding)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Initialize MAVSB Data
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def init_mavsb_data
    $game_switches.extend(MA_SwitchVariableBinding)
    $game_switches.initialize_mavsb_data
    $game_variables.extend(MA_SwitchVariableBinding)
    $game_variables.initialize_mavsb_data
  end
end

#==============================================================================
# *** MA Switch & Variable Binding
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  This module mixes in to Game_Switches and Game_Variables and provides the
# basic mechanism for binding.
#==============================================================================

module MA_SwitchVariableBinding
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Initialize MAVSB Data
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize_mavsb_data
    @mavsb_bind_hash = {}
    @mavsb_monitor_array = []
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Update Monitored Values
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def mavsb_update_monitered_values
    @mavsb_monitor_array.each {|data_id| self[data_id] }
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Get Value
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def [](data_id, *args, &block)
    if @mavsb_bind_hash[data_id].is_a?(String)
      value = eval(@mavsb_bind_hash[data_id])
      self[data_id] = value if value != @data[data_id]
    end
    super(data_id, *args, &block) # Call Original Method
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Bind to Value
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def mavsb_bind_to_value(data_id, expression = false, monitor = MAVSB_MONITOR_DEFAULT)
    @mavsb_monitor_array.delete(data_id) if @mavsb_monitor_array.include?(data_id)
    if !expression || expression.empty? || !expression.is_a?(String)
      self[data_id] = self[data_id]
      @mavsb_bind_hash.delete(data_id)
    else
      if expression.is_a?(String)
        @mavsb_bind_hash[data_id] = expression
        @mavsb_monitor_array.push(data_id) if monitor
      else
        p "Expression passed is not a string, so it cannot be bound"
      end
    end
  end
end

#==============================================================================
# ** Game_Interpreter
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased methods - command_108; command_122
#    new method - mavsb_interpret_bind_comment; bind_variable; unbind_variable
#==============================================================================

class Game_Interpreter
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Collect Comment
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mavsb_cmnd108comment_2hb7 command_108
  def command_108(*args, &block)
    mavsb_cmnd108comment_2hb7(*args, &block) # Call Original Method
    mavsb_interpret_bind_comment(@comments.join)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Interpret Comment
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def mavsb_interpret_bind_comment(comment)
    @mavsb_bind_next_variable = true if comment[/\\?BIND(.*?)VARIABLE/i]
    @masvb_monitor_next_variable = $1 && !$1[/MONITOR/i].nil?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Control Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mavsb_contrlvars122_3kj1 command_122
  def command_122(*args, &block)
    #  Only works if comment above is set to bind
    if @mavsb_bind_next_variable
      # Set expression to the method and only do the operation if not nil
      oper = ["", " + ", " - ", " * ", " / ", " % "][@params[2]]
      expr = mavsb_get_expression
      for i in @params[0]..@params[1] do
        # If directly setting or the current value is 0, ignore operation
        expr_f = (@params[2] == 0 || $game_variables[i] == 0) ? expr :
        ($game_variables[i].to_s + oper + expr)
        bind_variable(i, expr_f, @masvb_monitor_next_variable)
      end if expr # Only do it if the expression is not false
    end
    mavsb_contrlvars122_3kj1(*args, &block)
    # Turn off the binding automatically to prevent nasty bugs.
    @mavsb_bind_next_variable = false
    @masvb_monitor_next_variable = false
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Get Expression to bind against
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def mavsb_get_expression
    return case @params[3]
    when 1 then "$game_variables[#{@params[4]}]"  # Variable
    when 3 then mavsb_game_data_expression(@params[4], @params[5], @params[6]) # Game Data
    when 4 then @params[4]                        # Script
    else false
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Get Game Data for Variable Operand
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def mavsb_game_data_expression(type, param1, param2)
    case type
    when 0 then return "$game_party.item_number(#{$data_items[param1]})" # Items
    when 1 # Weapons
      return "$game_party.item_number(#{$data_weapons[param1]})"
    when 2 # Armors
      then return "$game_party.item_number(#{$data_armors[param1]})"
    when 3 # Actors
      if $game_actors[param1]
        case param2
        when 0 then return "$game_actors[#{param1}].level" # Level
        when 1 then return "$game_actors[#{param1}].exp"   # Exp
        when 2 then return "$game_actors[#{param1}].hp"    # HP
        when 3 then return "$game_actors[#{param1}].mp"    # MP
        when 4..11                                         # Parameter
          return "$game_actors[#{param1}].param(#{param2 - 4})"
        end
      end
    when 4  # Enemies
      if $game_troop.members[param1]
        case param2
        when 0 then return "$game_troop.members[#{param1}].hp" # HP
        when 1 then return "$game_troop.members[#{param1}].mp" # MP
        when 2..9                                              # Parameter
          return "$game_troop.members[#{param1}].param(#{param2 - 2})"
        end
      end
    when 5  # Character
      character = get_character(param1)
      if character
        char_e = character.is_a?(Game_Player) ? "$game_player" :
          "$game_map.map_id == #{$game_map.map_id} ? $game_map.events[#{character.id}] : 0"
        case param2
        when 0 then return "#{char_e}.x"         # X-coordinate
        when 1 then return "#{char_e}.y"         # Y-coordinate
        when 2 then return "#{char_e}.direction" # Direction
        when 3 then return "#{char_e}.screen_x"  # Screen X-coordinate
        when 4 then return "#{char_e}.screen_y"  # Screen Y-coordinate
        end
      end
    when 6  # Party
      return "$game_party.members[#{param1}] ? $game_party.members[#{param1}].id : 0"
    when 7  # Other
      case param1
      when 0 then return "$game_map.map_id"                           # Map ID
      when 1 then return "$game_party.members.size"                 # Party Size
      when 2 then return "$game_party.gold"                           # Gold
      when 3 then return "$game_party.steps"                          # Steps
      when 4 then return "Graphics.frame_count / Graphics.frame_rate" # Playtime
      when 5 then return "$game_timer.sec"                            # Timer
      when 6 then return "$game_system.save_count"                  # Save Count
      when 7 then return "$game_system.battle_count"              # Battle Count
      end
    end
    return "0"
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Bind/Unbind Variable
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def bind_variable(*args)
    $game_variables.mavsb_bind_to_value(*args)
  end
  def unbind_variable(*var_ids)
    var_ids.each {|i| $game_variables.mavsb_bind_to_value(i, "") }
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Bind/Unbind Switch
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def bind_switch(*args)
    $game_switches.mavsb_bind_to_value(*args)
  end
  def unbind_switch(*switch_ids)
    switch_ids.each {|i| $game_switches.mavsb_bind_to_value(i, "") }
  end
end

# Add the Switch and Variable monitoring to the specified scenes
MAVSB_MONITOR_SCENES.each { |scene_name|
  (Kernel.const_get(scene_name)).class_eval(
    "alias mavsb_#{scene_name.downcase}_update_1gk8 update
    def update(*args, &block)
      mavsb_#{scene_name.downcase}_update_1gk8(*args, &block)
      $game_switches.mavsb_update_monitered_values
      $game_variables.mavsb_update_monitered_values
    end")
}

Credit


  • modern algebra

Support


Please post in this thread at RMRK if you have any questions or encounter any errors. Please do not PM me or start a new topic for support, no matter how old is this thread. The reason for that is that any question or problem you have is likely shared by others, and I would like whatever answer I can give to benefit as many people as possible by being both public and conveniently accessed.

Known Compatibility Issues

There are currently no known compatibility issues.
« Last Edit: January 31, 2013, 09:46:52 PM by modern algebra »

***
Rep:
Level 77
RMRK Junior
How would I bind a variable to number of escapes or JP?

Forget that, the script's broken.
If I put a comment, even a blank one, anywhere in the event I get this error:


Uploaded with ImageShack.us
Code: [Select]
    @masvb_monitor_next_variable = !$1[/MONITOR/i].nil?

Monitoring is set to false

Code: [Select]
MAVSB_MONITOR_SCENES = [:Scene_Map, :Scene_Battle]
MAVSB_MONITOR_DEFAULT = false


And it happens if it's the only script in a project.
...


Code: [Select]
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Interpret Comment
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def mavsb_interpret_bind_comment(comment)
    @mavsb_bind_next_variable = true if comment[/\\?BIND(.*?)VARIABLE/i]
    @masvb_monitor_next_variable = !$1[/MONITOR/i].nil?
  end
« Last Edit: June 06, 2012, 12:50:22 PM by Wiimeiser »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Sorry about that. Go to line 229 and change:

Code: [Select]
    @masvb_monitor_next_variable = !$1[/MONITOR/i].nil?

to:

Code: [Select]
    @masvb_monitor_next_variable = $1 && !$1[/MONITOR/i].nil?

***
Rep:
Level 77
RMRK Junior
Just out of curiosity, how would I set a switch to be on when I'm in the airship?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Code: [Select]
bind_switch(1, "$game_player.in_airship?", true)

Replace 1 with the ID of the switch you want to use.

***
Rep:
Level 77
RMRK Junior
It doesn't seem to fit on one line in the script call box...
I think there's a way to fix it, but how?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
http://rmrk.net/index.php/topic,40220.0.html

See the section on call script errors. Basically you can do this:

Code: [Select]
a = "$game_player.in_airship?"
bind_switch(1, a, true)

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
I received a question asking me to clarify what it means to set the monitor value to true. This was the question:

Quote from: Anonymous
Hey I put one of your scripts in my project, and was reading the instructions. It's the Bind Variables/Switches script. You gave two options: bind, and bind/monitor.
Bind makes a variable always reflect a bit of game data, like current MP. The instructions said "Since monitor? is true, event pages and common events will be automatically updated."
I just had a few questions about that. What does it mean? Like, if I have an event just sitting there with a variable condition, and the script has "monitor?" true, will that event run? Or does it have to be active before it matters? I guess I just don't understand the monitor thing.

This was my answer:

A bound variable or switch normally only updates when it is specifically called, but if it is monitored than it updates every frame.

In other words, lets say you bind (but do not monitor) a switch to whether CTRL is being pressed. If you check the value of that switch in a conditional branch, then the switch will update its value only at the time it is checked, even if you've been pressing CTRL for the past 100 frames. Put another way, that switch's value remains false until you actually check whether it is true. However, if you are monitoring that switch, then its value changes immediately whenever you press or release CTRL.

This is relevant for event conditions because they are not ordinarily checked every frame. They are only checked when the value of a variable or switch is explicitly changed (among other times, but this is the relevant one).

So, let's say you have a variable that is bound to the number of steps that the party takes but is not being monitored, and you want a special event to appear when the number of steps reaches 100. Well, even though you increase the steps to beyond 100, that event will not show up since the variable is not being checked. If you monitor the variable though, then it will show up as soon as the party reaches 100 steps.

As to your question of whether it will run, it depends on the trigger. If the trigger is parallel process, then yes. If it is action button, then it will only run when the player presses Enter on it. It would be more correct to say that that event page becomes active immediately, not that it runs immediately.