Changing Actor Status Sizes of Reserve Members

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,441
Reaction score
680
First Language
Polish
Primarily Uses
Other
Hello everybody,
I have posted that question before in Ruby/RGSSx questions that don't deserve their own thread, but I realized it'll be actually more complicated, than I thought, so I decided to create a thread for it.
 
So basically, I want to resize actor statuses of reserve members.
I want to change that:




into something like this:
 I realized that my description was not clear, sorry:

Q: How can I replace the whole drawing actor simple status method for reserve party members? (Not how to setup 'compact-size' window for them =P )
A: condition: 'if index < 2' answers that question, because I know how to do the rest.
 
The problem, that also came was:
 
Q: How to resize select rectangle when selecting character?
A:

def item_rect(index) if index < 2 # set the rect for the first two actors here. else # set the rect for the other members here. endend Possible workaround would be to create a separate window for that, where I could manually draw them. (Probably I know how to do that, unless it's more complicated than I think). But it would be better to have that in one window, so it would also be shown in items scene (when using items).
If that would be a really complicated process, then I'll simply create a second window for that.
 
Any suggestions?
 
I'm fine for now, if there'll be any more problems, then I'll ask.

@KockaAdmiralac_FINALLY & @Sixth Thank you for help!
 
Last edited by a moderator:

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
It depends ...

Are you using a script to show the menu?

If so, paste links all your menu-related scripts here.
 

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,441
Reaction score
680
First Language
Polish
Primarily Uses
Other
Well... I'm not sure if I understood, but it's just like standard actor status.

All the images and fancy stuff there are added by simply overwriting draw_actor_simple_status.

It's not from Luna Engine or other scripts, it's just like normal statuses, I only wrote a script to change positions of gauges and added pictures there, but overall it's just the basic window, like in fresh project.
 
Last edited by a moderator:

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
Oh.

I don't have the code for draw_actor_simple_status here, so I may be editing this post when I find it.

Also, great job you've done with images and such!

But it would still be good if you paste your edited menu status window script here (in spoiler!!!)
 
Last edited by a moderator:

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,441
Reaction score
680
First Language
Polish
Primarily Uses
Other
Why, Thank you! =P
 
From gathered information it seems, that something else needs to be edited than draw_actor_simple_status. And if that could be done here, probably I would figure it out by myself, but the problem is outside that I think.
 

Here I got some help, but I'm having troubles with that.

The following is from 'Window_MenuStatus' :
 

 #--------------------------------------------------------------------------  # * Draw Item  #--------------------------------------------------------------------------  def draw_item(index)    actor = $game_party.members[index]    enabled = $game_party.battle_members.include?(actor)    rect = item_rect(index)    draw_item_background(index)    draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled)    draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)  endNow, each selectable window has the @index variable. @index is the currently selected index, so just use that to determine which character should be drawn in full-size. The rest are done using a compact draw method. The same thing can be used whenever you're calculating the item rect (the selection rectangle which highlights the currently selected item).
 
Code:
  #--------------------------------------------------------------------------  # * Get Rectangle for Drawing Items  #--------------------------------------------------------------------------  def item_rect(index)    rect = Rect.new    rect.width = item_width    rect.height = item_height    rect.x = index % col_max * (item_width + spacing)    rect.y = index / col_max * item_height    rect  end
You'll have to overwrite the above method (taken from 'Window_Selectable') so that the current @index is highlighted correctly. For the Y value, you'll need to calculate the size of the compact view and multiply that by the current index or however you want it done. If you don't change this, the selection rect will be way off.

And the default draw_actor_simple_status look like this:

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)  end

Overall, my script is the same, but all the options are more extended (like adding pics, dynamic resizing of gauges etc.), so from these few lines I made more than 300 lines of script. (including comments)



OK, here is my script:

