|
  |
Improved command window, Shows an animated cursor instead of highlighting a row |
|
|
|
|
Dec 28 2008, 05:56 PM
|

No method: 'stupid_title' found for `nil:NilClass'

Group: Revolutionary
Posts: 1,829
Type: Scripter
RM Skill: Undisclosed

|
Improved Command Window By BigEd781 IntroductionThis script will change the appearance of all windows in game that present choices. This means any menu, the battle screen, etc. The game will no longer highlight the selected row. Instead, an animated cursor will appear next to the selected option. I recommend using this is conjunction with my Final Fantasy IX style menu. Features➮ 99% plug'n'play (you need to download an image). ➮ Looks cool! ScreenshotsAll cursors animate automatically. Just name an image "Pointer.png" (no quotes) and place it in your "\Graphics\Pictures" folder MenubattleDifferent CursorsConfiguration / UseJust place the script above in the "Materials" section. Download a cursor image (below), rename the one you want to use to " Pointer.png" (without the quotes) and place it in your game's " \Graphics\Pictures" folder.     ScriptDon't forget to download a cursor image  CODE =begin BigEd781's Improved Command Window =end
module EdsCursorConfig # image preferred size of 18x18 POINTER_NAME = 'Pointer' end
class Window_Selectable < Window_Base #-------------------------------------------------------------------------- # * initialize #-------------------------------------------------------------------------- alias :eds_pre_window_command_mod_initialize :initialize def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32) @arrow_image = Cache.picture(EdsCursorConfig::POINTER_NAME) @arrow_sprite = Sprite.new @arrow_sprite.bitmap = Bitmap.new(@arrow_image .width + 7, @arrow_image .height) @arrow_sprite.z = 999 @sprite_last_draw_x = 0 @sprite_inc_x = 1 @intern_frame_count = 0 @update_pointer = true eds_pre_window_command_mod_initialize(width, commands, column_max, row_max, spacing) end #-------------------------------------------------------------------------- # * dispose #-------------------------------------------------------------------------- def dispose super @arrow_sprite.dispose end #-------------------------------------------------------------------------- # * close #-------------------------------------------------------------------------- def close super @arrow_sprite.visible = false end #-------------------------------------------------------------------------- # * open #-------------------------------------------------------------------------- def open super @arrow_sprite.visible = true end #-------------------------------------------------------------------------- # * visible= #-------------------------------------------------------------------------- def visible=(value) super @arrow_sprite.visible = value ? (@index != -1) : value end #-------------------------------------------------------------------------- # * active= #-------------------------------------------------------------------------- def active=(value) super @update_pointer = value end #-------------------------------------------------------------------------- # * cursor_rect= (OVERWRITTEN) #-------------------------------------------------------------------------- def cursor_rect=(rect) offset_y = self.viewport.nil? ? 0 : self.viewport.rect.y offset_x = self.viewport.nil? ? 0 : self.viewport.rect.x - self.viewport.ox boost_y = @arrow_image.height >= 29 ? 0 : 29 - @arrow_image.height @arrow_sprite.x = 5 + rect.x + self.x - (@arrow_image.width / 2) + offset_x @arrow_sprite.y = rect.y + self.y + (@arrow_image.height / 2) + offset_y + boost_y end #-------------------------------------------------------------------------- # * update_cursor #-------------------------------------------------------------------------- alias :eds_pre_window_command_mod_update_cursor :update_cursor def update_cursor eds_pre_window_command_mod_update_cursor @intern_frame_count += 1 draw_pointer end #-------------------------------------------------------------------------- # * draw_pointer #-------------------------------------------------------------------------- def draw_pointer return unless @update_pointer return unless (@intern_frame_count % 5) == 0 @arrow_sprite.bitmap.clear return if @index == -1 if @sprite_last_draw_x == 7 @sprite_inc_x = -1 elsif @sprite_last_draw_x == 0 @sprite_inc_x = 1 end x = @sprite_last_draw_x + @sprite_inc_x @sprite_last_draw_x = x @arrow_sprite.bitmap.blt(x, 0, @arrow_image, @arrow_image.rect) end end
class Window_Item < Window_Selectable #-------------------------------------------------------------------------- # * active= #-------------------------------------------------------------------------- def active=(value) super @arrow_sprite.visible = value end end
class Window_Skill < Window_Selectable #-------------------------------------------------------------------------- # * active= #-------------------------------------------------------------------------- def active=(value) super @arrow_sprite.visible = value end end
class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # * cursor_rect= (OVERWRITTEN) #-------------------------------------------------------------------------- def cursor_rect=(rect) @arrow_sprite.x = rect.x + self.x - 16 @arrow_sprite.y = rect.y + self.y + 48 end #-------------------------------------------------------------------------- # * active= #-------------------------------------------------------------------------- def active=(value) super @arrow_sprite.visible = value end #-------------------------------------------------------------------------- # * update_cursor #-------------------------------------------------------------------------- alias :eds_pre_window_command_mod_stat_update_cursor :update_cursor def update_cursor eds_pre_window_command_mod_stat_update_cursor @intern_frame_count += 1 draw_pointer end end
class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # * start_main #-------------------------------------------------------------------------- alias :eds_pre_window_command_mod_start_main :start_main def start_main @party_command_window.visible = false @actor_command_window.visible = false eds_pre_window_command_mod_start_main end #-------------------------------------------------------------------------- # * start_party_command_selection #-------------------------------------------------------------------------- alias :eds_pre_window_command_mod_start_party_command_selection :start_party_command_selection def start_party_command_selection @party_command_window.visible = true eds_pre_window_command_mod_start_party_command_selection @actor_command_window.visible = false end #-------------------------------------------------------------------------- # * start_actor_command_selection #-------------------------------------------------------------------------- alias :eds_pre_window_command_mod_start_actor_command_selection :start_actor_command_selection def start_actor_command_selection @actor_command_window.visible = true eds_pre_window_command_mod_start_actor_command_selection @party_command_window.visible = false end end
class Window_Message < Window_Selectable #-------------------------------------------------------------------------- # * update_cursor #-------------------------------------------------------------------------- alias :eds_pre_window_command_mod_win_mes_update_cursor :update_cursor def update_cursor eds_pre_window_command_mod_win_mes_update_cursor @intern_frame_count += 1 draw_pointer end end Compatibility / BugsThis should be compatible with most scripts. As a lot is affected here (but not overwritten), there may be problems sometimes. If you find a bug, let me know how to reproduce it. If it is clashing with another script, let me know which script that is and provide a link or demo.
__________________________
` Give me teh codez!!! I am the master debator! 
|
|
|
|
|
|
|
|
|
Dec 28 2008, 07:02 PM
|

