Status Window with Full-Body Picture, Modeled after Tales of Symphonia |
|
|
|
|
Feb 6 2008, 11:32 PM
|

Level 6

Group: Member
Posts: 82
Type: None
RM Skill: Skilled

|
Here's a script I made that changes the status screen to look like the status screen in Tales of Symphonia, with all the attributes and equipment lined up on the left edge of the window, leaving room for a large status picture on the right. You can set the picture to be used for each character, as well as a default if you like. CODE #============================================================================== # ■ RisingPhoenix_Window_Status #------------------------------------------------------------------------------ # Make the status window with room on the right for a large picture # Author: RisingPhoenix #==============================================================================
module RisingPhoenix SmallFontSize = 18 #Size of smaller font on status screen WLH = 20 #Define line height for small font size; change for different font sizes X_Offset = 100 #How far to the right you want the picture to be CharacterFullPics = Array.new CharacterFullPics = { #(Leave file name blank for no picture for that character; picture files are stored in the System folder) #(Try to stick to a height of 390ish, anything below that is cut off - widths can vary but the picture will be right-aligned) #ID => "file name" 1 => "", } DefaultFullPic = "" #Leave blank for no picture as the default end
class Window_Status < Window_Base WLH = RisingPhoenix::WLH #-------------------------------------------------------------------------- # ● Object initialization # actor :The actor for which the window is being made #-------------------------------------------------------------------------- def initialize(actor) super(0, 0, 544, 416) @actor = actor refresh end #-------------------------------------------------------------------------- # ● Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear if RisingPhoenix::CharacterFullPics[@actor.id] == nil if RisingPhoenix::DefaultFullPic != "" draw_status_pic(RisingPhoenix::DefaultFullPic) end elsif RisingPhoenix::CharacterFullPics[@actor.id] != "" draw_status_pic(RisingPhoenix::CharacterFullPics[@actor.id]) end draw_actor_name(@actor, 4, 0) self.contents.font.size = RisingPhoenix::SmallFontSize draw_actor_class(@actor, 18, WLH + 4) draw_basic_info(4, WLH * 2 + 8) draw_parameters(4, WLH * 7 + 18) draw_equipments(4, WLH * 11 + 28) end #-------------------------------------------------------------------------- # ● Define a function to draw the status picture #-------------------------------------------------------------------------- def draw_status_pic(pic_name) bitmap = Cache.system(pic_name) rect = Rect.new(0, 0, 0, 0) rect.width = bitmap.width rect.height = bitmap.height x = RisingPhoenix::X_Offset self.contents.blt(x, 0, bitmap, rect) bitmap.dispose end #-------------------------------------------------------------------------- # ● 基本情報の描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_basic_info(x, y) draw_actor_level(@actor, x, y + WLH * 0) #draw_actor_state(@actor, x, y + WLH * 1) draw_exp_info(x, y + WLH * 1) draw_actor_hp(@actor, x, y + WLH * 3) draw_actor_mp(@actor, x, y + WLH * 4) end #-------------------------------------------------------------------------- # ● 能力値の描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_parameters(x, y) draw_actor_parameter(@actor, x, y + WLH * 0, 0) draw_actor_parameter(@actor, x, y + WLH * 1, 1) draw_actor_parameter(@actor, x, y + WLH * 2, 2) draw_actor_parameter(@actor, x, y + WLH * 3, 3) end #-------------------------------------------------------------------------- # ● 経験値情報の描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_exp_info(x, y) s1 = @actor.exp_s s2 = @actor.next_rest_exp_s s_next = sprintf(Vocab::ExpNext, Vocab::level) self.contents.font.color = system_color self.contents.draw_text(x, y + WLH * 0, 180, WLH, Vocab::ExpTotal) self.contents.draw_text(x, y + WLH * 1, 180, WLH, s_next) self.contents.font.color = normal_color self.contents.draw_text(x, y + WLH * 0, 180, WLH, s1, 2) self.contents.draw_text(x, y + WLH * 1, 180, WLH, s2, 2) end def draw_item_name(item, x, y, enabled = true) if item != nil draw_icon(item.icon_index, x, y, enabled) self.contents.font.color = normal_color self.contents.font.color.alpha = enabled ? 255 : 128 self.contents.draw_text(x + 24, y, 172, WLH, item.name) end end #-------------------------------------------------------------------------- # ● 装備品の描画 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_equipments(x, y) self.contents.font.color = system_color self.contents.draw_text(x, y, 120, WLH, Vocab::equip) for i in 0..4 draw_item_name(@actor.equips[i], x, y + 22 * (i + 1)) end end end Comments and feedback would be appreciated; if you find and errors/bugs let me know so I can try to fix them.
This post has been edited by RisingPhoenix: Feb 7 2008, 05:22 PM
__________________________
「いい気なるな!目障り何だよ!僕の目の前から�消えて まえ!魔神!煉獄殺!」 ー リオン・マグナス (テイルズオブデスティニー) "Ii ki naru na! Mezawari nan da yo! Boku no me no mae kara...kiete shimae! Majin! Rengokusatsu!" - Leon Magnus (Tales of Destiny)
|
|
|
|
|
|
|
|
|
Feb 6 2008, 11:56 PM
|

