PASSIVE SKILLS? [RM ACE]

Posts

Pages: 1
For the life of me I can't find a decent script for this anywhere. You guys know what this is, skills like +20% HP or Counterattack that are attached to learnable skills that the character learns. Not a passive STATE perse, but a passive SKILL.

My end goal here is to combine this feature with an Equip Skill feature (which I already have and seems to work fine) but I can't find a decent Passive Skill script goddamn anywhere.

Can anyone help?
Hmm I thought I had seen some script for this already, can't seem to find them though.
I have been planning on writing one similar to the FFTA games for like a month now but I kept pushing it aside. But now's a good time then ever to start! So if you can't find one yet, I'll probably post mine sometime tonight or if I can't finish tonight might be done by thrus-fri, since mon-weds are busy for me.
That sounds really rad; I'd be happy to test it out for you.
How does this tag look?
Passive: <mhp> 50

I'm not feeling it lol, maybe I should set it in brackets likes

I could also link it to a state, but I think a tag would look nicer. Only problem I'm seeing with note tag is a skill can't give 2 passives, unless I make a separate tag for each param. I'm fine with 1 passive a skill, but not sure if that'd throw you away.
One passive a skill might be restrictive for the sake of flexibility, I'm thinking especially so for late game skills. Does that value mean 50 PLUS max hp, a percentage, or something else? Also, would that tag extend to nonstat stuff like elemental damage and whatnot?
Yeah that's true, I could also make a 2nd and 3rd passive tag which runs the same thing. and that 50 in that case would have been %, I noticed after I had posted that it wasnt specific on that, so I'll see if I can have it something like:

Passive: <mhp> 50%
Passive: <mhp> 50

Where if you include a % sign it'll be a % of the total hp, but if you don't it'll add that fixed value.

And it might be able to add elemental, I'll see what I can do, if not I'll convert it to call states instead. The call state would just grab the params from the feature list and automatically apply them, but not completely sure if it'll be buggy especially when you remove the skill.
Is this something that would have to be mindful of compatibility with Yanfly's stuff?
I haven't looked at any of his scripts so I can't say. But I won't be over writing any methods so as long as note tags don't overlap it should be safe, hopefully, if not I don't mind rewriting/writing a patch to add compatibility.
I've also hit a wall atm, never realized the add_param method was only for the normal stat params, I thought it had an option for all params. Gotta see how other params are added now, if not I may have to go with adding 'hidden' states.
You might want to take a look at them perhaps. His scripts are very popular, so most of your userbase for your script is most likely going to have some scripts by him.

http://yanflychannel.wordpress.com/rmvxa/

Just a quick check to see if anything might overlap, or if anything might work with what he's got. Just a heads up, certainly not something you'd have to do for your base script.
I'll give it a look once I finish up. Shouldn't be too long, I fixed my passed issue. But I am over complicating it when I should just do a state but over complications ftw! Someone might need to hard edit a param and could use this as a reference.

Edited: Mm theres atk elements and element rate, which would you like? or should I put both? not really sure the difference, Only time I open database is to look/add a note tag lol
I just modified Yanfly's Passive X script so it includes skills. Get a passive state from a 'passive' skill. Here's the shebang, use in skills like you would with equipment:

#==============================================================================
# 
# ? Yanfly Engine Ace - Passive States v1.02
# -- Last Updated: 2012.01.23
# -- Level: Normal
# -- Requires: n/a
# 
#==============================================================================

$imported = {} if $imported.nil?
$imported["YEA-PassiveStates"] = true

