MP for Characters Who Don't Use Magic

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
So if an actor does not have MP at all, is there a way to hide it in the menu? Due to Yanfly's battle engine, I already don't have it displaying in battle if no one has a skill the uses MP, but it is still displayed in the main menu.
Yeah.  Look through Window_Base for "mp" and figure out which commands are causing MP to be drawn.

For example, the following method "Draw Simple Status":

#-------------------------------------------------------------------------- # * Draw Simple Status #-------------------------------------------------------------------------- def draw_actor_simple_status(actor, x, y) draw_actor_name(actor, x, y) draw_actor_level(actor, x, y + line_height * 1) draw_actor_icons(actor, x, y + line_height * 2) draw_actor_class(actor, x + 120, y) draw_actor_hp(actor, x + 120, y + line_height * 1) draw_actor_mp(actor, x + 120, y + line_height * 2) endYou might change it to something like:

#-------------------------------------------------------------------------- # * Draw Simple Status #-------------------------------------------------------------------------- def draw_actor_simple_status(actor, x, y) draw_actor_name(actor, x, y) draw_actor_level(actor, x, y + line_height * 1) draw_actor_icons(actor, x, y + line_height * 2) draw_actor_class(actor, x + 120, y) draw_actor_hp(actor, x + 120, y + line_height * 1) if actor.mmp > 0 draw_actor_mp(actor, x + 120, y + line_height * 2) end endNow it will only draw if the actor's Maximum MP is greater than zero, which should be approximately what you want to do.  A lot of this stuff can be solved by looking through the existing code, seeing what it does, and making minor modifications (like this "if" branch) to force it to do what you want.

Don't do what Reno suggested above, unless you want to remove the MP bar on the menu for all characters.
 

Shinma

Lurker
Veteran
Joined
Dec 29, 2012
Messages
756
Reaction score
341
First Language
English
Primarily Uses
RMMV
The problem I am running in to is that all actors are 1 class, "Soul". The Soul class has MP, but unless you buy a skill that uses MP then it should not display it. At the moment only 1 of 4 actors know any spells. When I am in combat, they are the only one that shows MP, but in the main menu all of them are showing it, even with the code above. 

I am going to dig around a bit more to see what I can find, especially in Yanfly's scrip to see if I can figure out how he has done it in the battle command window.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Skills are held in the @skills array as a property of a battler.

So if the five skills that use MP are 5, 6, 9, 10, and 12, then you can run something to match the actor's skills against any one of those 5.  There is almost definitely a more efficient way to do it, but I'd use something like:

#-------------------------------------------------------------------------- # * Draw Simple Status #-------------------------------------------------------------------------- def draw_actor_simple_status(actor, x, y) draw_actor_name(actor, x, y) draw_actor_level(actor, x, y + line_height * 1) draw_actor_icons(actor, x, y + line_height * 2) draw_actor_class(actor, x + 120, y) draw_actor_hp(actor, x + 120, y + line_height * 1) mp_skills = [5, 6, 9, 10, 12] has_mp_skill = false for i in actor.skills for j in mp_skills if i == j has_mp_skill = true end end end if has_mp_skill == true draw_actor_mp(actor, x + 120, y + line_height * 2) end endIf you can figure out what Yanfly did to check this, feel free to use that instead, of course.
 

Shinma

Lurker
Veteran
Joined
Dec 29, 2012
Messages
756
Reaction score
341
First Language
English
Primarily Uses
RMMV
Okay, since this one doesn't work either, I have to assume that there is some script that is overwriting it. I am going to narrow down to the draw_actor_mp and see if I can find it.

Update:

So I found the place inside Yanfly's script that I needed to add the code above. Once I add it, it does indeed hide the MP on the main menu, but it also hides it after I learn the skill. I am going to keep looking into it.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top