Demented Moogle

Group: Banned
Posts: 1,130
Type: None
RM Skill: Undisclosed

|
QUOTE #(Leave file name blank for no picture for that character; picture files are stored in the System folder) Instructions, anyone?  Great job - but yes, I would like to see a screenshot or a demo too.
__________________________
|
|
|
|
|
|
|
|
|
Feb 7 2008, 12:04 AM
|

Level 6

Group: Member
Posts: 82
Type: None
RM Skill: Skilled

|
Okay, uploaded and added a couple screenshots.
__________________________
「いい気なるな!目障り何だよ!僕の目の前から�消えて まえ!魔神!煉獄殺!」 ー リオン・マグナス (テイルズオブデスティニー) "Ii ki naru na! Mezawari nan da yo! Boku no me no mae kara...kiete shimae! Majin! Rengokusatsu!" - Leon Magnus (Tales of Destiny)
|
|
|
|
|
|
|
|
|
Feb 7 2008, 12:21 AM
|

Love me! I wanna you to love me!

Group: Revolutionary
Posts: 196
Type: Event Designer
RM Skill: Beginner

|
QUOTE (woratana @ Feb 7 2008, 02:20 PM)  Look very Nice! I love it Some question from screenshot, why the actor's picture lift up from the window border? and where can I find those actor's pictures? I really like it. http://sozaimenu.gozaru.jp/english.htmlCheck the site... You will find the picture... @risingphoenix Great and nice!!
__________________________
~Time To sWallow tHe Pain and VaniSH OuR HuRt~
|
|
|
|
|
|
|
|
Guest_Black Shadow_*
|
Feb 7 2008, 02:03 AM
|
Guests

|
This is a very nice script. Im gonna use it. However, when I paste it, everything comes on a straigt line.  And it only happens with this script. Any reason for this? Also, could you upload a demo?
|
|
|
|
|
|
|
|
|
Feb 7 2008, 02:47 AM
|

♥My Heart Is Refusing me♥

Group: +Gold Member
Posts: 2,302
Type: Mapper
RM Skill: Masterful
Rev Points: 15

|
QUOTE (jasonicus @ Feb 7 2008, 10:51 AM)  Looks like you copied the script wrong. No problems here. I marked everything, and pressed Ctrl+C, and then pasted. I also tried to copy from the menu when you use the mouse. Same problem happen both times.
__________________________
 The project is revived! Check it out!
|
|
|
|
|
|
|
|
|
Feb 7 2008, 08:21 AM
|

Level 6

Group: Member
Posts: 82
Type: None
RM Skill: Skilled

|
It has happened to me too with other scripts that I copied, though I have no idea why the clipboard doesn't preserve the leading tabs. I'll add an attachment of a text document with the code; that should preserve the tabs. Also I think the actor picture has that blank area because the writable area on the window is a few pixels inwards, and anything that is drawn outside isn't shown. On Window_Base's create_contents functions, it defines the bitmap area as: CODE self.contents = Bitmap.new(width - 32, height - 32) You could edit this to make the whole area writable, but it would affect all windows and I didn't want to screw up any other windows you have. Edit: Edited the script files so that you can set how far to the right you want the picture rather than right-aligning it, should give more flexibility. Will upload an updated text file and a demo shortly.
This post has been edited by RisingPhoenix: Feb 7 2008, 08:40 AM
__________________________
「いい気なるな!目障り何だよ!僕の目の前から�消えて まえ!魔神!煉獄殺!」 ー リオン・マグナス (テイルズオブデスティニー) "Ii ki naru na! Mezawari nan da yo! Boku no me no mae kara...kiete shimae! Majin! Rengokusatsu!" - Leon Magnus (Tales of Destiny)
|
|
|
|
|
|
|
|
|
Feb 7 2008, 01:45 PM
|

Looking for scripter to hire? PM me *O*

Group: +Gold Member
Posts: 1,038
Type: Scripter
RM Skill: Undisclosed