#==============================================================================
# ? Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.01.23 - Compatibility Update: Doppelganger
# 2012.01.08 - Added passive state checks for adding/removing states.
# 2011.12.14 - Started Script and Finished.
# 
#==============================================================================
# ? Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script allows for actors, classes, weapons, armours, and enemies to have
# passives that are based off of states. Passive states will be active at all
# times and are immune to restrictions and will only disappear if the battler
# dies. Once the battler revives, the passives will return.
# 
#==============================================================================
# ? Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ? Materials/?? but above ? Main. Remember to save.
# 
# -----------------------------------------------------------------------------
# Actor Notetags - These notetags go in the actors notebox in the database.
# -----------------------------------------------------------------------------
# <passive state: x>
# <passive state: x, x>
# This will cause state x to be always on (unless the battler is dead). To have
# multiple passives, insert multiples of this notetag.
# 
# -----------------------------------------------------------------------------
# Class Notetags - These notetags go in the class notebox in the database.
# -----------------------------------------------------------------------------
# <passive state: x>
# <passive state: x, x>
# This will cause state x to be always on (unless the battler is dead). To have
# multiple passives, insert multiples of this notetag.
# 
# -----------------------------------------------------------------------------
# Weapon Notetags - These notetags go in the weapons notebox in the database.
# -----------------------------------------------------------------------------
# <passive state: x>
# <passive state: x, x>
# This will cause state x to be always on (unless the battler is dead). To have
# multiple passives, insert multiples of this notetag.
# 
# -----------------------------------------------------------------------------
# Armour Notetags - These notetags go in the armours notebox in the database.
# -----------------------------------------------------------------------------
# <passive state: x>
# <passive state: x, x>
# This will cause state x to be always on (unless the battler is dead). To have
# multiple passives, insert multiples of this notetag.
# 
# -----------------------------------------------------------------------------
# Enemy Notetags - These notetags go in the enemies notebox in the database.
# -----------------------------------------------------------------------------
# <passive state: x>
# <passive state: x, x>
# This will cause state x to be always on (unless the battler is dead). To have
# multiple passives, insert multiples of this notetag.
# 
#==============================================================================
# ? Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
# 
#==============================================================================
# ? Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================

module YEA
  module REGEXP
  module BASEITEM
    
    PASSIVE_STATE = 
      /<(?:PASSIVE_STATE|passive state):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
    
  end # BASEITEM
  end # REGEXP
end # YEA

#==============================================================================
# ¦ DataManager
#==============================================================================

module DataManager
  
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  class <<self; alias load_database_pst load_database; end
  def self.load_database
    load_database_pst
    load_notetags_pst
  end
  
  #--------------------------------------------------------------------------
  # new method: load_notetags_pst
  #--------------------------------------------------------------------------
  def self.load_notetags_pst
    groups = [$data_actors, $data_classes, $data_weapons, $data_armors, 
      $data_enemies, $data_skills] # GRS ammendum - Added skills to give passives
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_pst
      end
    end
  end
  
end # DataManager

#==============================================================================
# ¦ RPG::BaseItem
#==============================================================================

class RPG::BaseItem
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :passive_states
  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_pst
  #--------------------------------------------------------------------------
  def load_notetags_pst
    @passive_states = []
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::BASEITEM::PASSIVE_STATE
        $1.scan(/\d+/).each { |num| 
        @passive_states.push(num.to_i) if num.to_i > 0 }
      #---
      end
    } # self.note.split
    #---
  end
  
end # RPG::BaseItem

#==============================================================================
# ¦ Game_BattlerBase
#==============================================================================

class Game_BattlerBase
  
  #--------------------------------------------------------------------------
  # alias method: state?
  #--------------------------------------------------------------------------
  alias game_battlerbase_state_check_pst state?
  def state?(state_id)
    return true if passive_state?(state_id)
    return game_battlerbase_state_check_pst(state_id)
  end
  
  #--------------------------------------------------------------------------
  # alias method: states
  #--------------------------------------------------------------------------
  alias game_battlerbase_states_pst states
  def states
    array = game_battlerbase_states_pst
    array |= passive_states
    return array
  end
  
  #--------------------------------------------------------------------------
  # new method: passive_state?
  #--------------------------------------------------------------------------
  def passive_state?(state_id)
    @passive_states = [] if @passive_states.nil?
    return @passive_states.include?(state_id)
  end
  
  #--------------------------------------------------------------------------
  # new method: passive_states
  #--------------------------------------------------------------------------
  def passive_states
    array = []
    if actor?
      for state_id in self.actor.passive_states
        array.push($data_states[state_id]) if passive_state_addable?(state_id)
      end
      for state_id in self.class.passive_states
        array.push($data_states[state_id]) if passive_state_addable?(state_id)
      end
      for equip in equips
        next if equip.nil?
        for state_id in equip.passive_states
          array.push($data_states[state_id]) if passive_state_addable?(state_id)
        end
      end
      # Addition for skills - GRS
      for skill_num in @skills
        skill = $data_skills[skill_num]
        next if skill.nil?
        for state_id in skill.passive_states
          array.push($data_states[state_id]) if passive_state_addable?(state_id)
        end
      end
    else # enemy
      for state_id in self.enemy.passive_states
        array.push($data_states[state_id]) if passive_state_addable?(state_id)
      end
      if $imported["YEA-Doppelganger"] && !self.class.nil?
        for state_id in self.class.passive_states
          array.push($data_states[state_id]) if passive_state_addable?(state_id)
        end
      end
    end
    create_passive_state_array(array)
    sort_passive_states(array)
    set_passive_state_turns(array)
    return array
  end
  
  #--------------------------------------------------------------------------
  # new method: create_passive_state_array
  #--------------------------------------------------------------------------
  def create_passive_state_array(array)
    @passive_states = []
    for state in array
      @passive_states.push(state.id)
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: passive_state_addable?
  #--------------------------------------------------------------------------
  def passive_state_addable?(state_id)
    return false if $data_states[state_id].nil?
    return alive?
  end
  
  #--------------------------------------------------------------------------
  # new method: set_passive_state_turns
  #--------------------------------------------------------------------------
  def sort_passive_states(array)
    array.sort! do |state_a, state_b|
      if state_a.priority != state_b.priority
        state_b.priority <=> state_a.priority
      else
        state_a.id <=> state_b.id
      end
    end
    return array
  end
  
  #--------------------------------------------------------------------------
  # new method: set_passive_state_turns
  #--------------------------------------------------------------------------
  def set_passive_state_turns(array)
    for state in array
      @state_turns[state.id] = 0 unless @states.include?(state.id)
      @state_steps[state.id] = 0 unless @states.include?(state.id)
    end
  end
  
