Vary healing item depending on which actor

● ARCHIVED · READ-ONLY
Started by Kes 10 posts View original ↗
  1. I know that something similar to this has been asked before, but after over an hour spent searching I can't find it.

    Healing item is set to, say, 100HP.  However, for one particular character, and only that character, I want it to heal, say, 150HP.

    I know this can be done with the damage formula, but I'm not getting it right.  Could anyone tell me what it should be?

    Thanks.
  2. Let's say your character is Actor 5:

    Code:
    b.id == 5 ? 150 : 100
    Change the 5 to whatever your actor's number is (no leading zeros)
  3. try

    b.id == 1 ? 150 : 100This will make the formula 150 if used on the actor who's database id is = to 1, or else 100 if anyone else. Obviously replace the 1 with whichever character you want effected.

    Edit: Always just a few seconds to slow, why do I even try this knowing the blue squirrel is lying in wait to ninja me?
  4. Blue squirrel is not always there ... even though it often looks like it is ;)
  5. For reasons which are, naturally, totally beyond me, this formula causes an error linked to a script I have which levels up skills depending on how often that skill is used.  Perhaps I should have said that this item is something that can only be used out of battle.  Does that make a difference?
  6. Nope.


    Link to script, exact (and full) text of error message, please.


    Going to move to RGSSx Script Support


    Are you SURE it's an error with that script? If you disable the script, does it work?
  7. I've tried it after disabling the script and it works.

    The error message is:

    Script 'DuncanS skill growth line 317: NoMethodError occurred.

    undefined method 'boost_type' for ~<RPG::Item:0x9112b4c>

    The script can be found here: http://pastebin.com/raw.php?i=URF9X8cp

    And the section that the error message refers to is this:

    Code:
      #--------------------------------------------------------------------------  # * Overwrite Method: make_damage_value  #   . Apply the damage boost from skill level  #--------------------------------------------------------------------------  def make_damage_value(user, item)    value = item.damage.eval(user, self, $game_variables)    # Add damage from skill level based on boost type    if user.is_a?(Game_Actor)       if item.boost_type.eql?(:comp)        # If the boost value is 0, assign the default        base = item.boost == 0 ? DMG::SKILL_BOOST_COMP : item.boost        boost = base ** (item.level[user.id]-1)        value *= boost      else        base = item.boost == 0 ? DMG::SKILL_BOOST_FLAT : item.boost        boost = base * (item.level[user.id]-1)        value += boost      end    end    value *= item_element_rate(user, item)    value *= pdr if item.physical?    value *= mdr if item.magical?    value *= rec if item.damage.recover?    value = apply_critical(value) if @result.critical    value = apply_variance(value, item.damage.variance)    value = apply_guard(value)    @result.make_damage(value.to_i, item)  end
  8. try adding this below the script.

    Spoiler
    Code:
    class Game_Battler < Game_BattlerBase  def make_damage_value(user, item)    value = item.damage.eval(user, self, $game_variables)    # Add damage from skill level based on boost type    if user.is_a?(Game_Actor) && item.is_a?(RPG::Skill)      if item.boost_type.eql?(:comp)        # If the boost value is 0, assign the default        base = item.boost == 0 ? DMG::SKILL_BOOST_COMP : item.boost        boost = base ** (item.level[user.id]-1)        value *= boost      else        base = item.boost == 0 ? DMG::SKILL_BOOST_FLAT : item.boost        boost = base * (item.level[user.id]-1)        value += boost      end    end    value *= item_element_rate(user, item)    value *= pdr if item.physical?    value *= mdr if item.magical?    value *= rec if item.damage.recover?    value = apply_critical(value) if @result.critical    value = apply_variance(value, item.damage.variance)    value = apply_guard(value)    @result.make_damage(value.to_i, item)  end end
  9. Perfect!  Thank you very much.
  10. This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.