|
You should put the script in code, not codebox CODE You script... #============================================================================== # ■ RisingPhoenix_Window_Status #------------------------------------------------------------------------------ # Make the status window with room on the right for a large picture # Author: RisingPhoenix #==============================================================================
module RisingPhoenix SmallFontSize = 18 #Size of smaller font on status screen WLH = 20 #Define line height for small font size; change for different font sizes X_Offset = 100 #How far to the right you want the picture to be CharacterFullPics = Array.new CharacterFullPics = { #(Leave file name blank for no picture for that character; picture files are stored in the System folder) #(Try to stick to a height of 390ish, anything below that is cut off - widths can vary but the picture will be right-aligned) #ID => "file name" 1 => "", } DefaultFullPic = "" #Leave blank for no picture as the default end
class Window_Status < Window_Base WLH = RisingPhoenix::WLH #-------------------------------------------------------------------------- # ● Object initialization # actor :The actor for which the window is being made #-------------------------------------------------------------------------- def initialize(actor) super(0, 0, 544, 416) @actor = actor refresh end #-------------------------------------------------------------------------- # ● Refresh #-------------------------------------------------------------------------- If you use codebox >> CODE You script... #============================================================================== # ■ RisingPhoenix_Window_Status #------------------------------------------------------------------------------ # Make the status window with room on the right for a large picture # Author: RisingPhoenix #==============================================================================
module RisingPhoenix SmallFontSize = 18 #Size of smaller font on status screen WLH = 20 #Define line height for small font size; change for different font sizes X_Offset = 100 #How far to the right you want the picture to be CharacterFullPics = Array.new CharacterFullPics = { #(Leave file name blank for no picture for that character; picture files are stored in the System folder) #(Try to stick to a height of 390ish, anything below that is cut off - widths can vary but the picture will be right-aligned) #ID => "file name" 1 => "", } DefaultFullPic = "" #Leave blank for no picture as the default end
class Window_Status < Window_Base WLH = RisingPhoenix::WLH #-------------------------------------------------------------------------- # ● Object initialization # actor :The actor for which the window is being made #-------------------------------------------------------------------------- def initialize(actor) super(0, 0, 544, 416) @actor = actor refresh end #-------------------------------------------------------------------------- # ● Refresh #-------------------------------------------------------------------------- Some people will have hard time to copy the script. And use spoiler will help decrease space too. CODE You script... #============================================================================== # ■ RisingPhoenix_Window_Status #------------------------------------------------------------------------------ # Make the status window with room on the right for a large picture # Author: RisingPhoenix #==============================================================================
module RisingPhoenix SmallFontSize = 18 #Size of smaller font on status screen WLH = 20 #Define line height for small font size; change for different font sizes X_Offset = 100 #How far to the right you want the picture to be CharacterFullPics = Array.new CharacterFullPics = { #(Leave file name blank for no picture for that character; picture files are stored in the System folder) #(Try to stick to a height of 390ish, anything below that is cut off - widths can vary but the picture will be right-aligned) #ID => "file name" 1 => "", } DefaultFullPic = "" #Leave blank for no picture as the default end
class Window_Status < Window_Base WLH = RisingPhoenix::WLH #-------------------------------------------------------------------------- # ● Object initialization # actor :The actor for which the window is being made #-------------------------------------------------------------------------- def initialize(actor) super(0, 0, 544, 416) @actor = actor refresh end #-------------------------------------------------------------------------- # ● Refresh #--------------------------------------------------------------------------
__________________________
Check out my NEW blog!!! MVP (Most Valuable Poster) Award 2008 
|
|
|
|
|
|
|
|
|
Jun 15 2008, 04:55 PM
|

All Lies Lead to the Truth

Group: Revolutionary
Posts: 1,573
Type: Developer
RM Skill: Advanced

|
Holy Necropost, Batman!
Well, if you have a actor in the 1 slot named Hero1, then name the file picture file hero1. You don't really have to but it would make it easier to manage. Then under this part at the top:
CharacterFullPics = { #(Leave file name blank for no picture for that character; picture files are stored in the System folder) #(Try to stick to a height of 390ish, anything below that is cut off - widths can vary but the picture will be right-aligned) #ID => "file name" 1 => "", }
You would assign the picture values. Where 1 would be the name of the first actor and so on. Like this.
1 => "Hero1", 2 => "Hero2", 3 => "Hero3",
I think that should explain it. The pics, though you will just have to get for whatever character you want and make them the correct size.
|
|
|
|
|
|
|
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
RPG RPG Revolution is an Privacy
Policy and Legal
|
|