class Warrior < Sorcerer /\ def 4503 WUT? .---. || WUT? atk 357 ___ \___/ == mag 111 | - |__|___/| WUT? mdef 553 \_/ | agi 146 / \ WUT? luk 65 WUT? / \ endendXDXDXDXDXDXDXDXDXDXDXDXDXDDXDXDXDXDXDXDXDXDDXDXDXDXDXDXDXDXDXDXDDD
But the problem isn't to make smaller statuses, but to make select rectangle to also change its width.
 
Last edited by a moderator:

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
So, you will need first to change the draw_item method.

Do you see draw_actor_face(...) ?

Add on the end a condition so it looks like :

draw_actor_face(...) if index < 2That should disable faces.Second, you might want to add a new method, draw_actor_simple_status_minimized

So, the draw_actor_simple_status part in draw_item should look like :

draw_actor_simple_status(...) if index < 2draw_actor_minimized_status(actor, rect) if index >= 2Next, you might want to define that method.
Code:
def draw_actor_minimized_status(actor, rect)  draw_actor_name(actor, rect.x, rect.y)  draw_gauge_with_height(rect.x + 108, rect.y + 5, 100, 5, actor.hp / actor.mhp, Color.new(255, 255, 0), Color.new(255, 255, 0))  draw_gauge_with_height(rect.x + 108, rect.y + 12, 100, 5, actor.mp / actor.mmp, Color.new(255, 0, 0), Color.new(255, 0, 0))end
And then you will need to find the draw_gauge in Window_BaseCopy that method, and paste it, but rename it draw_gauge_with_height, and let the parameters be x, y, width, height, rate, color1, color2, that means, add the 'height' parameter after 'width'

Then in the method find the number 6.

Replace every 6 with 'height' (without quotation marks).

It is really complicated, and my code is untested.

You can work a bit with numbers if it looks awful.
 
Last edited by a moderator:

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,441
Reaction score
680
First Language
Polish
Primarily Uses
Other
Hmm... that's kinda what I thought, but will the selectable window also be resized?

I mean, when you choose "Equip" command or formation etc., and you need to choose your actor - will the selection rectangle be resized automatically and will that window automatically set spacing?

Well... Your suggestion is something that needs to be done anyway. So I'll prepare these windows for that. Thanks for help.

I'll tell if I'll encounter any problems.
 

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
Actually, I don't know XD.

Try it, and if it fails, I'll look later for why is it happening.

(In Serbia is currently 1:03 AM)
 

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,441
Reaction score
680
First Language
Polish
Primarily Uses
Other
I *probably* know how to do that manually if needed!

This: "if index < 2" answers my question for now. I was thinking how to separate things depending on member position.

Thank you! now I know where to begin! That's where I had problem. =P

I'll try everything tomorrow actually later xD, because in Poland is also 1:14 AM at the moment. (I'm going to sleep =P) 
 
Last edited by a moderator:

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
Hmm... that's kinda what I thought, but will the selectable window also be resized?

I mean, when you choose "Equip" command or formation etc., and you need to choose your actor - will the selection rectangle be resized automatically and will that window automatically set spacing?
No, it won't.To fix that, head to the 'item_rect' method and modify it like this (or make an 'item_rect' method in your code, I don't remember if that window got one already defined or not):

Code:
def item_rect(index)  if index < 2    # set the rect for the first two actors here.  else    # set the rect for the other members here.  endend
 

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,441
Reaction score
680
First Language
Polish
Primarily Uses
Other
No, it won't.

To fix that, head to the 'item_rect' method and modify it like this (or make an 'item_rect' method in your code, I don't remember if that window got one already defined or not):

def item_rect(index) if index < 2 # set the rect for the first two actors here. else # set the rect for the other members here. endend
Thanks, that should do it! =)

I think I will have to create that method in my script, because when changing that in overall - changes all the selectables in whole game.



- nope, it still affects the whole game... I'm trying to figure out something...



OK, so I'll prepare the minimized status window, which is easy to do, and I'll leave the selectable for later.



LOL, solved. (at least for now) Don't laugh at meh! xD 
 