Level 8

Group: Revolutionary
Posts: 124
Type: Artist
RM Skill: Skilled

|
Amazing! I would probably use it, and create some new arrows if you don't mind. But overall, I'm quite fine with the highlight thing, Not saying yours isn't great, just saying I'm fine with the highlight system, Nice work again, and just wanted to say "First reply"!
__________________________
Current project: Silent Sword
Percentage 3.87%
Last worked on: 3/4/09
Plan: Remaking Silent Sword from scratch
|
|
|
|
|
|
|
|
|
Dec 28 2008, 07:12 PM
|

No method: 'stupid_title' found for `nil:NilClass'

Group: Revolutionary
Posts: 1,829
Type: Scripter
RM Skill: Undisclosed

|
EvilEagles: Use this script instead. It will be disabled on the title screen. CODE =begin BigEd781's Improved Command Window =end
module EdsCursorConfig # image preferred size of 18x18 POINTER_NAME = 'Pointer' end
class Window_Selectable < Window_Base #-------------------------------------------------------------------------- # * initialize #-------------------------------------------------------------------------- alias :eds_pre_window_command_mod_initialize :initialize def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32) @arrow_image = Cache.picture(EdsCursorConfig::POINTER_NAME) @arrow_sprite = Sprite.new @arrow_sprite.bitmap = Bitmap.new(@arrow_image .width + 7, @arrow_image .height) @arrow_sprite.z = 999 @sprite_last_draw_x = 0 @sprite_inc_x = 1 @intern_frame_count = 0 @update_pointer = true eds_pre_window_command_mod_initialize(width, commands, column_max, row_max, spacing) end #-------------------------------------------------------------------------- # * dispose #-------------------------------------------------------------------------- alias :eds_pre_window_command_mod_dispose :dispose def dispose eds_pre_window_command_mod_dispose @arrow_sprite.dispose end #-------------------------------------------------------------------------- # * close #-------------------------------------------------------------------------- alias :eds_pre_window_command_mod_close :close def close eds_pre_window_command_mod_close @arrow_sprite.visible = false end #-------------------------------------------------------------------------- # * open #-------------------------------------------------------------------------- alias :eds_pre_window_command_mod_open :open def open eds_pre_window_command_mod_open @arrow_sprite.visible = true end #-------------------------------------------------------------------------- # * visible= #-------------------------------------------------------------------------- def visible=(value) super @arrow_sprite.visible = value ? (@index != -1) : value end #-------------------------------------------------------------------------- # * active= #-------------------------------------------------------------------------- def active=(value) super @update_pointer = value end #-------------------------------------------------------------------------- # * cursor_rect= (OVERWRITTEN) #-------------------------------------------------------------------------- def cursor_rect=(rect) offset_y = self.viewport.nil? ? 0 : self.viewport.rect.y offset_x = self.viewport.nil? ? 0 : self.viewport.rect.x - self.viewport.ox boost_y = @arrow_image.height >= 29 ? 0 : 29 - @arrow_image.height @arrow_sprite.x = 5 + rect.x + self.x - (@arrow_image.width / 2) + offset_x @arrow_sprite.y = rect.y + self.y + (@arrow_image.height / 2) + offset_y + boost_y end #-------------------------------------------------------------------------- # * update_cursor #-------------------------------------------------------------------------- alias :eds_pre_window_command_mod_update_cursor :update_cursor def update_cursor eds_pre_window_command_mod_update_cursor @intern_frame_count += 1 draw_pointer end #-------------------------------------------------------------------------- # * draw_pointer #-------------------------------------------------------------------------- def draw_pointer return if $scene.is_a?(Scene_Title) return unless @update_pointer return unless (@intern_frame_count % 5) == 0 @arrow_sprite.bitmap.clear return if @index == -1 if @sprite_last_draw_x == 7 @sprite_inc_x = -1 elsif @sprite_last_draw_x == 0 @sprite_inc_x = 1 end x = @sprite_last_draw_x + @sprite_inc_x @sprite_last_draw_x = x @arrow_sprite.bitmap.blt(x, 0, @arrow_image, @arrow_image.rect) end end
class Window_Item < Window_Selectable #-------------------------------------------------------------------------- # * active= #-------------------------------------------------------------------------- def active=(value) super @arrow_sprite.visible = value end end
class Window_Skill < Window_Selectable #-------------------------------------------------------------------------- # * active= #-------------------------------------------------------------------------- def active=(value) super @arrow_sprite.visible = value end end
class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # * cursor_rect= (OVERWRITTEN) #-------------------------------------------------------------------------- def cursor_rect=(rect) @arrow_sprite.x = rect.x + self.x - 16 @arrow_sprite.y = rect.y + self.y + 48 end #-------------------------------------------------------------------------- # * active= #-------------------------------------------------------------------------- def active=(value) super @arrow_sprite.visible = value end #-------------------------------------------------------------------------- # * update_cursor #-------------------------------------------------------------------------- alias :eds_pre_window_command_mod_stat_update_cursor :update_cursor def update_cursor eds_pre_window_command_mod_stat_update_cursor @intern_frame_count += 1 draw_pointer end end
class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # * start_main #-------------------------------------------------------------------------- alias :eds_pre_window_command_mod_start_main :start_main def start_main @party_command_window.visible = false @actor_command_window.visible = false eds_pre_window_command_mod_start_main end #-------------------------------------------------------------------------- # * start_party_command_selection #-------------------------------------------------------------------------- alias :eds_pre_window_command_mod_start_party_command_selection :start_party_command_selection def start_party_command_selection @party_command_window.visible = true eds_pre_window_command_mod_start_party_command_selection @actor_command_window.visible = false end #-------------------------------------------------------------------------- # * start_actor_command_selection #-------------------------------------------------------------------------- alias :eds_pre_window_command_mod_start_actor_command_selection :start_actor_command_selection def start_actor_command_selection @actor_command_window.visible = true eds_pre_window_command_mod_start_actor_command_selection @party_command_window.visible = false end end
class Window_Message < Window_Selectable #-------------------------------------------------------------------------- # * update_cursor #-------------------------------------------------------------------------- alias :eds_pre_window_command_mod_win_mes_update_cursor :update_cursor def update_cursor eds_pre_window_command_mod_win_mes_update_cursor @intern_frame_count += 1 draw_pointer end end
__________________________
` Give me teh codez!!! I am the master debator! 
|
|
|
|
|
|
|
|
|
Dec 28 2008, 08:01 PM
|
Level 5

