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.
[XP] Clarification desired on battle script

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 73
RMRK Junior
 :tpg: :tpg:


I've located this script that does the job, but I'm not totally sure which values to change and how to phrase the changes. The instructions are vague for my skill level...but I'll I really need to know is what to change and where. Concisely put, this is what I'm confused about.

1. Where do I tag the enemies and how do I phrase the tag(is it by their name or ID number?)

2. Where do I change actor's name to my character's name and do I phrase this change by use of their ID number or actual name.

Please help, and all the thanks in the world to the person who does!


Code: [Select]
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Actor-dependent Enemy Stats
# Author: Kread-EX, by request of Demonfire94
# Date: 28/02/2010
# Version 1.0
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
 
#  TERMS OF USAGE
# #------------------------------------------------------------------------------------------------------------------
# #  You are free to adapt this work to suit your needs.
# #  You can use this work both for commercial and non-commercial work.
# #  Credit is appreciated.
# #------------------------------------------------------------------------------------------------------------------

=begin

HOW TO SETUP PROPORTIONAL STATS:

Enter the following in the note section for each enemy you want to have stats
proportional to actor states.

HP=50
MP=50
ATK=50
DEF=50
SPI=50
AGI=50
Actor=1

In this example, the monster will have all stats 50% higher than those of the
first actor.
For any tag you DON'T enter, the default editor value will be applied.
Always perform a carriage return when changing tags.
Note that the percentage applies to BASE stats, and thus, don't take the
equipment into account.
You can only enter 1 actor, though.

=end

#==============================================================================
# ** Game_Enemy
#==============================================================================

class Game_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  # * Determine tags
  #--------------------------------------------------------------------------
  def tags
    return enemy.note.split("\r\n")
  end
  #--------------------------------------------------------------------------
  # * Get Basic Maximum HP
  #--------------------------------------------------------------------------
  def base_maxhp
    percent = actor_id = final_value = nil
    dynamic = false
    tags.each {|str|
      if str.include?('HP')
        dynamic = true
        percent = (str.gsub(/\D/,'').to_i / (str.include?('-') ? -100.0 : 100.0))
      elsif str.include?('Actor')
        actor_id = (str.gsub(/\D/,'')).to_i
      end
    }
    if dynamic
      final_value = $game_actors[actor_id].base_maxhp
      final_value += ($game_actors[actor_id].base_maxhp * percent).round
      return final_value
    end
    return enemy.maxhp
  end
  #--------------------------------------------------------------------------
  # * Get Basic Maximum MP
  #--------------------------------------------------------------------------
  def base_maxmp
    percent = actor_id = final_value = nil
    dynamic = false
    tags.each {|str|
      if str.include?('MP')
        dynamic = true
        percent = (str.gsub(/\D/,'').to_i / (str.include?('-') ? -100.0 : 100.0))
      elsif str.include?('Actor')
        actor_id = (str.gsub(/\D/,'')).to_i
      end
    }
    if dynamic
      final_value = $game_actors[actor_id].base_maxmp
      final_value += ($game_actors[actor_id].base_maxmp * percent).round
      return final_value
    end
    return enemy.maxmp
  end
  #--------------------------------------------------------------------------
  # * Get Basic Maximum attack
  #--------------------------------------------------------------------------
  def base_atk
    percent = actor_id = final_value = nil
    dynamic = false
    tags.each {|str|
      if str.include?('ATK')
        dynamic = true
        percent = (str.gsub(/\D/,'').to_i / (str.include?('-') ? -100.0 : 100.0))
      elsif str.include?('Actor')
        actor_id = (str.gsub(/\D/,'')).to_i
      end
    }
    if dynamic
      final_value = $game_actors[actor_id].base_atk
      final_value += ($game_actors[actor_id].base_atk * percent).round
      return final_value
    end
    return enemy.atk
  end
  #--------------------------------------------------------------------------
  # * Get Basic defense
  #--------------------------------------------------------------------------
  def base_def
    percent = actor_id = final_value = nil
    dynamic = false
    tags.each {|str|
      if str.include?('DEF')
        dynamic = true
        percent = (str.gsub(/\D/,'').to_i / (str.include?('-') ? -100.0 : 100.0))
      elsif str.include?('Actor')
        actor_id = (str.gsub(/\D/,'')).to_i
      end
    }
    if dynamic
      final_value = $game_actors[actor_id].base_def
      final_value += ($game_actors[actor_id].base_def * percent).round
      return final_value
    end
    return enemy.def
  end
  #--------------------------------------------------------------------------
  # * Get Basic spirit
  #--------------------------------------------------------------------------
  def base_spi
    percent = actor_id = final_value = nil
    dynamic = false
    tags.each {|str|
      if str.include?('SPI')
        dynamic = true
        percent = (str.gsub(/\D/,'').to_i / (str.include?('-') ? -100.0 : 100.0))
      elsif str.include?('Actor')
        actor_id = (str.gsub(/\D/,'')).to_i
      end
    }
    if dynamic
      final_value = $game_actors[actor_id].base_spi
      final_value += ($game_actors[actor_id].base_spi * percent).round
      return final_value
    end
    return enemy.spi
  end
  #--------------------------------------------------------------------------
  # * Get Basic agility
  #--------------------------------------------------------------------------
  def base_agi
    percent = actor_id = final_value = nil
    dynamic = false
    tags.each {|str|
      if str.include?('AGI')
        dynamic = true
        percent = (str.gsub(/\D/,'').to_i / (str.include?('-') ? -100.0 : 100.0))
      elsif str.include?('Actor')
        actor_id = (str.gsub(/\D/,'')).to_i
      end
    }
    if dynamic
      final_value = $game_actors[actor_id].base_agi
      final_value += ($game_actors[actor_id].base_agi * percent).round
      return final_value
    end
    return enemy.agi
  end
  #--------------------------------------------------------------------------
end
« Last Edit: September 09, 2012, 08:42:36 PM by Pacman »

*
*crack*
Rep:
Level 64
2012 Best Newbie2012 Most Unsung MemberFor frequently finding and reporting spam and spam bots
You input the data into the enemy noteboxes

Spoiler for:

And the changes you want to make are not made with actors names, but instead with their id.
So Ralph would be 1, next actor would be 2...and so on.
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

**
Rep: +0/-0Level 73
RMRK Junior
A field of thanks for your reply. Only... I'm using XP. Is there anyway that this script can be utilized without the 'note' box?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
No. That's a VX script. It only works in VX.

Unfortunately, I am not familiar enough with the available XP scripts to know if there is a similar one written for RMXP. A quick search got me this: http://z11.invisionfree.com/RMXP_Ultimate/index.php?showtopic=752

But it doesn't seem as customizable as this script.
« Last Edit: September 09, 2012, 08:57:56 PM by modern algebra »