Last edited by a moderator:

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,441
Reaction score
680
First Language
Polish
Primarily Uses
Other
~ Sorry for double posting and bumping? too soon?, but editing would be useless. ~

I've got a problem, which probably is stupid ~ please bear with my legendary scripting knowledge.

I don't know how to properly change size of reserve actor members, I mean... the size of the whole window? mm.. I think it'd be better to just look at the pictures:

Don't mind the super mess here, but as for now everything is fine:



BUT, the whole windows still has the same size, so it goes off...



Well I guess I can put something into that free space - wanna put some advertisement here?
I think I need to change that:

def item_height # Change Actor status profile height - (height - standard_padding * 2) / 4 # = 96 endbut I don't know how to do that properly - I mean, using index.

Thanks for help.
 
Last edited by a moderator:

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
Do you mean your cursor rectangle is not correct?

No, changing item_height won't be good enough. I think you should change item_rect from the root.

So, maybe you wanted this :

Code:
def item_rect(index)  if index < 2    super  else    # copy the original code for item_rect here, but exclude the last line    rect.height = 24 # or whatever height you want    rect  endend
 

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,441
Reaction score
680
First Language
Polish
Primarily Uses
Other
The selection rectangle is fine. (Well in pictures is kinda broken, but I didn't set that properly yet.)

The thing is about the blank space.

Even if all of the characters are displayed (like in first picture), the window is still scroll-able and it goes off. (like in second picture)

Putting something like this probably would solve the problem:

def item_height if index < 2 (height - standard_padding * 2) / 4 # = 96 else 35endThe problem is, it can't read 'index' and I don't know how to separate these things, because even if I resize these statuses of reserve party members, it still takes space of normal height, thus leaving that blank space
 
Last edited by a moderator:

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
Of course index is not readable!

In the item_rect, the index is passed as a parameter, e.g.

def item_rect(index) # <====== You see?In the item_height, however, there are no parameters.

Try the code above, and it MAY work (I'm not sure)
 

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,441
Reaction score
680
First Language
Polish
Primarily Uses
Other
I know it's not readable because of that, I noticed that earlier. =P

Do you mean 

def item_height(index) *set stuff here*?

Then it throws 'wrong number of arguments' error.

Well... Sorry if I'm doing stupid mistakes etc. I'm not a scripter, please bear with me.
 
 

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
def item_rect(index)  if index < 2    super  else    # copy the original code for item_rect here, but exclude the last line    rect.height = 24 # or whatever height you want    rect  endend
Lol, I am quoting myself.

Use this code  to overwrite item_rect in the Window_MenuActor (or whatever it is)

Leave the item_height untouched
 
Last edited by a moderator:

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,441
Reaction score
680
First Language
Polish
Primarily Uses
Other
OK, so it does that:

but now how to remove these empty spaces properly?



Or the best possible solution - how to make that window unscrollable. Just set the height and put stuff in. No scroll.
 
Last edited by a moderator:

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
Ummm... I'm not sure...

Try this

def item_rect(index)  if index < 2    super  else    # copy the original code for item_rect here, but exclude the last line    rect.height = 24 # or whatever height you want rect.y = index / col_max * 24 # or whatever height you want    rect  endend

Notice : It is not the same code as above
 
Last edited by a moderator:

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,441
Reaction score
680
First Language
Polish
Primarily Uses
Other
And we got to the beginning of the problem. =P

Exactly what I already did before - it worked (it merged them by removing space) but the problem is, the window still uses their standard height leaving a huge blank place below them, when you scroll down.

For first look it looks fine, the selection is fine, but the screen goes down for no reason. Is there a way to make it not scrollable? It would be even better if the window would just cut off things if they were to big or something like in normal windows.

I know how to setup things by using X/Y position, but the window is crazy and throws that space for advertisement at me. That's why I told about that item_height. ~ Or perhaps there is another way to simply resize that window...? I'm struggling with this all day.

 
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,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top