end # Game_BattlerBase

#==============================================================================
# ¦ Game_Battler
#==============================================================================

class Game_Battler < Game_BattlerBase
  
  #--------------------------------------------------------------------------
  # alias method: state_addable?
  #--------------------------------------------------------------------------
  alias game_battler_state_addable_ps state_addable?
  def state_addable?(state_id)
    return false if passive_state?(state_id)
    return game_battler_state_addable_ps(state_id)
  end
  
  #--------------------------------------------------------------------------
  # alias method: remove_state
  #--------------------------------------------------------------------------
  alias game_battler_remove_state_ps remove_state
  def remove_state(state_id)
    return if passive_state?(state_id)
    game_battler_remove_state_ps(state_id)
  end
  
end # Game_Battler

#==============================================================================
# 
# ? End of File
# 
#==============================================================================


Then I whipped this up so it doesn't show the passive states:
class RPG::State < RPG::BaseItem
  
  # See if this state should not be shown to the user if the notes include
  # the word 'SKIP' in them
  def skip?
    if @skip.nil?
      @skip = @note.include? "SKIP"
    end
    
    return @skip
  end
  
end

# Changes to Game_Actor to not show the message of getting or removing
# states if they aren't supposed to be shown
class Game_Actor < Game_Battler
  
  def show_added_states
    @result.added_state_objects.find_all{|x| !x.skip?}.each do |state|
      $game_message.add(name + state.message1) unless state.message1.empty?
    end
  end
  
    def show_removed_states
    @result.removed_state_objects.find_all{|x| !x.skip?}.each do |state|
      $game_message.add(name + state.message4) unless state.message4.empty?
    end
  end
end

# Change the BattlerBase to not show state icons that are hidden
class Game_BattlerBase
  
  def state_icons
    icons = states.find_all{|x| !x.skip?}.collect {|state| state.icon_index }
    icons.delete(0)
    icons
  end
  
end

Just add "SKIP" in the notebox in the passive states. It won't cover all conditions where it'll show added/removed states in other battle systems. Let me know if there's any issues.
I wiped up a States version since I was having problems removing the passive if it was a % in my over complicated version.
http://quasixi.wordpress.com/2014/03/23/quasi-passive/

But you may be better off using GreatRedSpirits since it's a patch Yanfly's so no need to worry about compatibility.
@ GreatRed Spirit : Sir, Can you adjust the script to class system too, so it wouldn't be permanently added to your actor status.
job a : passive skill (ATK+100)
when it's learned it would be permanently stay there even if i change the job to b

what i'm asking is : make a configuration where the stats or states should be permanently inherited or class-based (if using that class only)

i'm sorry for asking too much, but this one really got potential >.<
Thanks Before

P.S. Script Mentioned Above :
https://yanflychannel.wordpress.com/rmvxa/
https://yanflychannel.wordpress.com/rmvxa/core-scripts/class-system/
Sure, I can whip something up. I wouldn't tie it to anything specific like the class system, probably have some metadata on what skills an actor knows and what classes the skill is available with. Use the noteboxes* with the skill learned dialog for actors and classes to specify class restrictions, if any, and if an actor learns a skill again aggregate the class restrictions (or remove them if they learn a version without them). Repeat for items that give skills*.



*
Yayyy ><
i only got one imagination in my mind.
notetags :
for Skill : <passive state: x> or <passive state: x, x>

and maybe add like <skilltype: x> so if skill type x is available so the passive skill will acteivated as well..

like that?
Pages: 1