Group: Member
Posts: 64
Type: None
RM Skill: Undisclosed

|
wii this looks really nice, just a question if i make the window opacity = 0 the cursor will be visible?
|
|
|
|
|
|
|
|
|
Dec 28 2008, 08:03 PM
|

No method: 'stupid_title' found for `nil:NilClass'

Group: Revolutionary
Posts: 1,829
Type: Scripter
RM Skill: Undisclosed

|
QUOTE (Chronno @ Dec 28 2008, 08:01 PM)  wii this looks really nice, just a question if i make the window opacity = 0 the cursor will be visible? Yes, it will. QUOTE (Canuck @ Dec 28 2008, 07:51 PM)  My only complaint is that the arrows seem rather unnatural with the background. Perhaps if the windowskin was changed. you can change use any windowskin or cursor that you like. I am not an artist, I just got a few together for demo purposes.
__________________________
` Give me teh codez!!! I am the master debator! 
|
|
|
|
|
|
|
|
|
Dec 29 2008, 12:05 AM
|
Level 5

Group: Member
Posts: 64
Type: None
RM Skill: Undisclosed

|
BigEd781 can you make it work in a new class, something like Window_Cursor?
|
|
|
|
|
|
|
|
|
Dec 29 2008, 12:19 AM
|

No method: 'stupid_title' found for `nil:NilClass'

Group: Revolutionary
Posts: 1,829
Type: Scripter
RM Skill: Undisclosed

|
No. You do it in the base classes so that you do not have to edit every place a window is created throughout the entire engine.
__________________________
` Give me teh codez!!! I am the master debator! 
|
|
|
|
|
|
|
|
|
Dec 29 2008, 08:37 PM
|
Level 31

