Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

RMXP: Mog Status Issue (SOLVED)

Can anyone tell me why this RMXP code:

Code:
 

#_______________________________________________________________________________

# MOG Scene Status Eva V1.2            

#_______________________________________________________________________________

# By Moghunter  

# [url=http://www.atelier-rgss.com]http://www.atelier-rgss.com[/url]

#_______________________________________________________________________________

module MOG

#Transition Time.  

MST_TT = 10

#Transition Type(Name).  

MST_TTT = "004-Blind04"

# Set Maximum (STR,DEX,AGL,INT)

MST_ST = 999

# Set Maximum (ATK,PDEF,MDEF)

MST_STE = 999

end

$mogscript = {} if $mogscript == nil

$mogscript["menu_eva"] = true

##############

# Game_Actor #

##############

class Game_Actor < Game_Battler

def now_exp

return @exp - @exp_list[@level]

end

def next_exp

return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0

end

end

###############

# Window_Base #

###############

class Window_Base < Window   

def nada2(actor)

face = RPG::Cache.battler(actor.battler_name, actor.battler_hue)

end    

def draw_heroface4(actor,x,y)

face = RPG::Cache.picture(actor.name + "_fc2") rescue nada2(actor)

cw = face.width 

ch = face.height 

src_rect = Rect.new(0, 0, cw, ch)

if face == RPG::Cache.battler(actor.battler_name, actor.battler_hue)

self.contents.blt(x + 40 , y - ch - 240, face, src_rect) #x + 45 , y - ch - 150 

else  

self.contents.blt(x , y - ch, face, src_rect)    

end

end   

def draw_actor_parameter2(actor, x, y, type)

back = RPG::Cache.picture("STBAR_Back")    

cw = back.width  

ch = back.height 

src_rect = Rect.new(0, 0, cw, ch)    

self.contents.blt(x + 50 , y - ch + 20, back, src_rect)  

meter = RPG::Cache.picture("STBAR.png")    

case type

when 0

parameter_value = actor.atk

cw = meter.width  * actor.atk / MOG::MST_STE

when 1

parameter_value = actor.pdef

cw = meter.width  * actor.pdef / MOG::MST_STE

when 2

parameter_value = actor.mdef

cw = meter.width  * actor.mdef / MOG::MST_STE

when 3

parameter_value = actor.str

cw = meter.width  * actor.str / MOG::MST_ST

when 4

parameter_value = actor.dex

cw = meter.width  * actor.dex / MOG::MST_ST

when 5

parameter_value = actor.agi

cw = meter.width  * actor.agi / MOG::MST_ST

when 6

parameter_value = actor.int

cw = meter.width  * actor.int / MOG::MST_ST

end

self.contents.font.color = normal_color

self.contents.draw_text(x + 120, y - 2, 36, 32, parameter_value.to_s, 2)

ch = meter.height 

src_rect = Rect.new(0, 0, cw, ch)

self.contents.blt(x + 50 , y - ch + 20, meter, src_rect) 

end

def draw_maphp5(actor, x, y)

back = RPG::Cache.picture("BAR")    

cw = back.width  

ch = back.height 

src_rect = Rect.new(0, 0, cw, ch)    

self.contents.blt(x + 65, y - ch + 30, back, src_rect)

meter = RPG::Cache.picture("HP_Bar2")    

cw = meter.width  * actor.hp / actor.maxhp

ch = meter.height 

src_rect = Rect.new(0, 0, cw, ch)

self.contents.blt(x + 65, y - ch + 30, meter, src_rect)

self.contents.font.color = Color.new(0,0,0,255)

self.contents.draw_text(x + 66, y - 1, 100, 32, actor.hp.to_s + "/" + actor.maxhp.to_s, 1)  

self.contents.font.color = Color.new(250,255,255,255) 

self.contents.draw_text(x + 65, y - 2, 100, 32, actor.hp.to_s + "/" + actor.maxhp.to_s, 1)  

end  

def draw_mapsp5(actor, x, y)

back = RPG::Cache.picture("BAR")    

cw = back.width  

ch = back.height 

src_rect = Rect.new(0, 0, cw, ch)    

self.contents.blt(x + 65 , y - ch + 30, back, src_rect)

