xxultimaxx
Member-
Content Count
36 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Downloads
Calendar
Gallery
Everything posted by xxultimaxx
-
So I wanted to try my hand at making an Element script, but I am having a problem. Let me explain: I created an event that calls $scene = Scene_Gem.new So, my scene runs... no problem there. Now, I am expecting certain values to be set when I enter Window_Gems and select the empty index; that is, for the values @original_gem and @new_gem to remain equaling zero. But, alas, this is not the case... I set $game_variables[1] = @original_gem and $game_variables[2] = @new_gem to determine the values, and for some reason, I get variable 1 = 9 and variable 2 = 4. I am pasting the script below, and if anyone could fill me in on the problem, that would be awesome! btw... I know the coding is hideous, but it is most definitely a WIP.
-
I found a script that incorporates Weapon Gems here: Weapon Temp and Aug Not exactly sure if this is exactly what you need, though. It seems to focus heavily on weapons and not on armors. I may attempt to make a modified script that more closely matches your post description. I use the word may because I am not the greatest scripter, but when I was thinking about how to construct this script, I seemed to be on pretty much the same track as the linked script. Anyway, I will do my best!
-
[mod] Every actor any enemy recovers 1 MP every turn
xxultimaxx replied to sournote103's topic in Requests
I came up with a script that should help you. I made it so that you could define which Actor should gain how much SP when the Actor Command Window appears. So, if you just want the one SP to be gained, you can set it at that. If you ever change your mind though and wish for more to be gained, you will be covered : ) Hope it works well for you, and if there are any issues, just let me know. I just re-read your post and noticed you also wanted the enemies to gain SP as well. Whoops, my bad! Okay, I think this is more what you were looking for. -
I may be able to help if I can understand exactly where these pictures need to be. Could you explain in more detail or perhaps provide an image?
-
If you go to the << Additional Scripts >> section, locate the Battle Windows script. Now, change Line 13 to: Display_Type = 2. This will allow you to set custom positions for the actors' battler information. Next, go to Line 47 and make your edits. E.g. Custom_Stat_Position = [[0,0],[100,0],[200,0],[300,0],[400,0],[500,0]] You have six actors, so you need six x/y coordinates in the array ([x,y]). You can play around with the positioning to get it like you want it. Hope this helps : ) If you need further explanation, just let me know.
-
Thank you so much, kellessdee! That works perfectly : ) I really appreciate the help. I completely overlooked the fact that the Game_Actor class fell under Game_Battler… doh! And I will definitely take your advice on the coding. I am always looking for constructive feedback so that I can be better, and I value the comments you left. Thanks again!
-
Thanks for the reply, kellessdee : ) I thought of hard coding in Scene_Title, but to no avail. If I do that for, say .str_plus, it works perfectly and modifies, but not so for .luck. I am wondering if I am missing something when it comes to attaching the luck attribute to the Actor. I am trying to model it after the eva attribute. Let me explain what happens and then I will paste the script I'm working on. If I run the script in a default project, I get the error: 'nil can't be coerced to Fixnum'. So, I figure if I add an attr_accessor :luck to Game_Actor and set it in setup, I'll have a number. Well, I do, and the game does not give me an error, but the luck attribute is not modified when attempting to equip. All the other attributes work fine, though. Maybe I am overlooking something completely obvious or there is an easy fix; not sure. class Window_EquipLeft < Window_Base alias old_refresh refresh alias old_set_new_parameters set_new_parameters def refresh self.contents.clear draw_actor_name(@actor, 4, 0) if @new_atk != nil self.contents.font.color = text_color(0) self.contents.draw_text(4,32,80,32,"ATK") if @new_atk > @actor.atk self.contents.font.color = text_color(6) elsif @new_atk < @actor.atk self.contents.font.color = text_color(2) else self.contents.font.color = text_color(0) end self.contents.draw_text(30,32,80,32, @new_atk.to_s, 2) else self.contents.font.color = text_color(0) self.contents.draw_text(4,32,80,32,"ATK") self.contents.draw_text(30,32,80,32,@actor.atk.to_s,2) end if @new_pdef != nil self.contents.font.color = text_color(0) self.contents.draw_text(4,64,80,32,"PDEF") if @new_pdef > @actor.pdef self.contents.font.color = text_color(6) elsif @new_pdef < @actor.pdef self.contents.font.color = text_color(2) else self.contents.font.color = text_color(0) end self.contents.draw_text(30,64,80,32,@new_pdef.to_s,2) else self.contents.font.color = text_color(0) self.contents.draw_text(4,64,80,32,"PDEF") self.contents.draw_text(30,64,80,32,@actor.pdef.to_s,2) end if @new_mdef != nil self.contents.font.color = text_color(0) self.contents.draw_text(4,96,80,32,"MDEF") if @new_mdef > @actor.mdef self.contents.font.color = text_color(6) elsif @new_mdef < @actor.mdef self.contents.font.color = text_color(2) else self.contents.font.color = text_color(0) end self.contents.draw_text(30,96,80,32,@new_mdef.to_s,2) else self.contents.font.color = text_color(0) self.contents.draw_text(4,96,80,32,"MDEF") self.contents.draw_text(30,96,80,32,@actor.mdef.to_s,2) end if @new_str != nil self.contents.font.color = text_color(0) self.contents.draw_text(134,0,80,32,"STR") if @new_str > @actor.str self.contents.font.color = text_color(6) elsif @new_str < @actor.str self.contents.font.color = text_color(2) else self.contents.font.color = text_color(0) end self.contents.draw_text(160,0,80,32,@new_str.to_s,2) else self.contents.font.color = text_color(0) self.contents.draw_text(134,0,80,32,"STR") self.contents.draw_text(160,0,80,32,@actor.str.to_s,2) end if @new_dex != nil self.contents.font.color = text_color(0) self.contents.draw_text(134,32,80,32,"DEX") if @new_dex > @actor.dex self.contents.font.color = text_color(6) elsif @new_dex < @actor.dex self.contents.font.color = text_color(2) else self.contents.font.color = text_color(0) end self.contents.draw_text(160,32,80,32,@new_dex.to_s,2) else self.contents.font.color = text_color(0) self.contents.draw_text(134,32,80,32,"DEX") self.contents.draw_text(160,32,80,32,@actor.dex.to_s,2) end if @new_agi != nil self.contents.font.color = text_color(0) self.contents.draw_text(134,64,80,32,"AGI") if @new_agi > @actor.agi self.contents.font.color = text_color(6) elsif @new_agi < @actor.agi self.contents.font.color = text_color(2) else self.contents.font.color = text_color(0) end self.contents.draw_text(160,64,80,32,@new_agi.to_s,2) else self.contents.font.color = text_color(0) self.contents.draw_text(134,64,80,32,"AGI") self.contents.draw_text(160,64,80,32,@actor.agi.to_s,2) end if @new_int != nil self.contents.font.color = text_color(0) self.contents.draw_text(134,96,80,32,"INT") if @new_int > @actor.int self.contents.font.color = text_color(6) elsif @new_int < @actor.int self.contents.font.color = text_color(2) else self.contents.font.color = text_color(0) end self.contents.draw_text(160,96,80,32,@new_int.to_s,2) else self.contents.font.color = text_color(0) self.contents.draw_text(134,96,80,32,"INT") self.contents.draw_text(160,96,80,32,@actor.int.to_s,2) end if @new_eva != nil self.contents.font.color = text_color(0) self.contents.draw_text(134,128,80,32,"EVA") if @new_eva > @actor.eva self.contents.font.color = text_color(6) elsif @new_eva < @actor.eva self.contents.font.color = text_color(2) else self.contents.font.color = text_color(0) end self.contents.draw_text(160,128,80,32,@new_eva.to_s,2) else self.contents.font.color = text_color(0) self.contents.draw_text(134,128,80,32,"EVA") self.contents.draw_text(160,128,80,32,@actor.eva.to_s,2) end if @new_luck != nil self.contents.font.color = text_color(0) self.contents.draw_text(4,128,80,32,"LUCK") if @new_luck > @actor.luck self.contents.font.color = text_color(6) elsif @new_luck < @actor.luck self.contents.font.color = text_color(2) else self.contents.font.color = text_color(0) end self.contents.draw_text(30,128,80,32,@new_luck.to_s,2) else self.contents.font.color = text_color(0) self.contents.draw_text(4,128,80,32,"LUCK") self.contents.draw_text(30,128,80,32,@actor.luck.to_s,2) end end def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int, new_eva, new_luck) if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or @new_str != new_str or @new_dex != new_dex or @new_agi != new_agi or @new_int != new_int or @new_eva != new_eva or @new_luck != new_luck @new_atk = new_atk @new_pdef = new_pdef @new_mdef = new_mdef @new_str = new_str @new_dex = new_dex @new_agi = new_agi @new_int = new_int @new_eva = new_eva @new_luck = new_luck refresh end end end class Scene_Equip alias old_refresh refresh def refresh @item_window1.visible = (@right_window.index == 0) @item_window2.visible = (@right_window.index == 1) @item_window3.visible = (@right_window.index == 2) @item_window4.visible = (@right_window.index == 3) @item_window5.visible = (@right_window.index == 4) item1 = @right_window.item case @right_window.index when 0 @item_window = @item_window1 when 1 @item_window = @item_window2 when 2 @item_window = @item_window3 when 3 @item_window = @item_window4 when 4 @item_window = @item_window5 end if @right_window.active @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil, nil) end if @item_window.active item2 = @item_window.item last_hp = @actor.hp last_sp = @actor.sp @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id) new_atk = @actor.atk new_pdef = @actor.pdef new_mdef = @actor.mdef new_str = @actor.str new_dex = @actor.dex new_agi = @actor.agi new_int = @actor.int new_eva = @actor.eva new_luck = @actor.luck @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id) @actor.hp = last_hp @actor.sp = last_sp @left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int, new_eva, new_luck) end end end module RPG class Weapon alias old_initialize initialize def initialize old_initialize @luck = 0 end attr_accessor :id attr_accessor :name attr_accessor :icon_name attr_accessor :description attr_accessor :animation1_id attr_accessor :animation2_id attr_accessor :price attr_accessor :atk attr_accessor :pdef attr_accessor :mdef attr_accessor :str_plus attr_accessor :dex_plus attr_accessor :agi_plus attr_accessor :int_plus attr_accessor :element_set attr_accessor :plus_state_set attr_accessor :minus_state_set attr_accessor :luck end end module RPG class Armor alias old_initialize initialize def initialize old_initialize @luck = 0 end attr_accessor :id attr_accessor :name attr_accessor :icon_name attr_accessor :description attr_accessor :kind attr_accessor :auto_state_id attr_accessor :price attr_accessor :pdef attr_accessor :mdef attr_accessor :eva attr_accessor :str_plus attr_accessor :dex_plus attr_accessor :agi_plus attr_accessor :int_plus attr_accessor :guard_element_set attr_accessor :guard_state_set attr_accessor :luck end end class Game_Battler def luck n = base_luck return n end end class Game_Actor < Game_Battler def base_luck weapon = $data_weapons[@weapon_id] armor1 = $data_armors[@armor1_id] armor2 = $data_armors[@armor2_id] armor3 = $data_armors[@armor3_id] armor4 = $data_armors[@armor4_id] luck1 = weapon != nil ? weapon.luck : 0 luck2 = armor1 != nil ? armor1.luck : 0 luck3 = armor2 != nil ? armor2.luck : 0 luck4 = armor3 != nil ? armor3.luck : 0 luck5 = armor4 != nil ? armor4.luck : 0 return luck1 + luck2 + luck3 + luck4 + luck5 end end class Scene_Title alias old_main main def main if $BTEST battle_test return end $data_actors = load_data("Data/Actors.rxdata") $data_classes = load_data("Data/Classes.rxdata") $data_skills = load_data("Data/Skills.rxdata") $data_items = load_data("Data/Items.rxdata") $data_weapons = load_data("Data/Weapons.rxdata") $data_armors = load_data("Data/Armors.rxdata") $data_enemies = load_data("Data/Enemies.rxdata") $data_troops = load_data("Data/Troops.rxdata") $data_states = load_data("Data/States.rxdata") $data_animations = load_data("Data/Animations.rxdata") $data_tilesets = load_data("Data/Tilesets.rxdata") $data_common_events = load_data("Data/CommonEvents.rxdata") $data_system = load_data("Data/System.rxdata") $data_weapons[1].luck = 6 $game_system = Game_System.new @sprite = Sprite.new @sprite.bitmap = RPG::Cache.title($data_system.title_name) s1 = "New Game" s2 = "Continue" s3 = "Shutdown" @command_window = Window_Command.new(192, [s1, s2, s3]) @command_window.back_opacity = 160 @command_window.x = 320 - @command_window.width / 2 @command_window.y = 288 @continue_enabled = false for i in 0..3 if FileTest.exist?("Save#{i+1}.rxdata") @continue_enabled = true end end if @continue_enabled @command_window.index = 1 else @command_window.disable_item(1) end $game_system.bgm_play($data_system.title_bgm) Audio.me_stop Audio.bgs_stop Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @command_window.dispose @sprite.bitmap.dispose @sprite.dispose end end class Game_Actor < Game_Battler alias old_setup setup def setup(actor_id) old_setup(actor_id) @luck = 0 end attr_reader :name attr_reader :character_name attr_reader :character_hue attr_reader :class_id attr_reader :weapon_id attr_reader :armor1_id attr_reader :armor2_id attr_reader :armor3_id attr_reader :armor4_id attr_reader :level attr_reader :exp attr_reader :skills attr_accessor :luck end Also, I am new at posting, so if anyone knows how to add a spoiler to the code that would be great. Thanks again for any insight!
-
How to change the position of Battler Graphic in a Battle?
xxultimaxx replied to tezu97's question in Support
Basically, you will want to get into your scripts and locate Game_Actor. Towards the bottom, you should see def screen_x. def screen_x # Return after calculating x-coordinate by order of members in party if self.index != nil return self.index * 160 + 80 else return 0 end end The part that says return self.index * 160 + 80 sets the actor's x-coordinate battle position. So if you have just the one actor as in your picture, you could just modify the number after the plus sign. e.g. return self.index * 160 + 200 -
I have been trying to make a Luck attribute for my game. I would like to have the attribute tied to the Actors, Weapons & Armors. I seem to be having success with creating it for the Actors, but not so sure about the Weapons & Armors. I attempted to alias the Modules for Weapon and Armor to include the stat, but I'm not sure if it applied. Here is basically what I am trying to do: When you call Scene_Equip, I modified what information is passed to set_new_parameters. def refresh # Set item window to visible @item_window1.visible = (@right_window.index == 0) @item_window2.visible = (@right_window.index == 1) @item_window3.visible = (@right_window.index == 2) @item_window4.visible = (@right_window.index == 3) @item_window5.visible = (@right_window.index == 4) # Get currently equipped item item1 = @right_window.item # Set current item window to @item_window case @right_window.index when 0 @item_window = @item_window1 when 1 @item_window = @item_window2 when 2 @item_window = @item_window3 when 3 @item_window = @item_window4 when 4 @item_window = @item_window5 end # If right window is active if @right_window.active # Erase parameters for after equipment change @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil, nil) end # If item window is active if @item_window.active # Get currently selected item item2 = @item_window.item # Change equipment last_hp = @actor.hp last_sp = @actor.sp @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id) # Get parameters for after equipment change new_atk = @actor.atk new_pdef = @actor.pdef new_mdef = @actor.mdef new_str = @actor.str new_dex = @actor.dex new_agi = @actor.agi new_int = @actor.int new_eva = @actor.eva new_luck = @actor.luck # Return equipment @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id) @actor.hp = last_hp @actor.sp = last_sp # Draw in left window @left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int, new_eva, new_luck) end end Now in the EquipLeft window, I modified it to show all the stats (not just the two are three that were default) and to show increases or decreases in each attribute through color changes to the stats, depending on the weapon/armor in the @item_window. #============================================================================== # ** Window_EquipLeft #------------------------------------------------------------------------------ # This window displays actor parameter changes on the equipment screen. #============================================================================== class Window_EquipLeft < Window_Base #-------------------------------------------------------------------------- # * Object Initialization # actor : actor #-------------------------------------------------------------------------- def initialize(actor) super(0, 64, 272, 192) self.contents = Bitmap.new(width - 32, height - 32) @actor = actor refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear draw_actor_name(@actor, 4, 0) if @new_atk != nil self.contents.font.color = text_color(0) self.contents.draw_text(4,32,80,32,"ATK") if @new_atk > @actor.atk self.contents.font.color = text_color(6) elsif @new_atk < @actor.atk self.contents.font.color = text_color(2) else self.contents.font.color = text_color(0) end self.contents.draw_text(30,32,80,32, @new_atk.to_s, 2) else self.contents.font.color = text_color(0) self.contents.draw_text(4,32,80,32,"ATK") self.contents.draw_text(30,32,80,32,@actor.atk.to_s,2) end if @new_pdef != nil self.contents.font.color = text_color(0) self.contents.draw_text(4,64,80,32,"PDEF") if @new_pdef > @actor.pdef self.contents.font.color = text_color(6) elsif @new_pdef < @actor.pdef self.contents.font.color = text_color(2) else self.contents.font.color = text_color(0) end self.contents.draw_text(30,64,80,32,@new_pdef.to_s,2) else self.contents.font.color = text_color(0) self.contents.draw_text(4,64,80,32,"PDEF") self.contents.draw_text(30,64,80,32,@actor.pdef.to_s,2) end if @new_mdef != nil self.contents.font.color = text_color(0) self.contents.draw_text(4,96,80,32,"MDEF") if @new_mdef > @actor.mdef self.contents.font.color = text_color(6) elsif @new_mdef < @actor.mdef self.contents.font.color = text_color(2) else self.contents.font.color = text_color(0) end self.contents.draw_text(30,96,80,32,@new_mdef.to_s,2) else self.contents.font.color = text_color(0) self.contents.draw_text(4,96,80,32,"MDEF") self.contents.draw_text(30,96,80,32,@actor.mdef.to_s,2) end if @new_str != nil self.contents.font.color = text_color(0) self.contents.draw_text(134,0,80,32,"STR") if @new_str > @actor.str self.contents.font.color = text_color(6) elsif @new_str < @actor.str self.contents.font.color = text_color(2) else self.contents.font.color = text_color(0) end self.contents.draw_text(160,0,80,32,@new_str.to_s,2) else self.contents.font.color = text_color(0) self.contents.draw_text(134,0,80,32,"STR") self.contents.draw_text(160,0,80,32,@actor.str.to_s,2) end if @new_dex != nil self.contents.font.color = text_color(0) self.contents.draw_text(134,32,80,32,"DEX") if @new_dex > @actor.dex self.contents.font.color = text_color(6) elsif @new_dex < @actor.dex self.contents.font.color = text_color(2) else self.contents.font.color = text_color(0) end self.contents.draw_text(160,32,80,32,@new_dex.to_s,2) else self.contents.font.color = text_color(0) self.contents.draw_text(134,32,80,32,"DEX") self.contents.draw_text(160,32,80,32,@actor.dex.to_s,2) end if @new_agi != nil self.contents.font.color = text_color(0) self.contents.draw_text(134,64,80,32,"AGI") if @new_agi > @actor.agi self.contents.font.color = text_color(6) elsif @new_agi < @actor.agi self.contents.font.color = text_color(2) else self.contents.font.color = text_color(0) end self.contents.draw_text(160,64,80,32,@new_agi.to_s,2) else self.contents.font.color = text_color(0) self.contents.draw_text(134,64,80,32,"AGI") self.contents.draw_text(160,64,80,32,@actor.agi.to_s,2) end if @new_int != nil self.contents.font.color = text_color(0) self.contents.draw_text(134,96,80,32,"INT") if @new_int > @actor.int self.contents.font.color = text_color(6) elsif @new_int < @actor.int self.contents.font.color = text_color(2) else self.contents.font.color = text_color(0) end self.contents.draw_text(160,96,80,32,@new_int.to_s,2) else self.contents.font.color = text_color(0) self.contents.draw_text(134,96,80,32,"INT") self.contents.draw_text(160,96,80,32,@actor.int.to_s,2) end if @new_eva != nil self.contents.font.color = text_color(0) self.contents.draw_text(134,128,80,32,"EVA") if @new_eva > @actor.eva self.contents.font.color = text_color(6) elsif @new_eva < @actor.eva self.contents.font.color = text_color(2) else self.contents.font.color = text_color(0) end self.contents.draw_text(160,128,80,32,@new_eva.to_s,2) else self.contents.font.color = text_color(0) self.contents.draw_text(134,128,80,32,"EVA") self.contents.draw_text(160,128,80,32,@actor.eva.to_s,2) end if @new_luck != nil self.contents.font.color = text_color(0) self.contents.draw_text(4,128,80,32,"LUCK") if @new_luck > @actor.luck self.contents.font.color = text_color(6) elsif @new_luck < @actor.luck self.contents.font.color = text_color(2) else self.contents.font.color = text_color(0) end self.contents.draw_text(30,128,80,32,@new_luck.to_s,2) else self.contents.font.color = text_color(0) self.contents.draw_text(4,128,80,32,"LUCK") draw_actor_luck(@actor,-10,128) end end #-------------------------------------------------------------------------- # * Set parameters after changing equipment # new_atk : attack power after changing equipment # new_pdef : physical defense after changing equipment # new_mdef : magic defense after changing equipment #-------------------------------------------------------------------------- def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int, new_eva, new_luck) if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or @new_str != new_str or @new_dex != new_dex or @new_agi != new_agi or @new_int != new_int or @new_eva != new_eva or @new_luck != new_luck @new_atk = new_atk @new_pdef = new_pdef @new_mdef = new_mdef @new_str = new_str @new_dex = new_dex @new_agi = new_agi @new_int = new_int @new_eva = new_eva @new_luck = new_luck refresh end end end So basically, I would like to figure out how to set it up so that the Luck attribute completely mimics all the other attributes (e.g. str, mdef, eva, etc...). Thanks to anyone that can help!