Group: Revolutionary
Posts: 750
Type: None
RM Skill: Undisclosed

|
I like this a lot. I've always preferred a cursor over highlighting text. Now I just need to find one that suits my game.  Thanks for making this. EDIT: Just discovered something. If I use F12 to return to the title screen, I get the error message saying "line 50:SystemStackError occurred. Stack level too deep." I don't think it's a big deal or anything, just thought I'd mention it. I seem to recall a similar problem with a cursor script I used for XP.
|
|
|
|
|
|
|
|
|
Dec 29 2008, 10:43 PM
|

No method: 'stupid_title' found for `nil:NilClass'

Group: Revolutionary
Posts: 1,829
Type: Scripter
RM Skill: Undisclosed

|
QUOTE (Fade @ Dec 29 2008, 08:37 PM)  EDIT: Just discovered something. If I use F12 to return to the title screen, I get the error message saying "line 50:SystemStackError occurred. Stack level too deep."
I don't think it's a big deal or anything, just thought I'd mention it. I seem to recall a similar problem with a cursor script I used for XP. Fixed in the newest version. Very weird, don't know exactly why it was happening, but it made me realize that I did not need to alias those methods.
__________________________
` Give me teh codez!!! I am the master debator! 
|
|
|
|
|
|
|
|
|
Jan 1 2009, 07:52 PM
|
Level 31

Group: Revolutionary
Posts: 750
Type: None
RM Skill: Undisclosed

|
Is there a way to stop the cursor from animating? The one I'm using doesn't look so great when it's bouncing back and forth like that.
|
|
|
|
|
|
|
|
|
Jan 9 2009, 12:52 PM
|

Level 3

Group: Member
Posts: 34
Type: Artist
RM Skill: Intermediate

|
I was wondering if I made an error.  Did I do something wrong to make that second arrow appear? EDIT: Also found another clash with KGC's skill categorize.  Think you could make a patch for me?
This post has been edited by FaytSaratome: Jan 9 2009, 01:03 PM
|
|
|
|
|
|
|
|
|
Jan 9 2009, 01:56 PM
|

No method: 'stupid_title' found for `nil:NilClass'

Group: Revolutionary
Posts: 1,829
Type: Scripter
RM Skill: Undisclosed

|
@FaytSaratome: This script needs an update. I have it almost finished at home, so I'll post it this weekend.
__________________________
` Give me teh codez!!! I am the master debator! 
|
|
|
|
|
|
|
|
|
Jan 17 2009, 08:46 PM
|

Level 5

Group: Member
Posts: 71
Type: Event Designer
RM Skill: Masterful

|
CommentRate: Ok I have to rate it ok even though I love it because it is a very little diffrence in the game. But I do like it very much. Keep up the good scripting.
Attached File(s)
Good.png ( 2.39K )
Number of downloads: 0
|
|
|
|
|
|
|
|
|
Jan 17 2009, 08:54 PM
|

No method: 'stupid_title' found for `nil:NilClass'

Group: Revolutionary
Posts: 1,829
Type: Scripter
RM Skill: Undisclosed

|
QUOTE (Mickadell @ Jan 17 2009, 08:46 PM)  Comment Rate: Ok
I have to rate it ok even though I love it because it is a very little diffrence in the game. But I do like it very much. Keep up the good scripting. lol, ok, thanks
__________________________
` Give me teh codez!!! I am the master debator! 
|
|
|
|
|
|
|
|
|
Jan 19 2009, 08:55 PM
|

Level 6

Group: Member
Posts: 88
Type: Writer
RM Skill: Skilled

|
This happened.... A choice...  The text after it and after every text box now!  How fix?
__________________________
"An ocelet never lets his prey escape."
|
|
|
|
|
|
|
|
|
Jan 19 2009, 10:04 PM
|

No method: 'stupid_title' found for `nil:NilClass'

Group: Revolutionary
Posts: 1,829
Type: Scripter
RM Skill: Undisclosed

|
Like I said a few posts ago, this script needs an update. I haven't had a ton of time lately, but I'll get to it soon.
__________________________
` Give me teh codez!!! I am the master debator! 
|
|
|
|
|
|
|
|
  |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
RPG RPG Revolution is an Privacy
Policy and Legal
|
|