meter = RPG::Cache.picture("SP_Bar2")    

cw = meter.width  * actor.sp / actor.maxsp

ch = meter.height 

src_rect = Rect.new(0, 0, cw, ch)

self.contents.blt(x + 65 , y - ch + 30, meter, src_rect)

self.contents.font.color = Color.new(0,0,0,255)

self.contents.draw_text(x + 66, y - 1, 100, 32, actor.sp.to_s + "/" + actor.maxsp.to_s, 1)  

self.contents.font.color = Color.new(250,255,255,255) 

self.contents.draw_text(x + 65, y - 2, 100, 32, actor.sp.to_s + "/" + actor.maxsp.to_s, 1)  

end

def draw_mexp5(actor, x, y)

bitmap2 = RPG::Cache.picture("Exp_Back")

cw = bitmap2.width 

ch = bitmap2.height 

src_rect = Rect.new(0, 0, cw, ch)

self.contents.blt(x + 60 , y - ch + 30, bitmap2, src_rect)

if actor.next_exp != 0

rate = actor.now_exp.to_f / actor.next_exp

else

rate = 1

end

bitmap = RPG::Cache.picture("Exp_Meter")

if actor.level < 99

cw = bitmap.width * rate 

else

cw = bitmap.width

end   

ch = bitmap.height 

src_rect = Rect.new(0, 0, cw, ch)

self.contents.blt(x + 60 , y - ch + 30, bitmap, src_rect)

self.contents.font.color = Color.new(255,255,255,255)

self.contents.draw_text(x + 51, y + 6, 84, 32, actor.next_rest_exp_s.to_s, 1)    

self.contents.font.color = Color.new(55,255,55,0)

self.contents.draw_text(x + 52, y + 1, 84, 32, actor.next_rest_exp_s.to_s, 1)    

self.contents.font.color = Color.new(255,255,255,255)

self.contents.draw_text(x + 45, y + 6, 84, 32, "N",0)

self.contents.font.color = Color.new(255,255,255,0)    

self.contents.draw_text(x + 44, y + 8, 84, 32, "N",0)

self.contents.font.color = Color.new(0,0,0,0)

self.contents.draw_text(x + 10, y + 5, 30, 32, actor.level.to_s, 1)

self.contents.font.color = Color.new(255,255,255,255)    

self.contents.draw_text(x + 11, y + 6, 30, 32, actor.level.to_s, 1)    

end

end

##################

# Window_Status2 #

##################

class Window_Status < Window_Base

def initialize(actor)

super(0, 0, 660, 480)

self.contents = Bitmap.new(width - 32, height - 32)

@actor = actor

self.opacity = 0

refresh

end

def refresh

self.contents.clear

self.contents.font.name = "OCR A Extended"

draw_actor_name(@actor, 60, -3)

draw_actor_class(@actor, 302, -3) #needs to go left

draw_mexp5(@actor,310,130)

draw_actor_state(@actor, 500, 20) #down?

draw_maphp5(@actor, 256, 165) #275

draw_mapsp5(@actor, 440, 165) #430

draw_actor_parameter2(@actor, 286, 108, 0)

draw_actor_parameter2(@actor, 465, 137, 1)

draw_actor_parameter2(@actor, 465, 108, 2)

draw_actor_parameter2(@actor, 286, 53, 3)

draw_actor_parameter2(@actor, 465, 53, 4)

draw_actor_parameter2(@actor, 286, 80, 5)

draw_actor_parameter2(@actor, 465, 80, 6)

self.contents.font.color = menu_color

draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 228)

draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 258)

draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 288)

draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 318)

draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 348)

end

def dummy

self.contents.font.color = menu_color

self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)

self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)

self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)

self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)

self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)

draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)

draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208) 

draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)

draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)

draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)

end

end

###############

# Window_Face #

###############

class Window_Face < Window_Base

def initialize(actor)

super(0, -20, 300, 520)

self.contents = Bitmap.new(width - 32, height - 32)

@actor = actor

self.opacity = 0

refresh

end

def refresh

self.contents.clear

draw_heroface4(@actor,10,485)        

end

end

################

# Scene_Status #

################

class Scene_Status

