Helladen

Deviant Designer
Veteran
Joined
Jul 13, 2012
Messages
635
Reaction score
189
First Language
English
Introduction
This is a script I wrote that allows you to call Common Events when a State is added or removed. It's very useful, if you want to control the state's functionality more so than default system allows via turn start/end counters.
 
 
Optional
Common Events may not work in battle for you, if they do not then please use this script and follow the screenshots below.
Hime - Scene Interpreter
 
 
Screenshots

G2Uls4W.png

 
 
7cdWXXR.png
 
 
Script
Dropbox
 
 
Commercial
My script can be used in any project, all I require is credit. Hime's script is not allowed in commercial projects without permission. Special thanks to Fomar0153 and Hime for their notetag guide.
 
Last edited by a moderator:

Kenen

Veteran
Veteran
Joined
Apr 3, 2012
Messages
308
Reaction score
235
First Language
English
Primarily Uses
RMMZ
This is beyond useful for battle mechanic enthusiasts like myself. Bookmarking. Thank you!
 

Helladen

Deviant Designer
Veteran
Joined
Jul 13, 2012
Messages
635
Reaction score
189
First Language
English
This is beyond useful for battle mechanic enthusiasts like myself. Bookmarking. Thank you!
Thanks! :)  It was requested by someone else, I didn't come up with the idea.

Although, my requirements changed - Hime's script may not be required although it is still useful if you want more control without having to get own dirty with the Script Editor, so this works for even commercial projects.
 
Last edited by a moderator:

Banjo

Veteran
Veteran
Joined
Jan 4, 2013
Messages
96
Reaction score
20
First Language
English
Primarily Uses
RMVXA
Does anyone have a working link for this script please?

I've been looking everywhere for it, but any post by the author (either as Aeirex or Helladen) has the same broken Dropbox link and no way to get the script.
 

Vis_Mage

Novice Magician
Veteran
Joined
Jul 28, 2013
Messages
674
Reaction score
219
First Language
English
Primarily Uses
RMMV
Does anyone have a working link for this script please?

I've been looking everywhere for it, but any post by the author (either as Aeirex or Helladen) has the same broken Dropbox link and no way to get the script.

Here you go, I just happened to have an old copy in one of my projects:

Code:
#==============================================================================
# ▼ State Common Events
# -- Author: Aeirex
# -- Version: 1.0.0
# -- Last Updated: 2015.01.06
# -- Level: Easy
# -- Requires: Hime - Scene Interpreter
#==============================================================================

#==============================================================================
# ■ Script Import
#==============================================================================
$imported = {} if $imported.nil?
$imported["AE-StateCommonEvents"] = true
#==============================================================================

#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This is a basic state script which allows common event injection to states.
#==============================================================================

#==============================================================================
# ■ Configuration
#==============================================================================
module AeirexStateHelper
  InCombat = false # States will only call a Common Event in combat.
end
#==============================================================================

#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Use these tags in States.
# <add common event: #>
# <remove common event: #>
#
# Add common event will trigger when a State is added. It will only process the
# common event after it is added and not before.
#
# Remove common event will trigger when a State is removed. It will only process
# the common event after it is removed and not before.
#
# This script relies on Hime - Scene Interpreter since RPG Maker VX ACE lacks
# global Common Events and are restricted to only process on the game map.
# Menus and battles do not work with common events, so this script is required
# for this script to work. You need to follow the instructions of the script,
# to specify which scene that the common event will open in.
#==============================================================================

#==============================================================================
# * States
#==============================================================================
class RPG::State
  #------------------------------------------------------------------------
  # * new add state: common event
  #------------------------------------------------------------------------
  def add_common_event
    if @add_common_event.nil?
      if @note =~ /<add common event: (.*)>/i
        @add_common_event = $1.to_i
      else
        @add_common_event = 0
      end
    end
    
    @add_common_event
  end

  #------------------------------------------------------------------------
  # * new remove state: common event
  #------------------------------------------------------------------------
  def remove_common_event
    if @remove_common_event.nil?
      if @note =~ /<remove common event: (.*)>/i
        @remove_common_event = $1.to_i
      else
        @remove_common_event = 0
      end
    end
    
    @remove_common_event
  end
 
end

#==============================================================================
# * Game_Battler
#==============================================================================
class Game_Battler < Game_BattlerBase   
  #------------------------------------------------------------------------
  # * alias method: add_state
  #------------------------------------------------------------------------
  alias add_state_ace add_state
  def add_state(state_id)   
    add_state_ace(state_id)

    # Call the common event only if in battle
    if !AeirexStateHelper::InCombat || $game_party.in_battle
      $game_temp.reserve_common_event($data_states[state_id].add_common_event)
    end
  end
 
  #------------------------------------------------------------------------
  # * alias method: erase_state
  #------------------------------------------------------------------------
  alias erase_state_ace erase_state
  def erase_state(state_id)   
    erase_state_ace(state_id)

    # Call the common event only if in battle
    if !AeirexStateHelper::InCombat || $game_party.in_battle
      $game_temp.reserve_common_event($data_states[state_id].remove_common_event)
    end
  end
 
end

#==============================================================================
# ▼ End of File
#==============================================================================
 

Banjo

Veteran
Veteran
Joined
Jan 4, 2013
Messages
96
Reaction score
20
First Language
English
Primarily Uses
RMVXA
Thanks SO much for that! I'm glad that script can be preserved for others to use in future, too.
 

Latest Threads

Latest Posts

Latest Profile Posts

I always end up having issues with things i'd never expect.

Capture.PNG

Those friggin mountains man xD
Time for my daily walk/jog ''Literally starts raining while I open the door''
I just discovered there's a giant jellyfish in the Ace RTP. My day is made.
I'm pretty sure I submitted a username change like 4 months ago.
...
No offense but uh, still waiting for my name to be updated :/

Forum statistics

Threads
112,395
Messages
1,068,014
Members
146,046
Latest member
Zheyno
Top