Jump to content

WCouillard

Member
  • Content Count

    1,232
  • Joined

  • Last visited

  • Days Won

    4

WCouillard last won the day on May 27 2019

WCouillard had the most liked content!

1 Follower

About WCouillard

  • Rank
    Sanubian Menace
  • Birthday 08/15/1982

Profile Information

  • Gender
    Male

RPG Maker Information

  • RM Skill -
    Jack of All Trades

Recent Profile Visitors

9,908 profile views
  1. WCouillard

    Help request for Effects Box script

    So far, it is returning an error on line 113 citing an undefined method for "each_with_index" EDIT: I believe I fixed that problem, I'll let you know if any issues pop up. Thank you for your help!
  2. Hi, all! I am using a script by Neon Black that allows the user to input notes on items, skills, gear, etc. to give more detailed information about the particular items. However, it seems the script is not functioning the way the author intended. What is happening is that all of the item's note contents are being displayed, rather than just what is between the specified tag that the script should be reading. What this is doing is causing an extreme amount of lag when it is loading every single note box from every single item, even ones that do not have notes in the tag from the script. As the player gains more items, gear and skills, the lag gets increasingly worse, until even scrolling through windows is nearly impossible. Can anyone help me fix this script by making it... - Only load the information inside the tags - Only load the information the item in question has the tag to begin with? - Only load the information of the item being viewed (you press a button to bring up the effects box window) ##----------------------------------------------------------------------------## ## Effects Box Script v1.0 ## Created by Neon Black ## ## For both commercial and non-commercial use as long as credit is given to ## Neon Black and any additional authors. Licensed under Creative Commons ## CC BY 3.0 - http://creativecommons.org/licenses/by/3.0/. ##----------------------------------------------------------------------------## ## ##----------------------------------------------------------------------------## ## Revision Info: ## v1.0 - 3.3.2013 ## Wrote and debugged main script ##----------------------------------------------------------------------------## ## $imported ||= {} ## $imported["EFFECTS_BOX"] = 1.0 ## ## ##----------------------------------------------------------------------------## ## Instructions: ## Place this script in the script editor below "Materials" and above "Main". ## This script requires Neon Black's Features and Effects name module. You can ## obtain it from http://cphouseset.wordpress.com/modules/. If you do not ## import it, you will get errors. ## ## This script is plug and play. It allows a pop-up boxes to display on equips, ## items, and skills. You can choose to have these pop-ups be constant, toggle ## with a button press, or only appear while a key is held down. These display ## 3 bits of information. First an added note, second all the stats equipping ## the item will provide, and finally all the effects or features of the item. ## A note can be added using <effect note> and </effect note> and placing your ## note in between those tags, like so: ## ## <effect note> ## This will display line 1 ## This will display line 2 ## </effect note> ## ##----------------------------------------------------------------------------## ## module CP # Do not touch ## module EFFECTS_WINDOW # these lines. ## ##----------------------------------------------------------------------------## ## Config: ## The config options are below. You can set these depending on the flavour of ## your game. Each option is explained in a bit more detail above it. ## ##------ # This is the padding around the edges of the box. Increasing this number will # increase the size of the box without increasing the size of it's contents. EDGES = 6 # This is the font size of the pop up's text. Adjusting this affects the entire # box's size. FONT_SIZE = 20 # Choose to use font shadow or outlines. SHADOW = false OUTLINE = false # If this value is set to false, stats will not be shown on equips. SHOW_STATS = false # The key to press to toggle or show the box. BOX_KEY = :Z # The show type for the pop-up box. Any value other than these three will # prevent the box from being show. # 0 = Hold button to display the box. # 1 = Press button to toggle the box. # 2 = The box is constantly show. SHOW_TYPE = 0 # If type 2 was selected above, this is the default state of the box. Set it to # true to show the box or false to hide the box until the key is pressed. @show = false ##----------------------------------------------------------------------------## ## ## ##----------------------------------------------------------------------------## ## The following lines are the actual core code of the script. While you are ## certainly invited to look, modifying it may result in undesirable results. ## Modify at your own risk! ###---------------------------------------------------------------------------- def self.toggle_effects @show = !@show if Input.trigger?(BOX_KEY) return @show end end end module SceneManager class << self alias :cp_rshp_run :run unless method_defined?(:cp_rshp_run) end def self.run cp_module_check_features cp_rshp_run end def self.cp_module_check_features return if $imported["CP_FEATURES_EFFECTS"] a1 = "One or more scripts require Neon Black's Features and Effects module." a2 = "This can be obtained at http://cphouseset.wordpress.com/modules/" a3 = "Please add this module and try again." a4 = "Please contact the creator of the game to resolve this issue." if $TEST || $BTEST msgbox "#{a1}/n#{a2}/n#{a3}" Thread.new{system("start http://cphouseset.wordpress.com/modules/#features")} else msgbox "#{a1}/n#{a4}" end end end class Window_Selectable < Window_Base def item return nil end alias :cp_itembox_update :update def update(*args) cp_itembox_update(*args) show_fet_window end def show_fet_window key = key_show_features_box show_feature_box if key && active && open? remove_feature_box unless key && active && open? end def key_show_features_box case CP::EFFECTS_WINDOW::SHOW_TYPE when 0 return Input.press?(CP::EFFECTS_WINDOW::BOX_KEY) when 1 return CP::EFFECTS_WINDOW.toggle_effects when 2 return true else return false end end def show_feature_box ## Creates the box if "A" key is held if item != @last_box_item if feature_box_item? @feature_box.dispose unless @feature_box.nil? rect = item_rect(@index) x = rect.x + self.x + padding + 24 - ox y = rect.y + line_height + self.y + padding - oy - 2 @feature_box = Window_FeaturesShow.new(item, x, y, self) @last_box_item = item else remove_feature_box end end end def feature_box_item? item.is_a?(RPG::EquipItem) || item.is_a?(RPG::UsableItem) end def remove_feature_box ## Dispose the box. @feature_box.dispose unless @feature_box.nil? @feature_box = nil @last_box_item = nil end end class Window_FeaturesShow < Window_Base def initialize(item, x, y, parent) @parent = parent @bx = x; @by = y @item = item super(0, 0, 500, 500) self.z = @parent.z + 500 self.windowskin = Cache.system(($game_system.windowskin)) self.opacity = 255 self.back_opacity = 255 self.tone = Tone.new make_width make_height make_position draw_all_items end def make_width contents.font.size = line_height contents.font.outline = CP::EFFECTS_WINDOW::OUTLINE contents.font.shadow = CP::EFFECTS_WINDOW::SHADOW i = 120 unless notes.empty? i = [i, notes.collect{|n| contents.text_size(n).width}.max + 2].max end self.width = i + standard_padding * 2 end def make_height sw = self.width - standard_padding * 2 i = standard_padding * 2 i += notes.size * line_height i += seps * line_height / 2 self.height = i self.visible = false if i == standard_padding * 2 create_contents contents.font.size = line_height contents.font.outline = false contents.font.shadow = false change_color(normal_color) end def make_position self.x = @bx + self.width > Graphics.width ? Graphics.width - self.width : @bx self.y = @by + self.height <= Graphics.height ? @by : @by - self.height - @parent.line_height + 4 > 0 ? @by - self.height - @parent.line_height + 4 : Graphics.height - self.height end def standard_padding CP::EFFECTS_WINDOW::EDGES end def line_height 24 end def seps i = -1 i += 1 unless notes.empty? return [i, 0].max end def stats return [] unless CP::EFFECTS_WINDOW::SHOW_STATS && @item.is_a?(RPG::EquipItem) r = [] 8.times do |i| next if @item.params[i] == 0 r.push("#{Vocab.param(i)} #{@item.params[i]}") end return r end def notes @item.effect_desc end def effects if @item.is_a?(RPG::EquipItem) @item.features elsif @item.is_a?(RPG::UsableItem) @item.effects end end def draw_all_items contents.clear y = 0 notes.each do |l| draw_text(1, y, contents.width, line_height, l) y += line_height end end end class RPG::BaseItem def effect_desc make_effect_desc if @effect_desc.nil? return @effect_desc end def make_effect_desc @effect_desc = [] noted = false self.note.split(/[\r\n]+/i).each do |line| case line when /<effect note>/i noted = true when /<\/effect note>/i break else @effect_desc.push("#{line}") end end end end ###--------------------------------------------------------------------------### # End of script. # ###--------------------------------------------------------------------------###
  3. Create a copy of Window.png in your game’s folder and name it Window_Enemy.png This script meant to be used alongside An active battle system, you may encounter other issues in the default battle system. I’ll try to help with any incompatibilities, though.
  4. I am trying to create a quick script to display the turn count in battle, and have it update when a turn ends. However, I can't seem to find any actual turn count stored in the default scripts anywhere, other than increasing turn counts for States only. Enemy battle AI can be dependent on turn count, so it must be stored somewhere. Can someone point me in the right direction?
  5. All of the states I want to hide have 0 priority set and a blank icon, so this should work fine, right?
  6. Script updated to v2.05 - Fixes a bug that was drawing blank icons on skills with icon ID 0, when it should have been ignoring them. - Cleaned up redundant code.
  7. Any idea where I'd put that? I have tried a few things and keep getting crashes. Clearly, I'm getting the syntax wrong. This is the one way I have it written where it doesn't crash, but I'd need to test more to make sure it's working. def draw_actor_battle_icons(actor, x, y, width = 144) icons = (actor.state_icons + actor.buff_icons)[0, width / 24] icons.each_with_index {|n, i| unless n == 0 draw_icon(n, x + 24 * i, y) end } end EDIT: OK, that seems to be helping with the lag a little bit. Now, is there something I can add that tells this method to only draw up to let's say, four or five icons at any time for an actor?
  8. OK, so I have another issue. This is just a QoL thing to alleviate what I believe to be the cause of some lag. Actors state icons being drawn in battle still draw an icon when that state's icon ID is 0 (a blank icon). I am trying to only show the icons of states that actually have one. Characters in my game can have many, many states applied at once, passively and I believe it's causing a bit of slowdown in fights. def draw_actor_battle_icons(actor, x, y, width = 144) icons = (actor.state_icons + actor.buff_icons)[0, width / 24] icons.each_with_index {|n, i| draw_icon(n, x + 24 * i, y) } end So I cloned the method that does just that, but I am looking for a way to eliminate any state icons that return 0 from this. I expect that "n" is what refers to the icon ID?
  9. Working fine, but it seems like maybe it's working the old way for enemies? Is there somewhere else I might have to change that code that I changed? Just seems like enemies with an ATK buff are hitting for insane damage, but it could just be me.
  10. LOL, I had this exact line hours ago but it was "ft.value - 100" godddddddddddd I'm a fool. Thank you! :D
  11. This is exactly what I want to do when it concerns param increases only. The EX and SP parameters can be left alone. I am terrible with math-y things, it's confusing me more each time I mess with it. Anyone want to be a gem and help me achieve this? Param features (such as ATK * 180%) should increase the BASE param only by 80% of the base value (so really, it should be more like ATK + 80%). If TWO things are equipped that use this feature, it should add the bonuses together, not multiply them in order (as in ATK +80%, then NEW ATK VALUE + ATK +80%). def features_pi(code, id) features_with_id(code, id).inject(1.0) {|r, ft| r += ft.value } #WC end So when I change features_pi to do addition rather than multiplication... it is now giving +33 to a stat that has a base value of 30 when a 10% increase is applied. So it looks like it's giving it the 10% bonus (+3) as well as doubling the stat's base value (+30) for a total of +33. I thought maybe the 1.0 in the inject there was to blame, but changing it to 0.0 just made everyone's max stats a value of 1. *sigh*
  12. #============================================================================== # ** Scene_Load #------------------------------------------------------------------------------ # This class performs load screen processing. #============================================================================== class Scene_Load < Scene_File #-------------------------------------------------------------------------- # * Processing When Load Is Successful #-------------------------------------------------------------------------- alias coolie_on_load_success on_load_success def on_load_success coolie_on_load_success $game_switches[186] = false end end Paste this as a new script under Scene_Load and you should be A-OK. Just change the "186" I put in there to "138" or whatever switch you want to turn off/on.
  13. Is there a way for me to simply change this to not work this way, rather than use that other script? I have a lot of percentage stat increases locked behind character level (using Hime's Feature Conditions), so that script would likely create a bigger problem by not being able to control WHEN those stat increases would take effect (looks like the notetag will take effect upon equip with no other conditions allowed).
  14. OK, phew, this might be a long post. I am trying to change how the Feature for increasing or decreasing a parameter works. The feature being the one found in actors, classes, states, etc. I simply want it to only multiply the value by the BASE PARAMETER. Parameters increased from equipping gear (like a sword with +60 ATK) should not be considered in the equation. #-------------------------------------------------------------------------- # * Get Parameter #-------------------------------------------------------------------------- def param(param_id) value = param_base(param_id) + param_plus(param_id) value *= param_rate(param_id) * param_buff_rate(param_id) [[value, param_max(param_id)].min, param_min(param_id)].max.to_i end Here, in Game_BattlerBase, we see that is giving us the sum of the base parameter and the "param_plus." However, simply commenting out the param_plus part makes equipped gear no longer give any flat stats whatsoever. So I did this instead. #-------------------------------------------------------------------------- # * Get Parameter #-------------------------------------------------------------------------- def param(param_id) value = param_base(param_id) value *= param_rate(param_id) value += param_plus(param_id) [[value, param_max(param_id)].min, param_min(param_id)].max.to_i end I had no need of "buff rate" so that was also removed. OK, so now gear still gives the stats they are supposed to and the parameters should only be multiplying by the base parameter. Problem solved? I wish. OK, so I have an item that increases ATK by 3% (103% in the features tab). A character can equip four of these at the same time. Each one they equip, though, is giving slightly more ATK than the last one equipped (i.e. first one equipped is raising ATK by 3% of base value, let's say that equals 12. The next one equipped is increasing ATK by 13, then the next by 14, when all of them should be 12), even when the param formula is telling it to simply set the increase in ATK based only on the base parameter. This is what I cannot figure out. Why does it do this?
  15. It was a feature I was planning to add, but could never get it working correctly. Sadly, it probably won't happen unless someone more knowledgeable than me pulls it off. However, if I do get it working that way, I will be sure to update the script here.
×