def initialize(actor_index = 0, equip_index = 0)

@actor_index = actor_index

end

def main

@actor = $game_party.actors[@actor_index]

@status_window = Window_Status.new(@actor)

@status_face = Window_Face.new(@actor)

@status_face.z = 20

@status_face.x = -300

@status_face.contents_opacity = 0

@mst_lay = Sprite.new

@mst_lay.bitmap = RPG::Cache.picture("MST_Lay")

@mst_lay.z = 100

@mst_back1 = Plane.new

@mst_back1.bitmap = RPG::Cache.picture("MN_BK_FILE") #Put MN_BK_FILE here

@mst_back1.z = 10

Graphics.transition(MOG::MST_TT, "Graphics/Transitions/" + MOG::MST_TTT)

loop do

Graphics.update

Input.update

update

if $scene != self

break

end

end

for i in 0..30

@status_face.x -= 20  

@status_face.contents_opacity -= 15

Graphics.update

end  

Graphics.freeze

@mst_lay.dispose

@mst_back1.dispose

@status_face.dispose

@status_window.dispose

end

def update

@mst_back1.ox -= 1

#@mst_back1.oy += 1

if @status_face.x < 0

@status_face.x += 20

@status_face.contents_opacity += 15

elsif @status_face.x >= 0   

@status_face.x = 0   

@status_face.contents_opacity = 255

end   

if Input.trigger?(Input::B)

$game_system.se_play($data_system.cancel_se)

$scene = Scene_Menu.new(3)

return

end

if Input.trigger?(Input::R) or Input.trigger?(Input::RIGHT)

$game_system.se_play($data_system.cursor_se)

@actor_index += 1

@actor_index %= $game_party.actors.size

$scene = Scene_Status.new(@actor_index)

return

end

if Input.trigger?(Input::L) or Input.trigger?(Input::LEFT)

$game_system.se_play($data_system.cursor_se)

@actor_index += $game_party.actors.size - 1

@actor_index %= $game_party.actors.size

$scene = Scene_Status.new(@actor_index)

return

end

end

end

Fails to display this picture:

Pie_Fc2.png


On this menu:

Status.jpg


Would greatly appreciate any help possible :)
 
No error message, it just doesn't show.

It's not the battler character that is supposed to show as far as I can tell, it is just whatever file in the pictures directory that has the actors name followed by "_fc2".

In the demo of the mogmenu status script it is a large png that shows in the lower left corner, not a battler sprite/img.

Am I wrong about this?

If so, then I am asking the wrong question. I don't want my battler to show down there. I am using an animated side view system. The style of the art would not be right. I would like to show a unique piece of artwork (shown here) for the status screen...
 
Zen,

As suspected, I cannot change that picture as I am using animated battlers with their own sprite sheet there.

Besides that, this script pulls from the pictures directory, not the battlers directory. The battler graphic should have nothing to do with it.

Thanks for giving it a try.

Anyone else wanna take a stab at it?
 
It says in the script, if nada2 is run (runs if the picture with + "_fc2" doesnt exist)
It calls:
Code:
def nada2(actor)

face = RPG::Cache.battler(actor.battler_name, actor.battler_hue)

end
Which pulls from the battlers.

It says there her name is 'Pie'
So you have 'Pie_fc2.xxx' in your resource folder?
I'm not sure. I'll look more into it.
 
What i would like to know is, how you managed to move all the stats and hp numbers/text/pics. if i would know that i could possible figure out how to display them. maybe alsp the oppasity of the pic is 0 ?
 
Brewmeister, you did it! How could I have missed that?! It's been plaguing me for so long!

THANK YOU!
THANK YOU!
THANK YOU!


SekiRaze, it was all down to trial and error. I hunted for numbers, changed them, watched what happened... It was quite a process! Truly might be easier to just go ahead and learn how to do it right ;)
 
Myrmior":3hh0215w said:
SekiRaze, it was all down to trial and error. I hunted for numbers, changed them, watched what happened... It was quite a process! Truly might be easier to just go ahead and learn how to do it right ;)

thats my problem, that try and error ended up in errors and errors :D but thanks anyway. i will learn ruby and rgss anyway now, so i think i can fix that soon :)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top