Display gender?

Lyseth

Potato Mage
Veteran
Joined
May 26, 2015
Messages
716
Reaction score
43
First Language
English
Primarily Uses
RMMV
So I brought my game to a few friends, and they asked about the gender of a few characters, so I was wondering, is it possible that when you go to a characters description through the pause screen that there's a symbol showing which gender they are? example below (edited with Paint.NET)

Untitled.png
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.


ANY change to those menu screens will require scripts.


How do you SET an actor's gender? Any scripter will need to know that.


And are you using RTP there, or do you have a custom script for that screen? If a custom script, please post a link to it (though it looks like RTP).


Do you have sprites for the symbols?
 
Last edited by a moderator:

Lyseth

Potato Mage
Veteran
Joined
May 26, 2015
Messages
716
Reaction score
43
First Language
English
Primarily Uses
RMMV
The symbol was edited in through Paint.NET, know any site that has the script for this?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Not directly, you would need to use a script for it. I managed to set it to read in a notetag with the gender in my game, then I wrote the gender (M or F only) on the party menu with a script call. But, I use Yanfly's menu Engine so my exact script calls won't work for you.

Still, the easiest way:

1: Add a notetag to the actor for their gender.

2: Add a command to read in the gender when the actor is initialized. Make sure to put a default for missing notetags! (I used ?). The code to do 1 and 2 is here:

class Game_Actor < Game_Battler attr_accessor :gender attr_accessor :age alias bg_genderage_initialize initialize def initialize(actor_id) #Set the default age and gender @gender = "?" @age = "?" #Call the aliased function bg_genderage_initialize(actor_id) #Read the gender notetag for the current actor $data_actors[actor_id].note[/<Gender:\s*(\w+)>/im] if $1 and $1 != "" @gender = $1 end #Read the age notetag for the current actor $data_actors[actor_id].note[/<Age:\s*(\w+)>/im] if $1 and $1 != "" @age = $1 end endend
Put it in a new script in your materials section, if you wish to use it. Terms of use, do whatever you want with it, as I wrote it for notetag reading practice. You also gain the ability to read in the age if you wish to use that!

3: Add a command to draw the gender in the appropriate spot. I used Yanfly Menu engine so my code will not work for you I'm afraid, maybe someone else can help with that?

Edit: Here is part 2, which displays the gender on screen. Requires Yanfly's Menu engine, and probably Yanfly Core and Yanfly Status to work:

class Window_Base < Window @bg_display_string #-------------------------------------------------------------------------- # alias method: draw_actor_simple_status #-------------------------------------------------------------------------- alias bg_jpdisplay_draw_actor_simple_status draw_actor_simple_status def draw_actor_simple_status(actor, dx, dy) #Call Original Method bg_jpdisplay_draw_actor_simple_status(actor, dx, dy) #Set the dy value to be the same as in Ace Menu Engine #May need to comment this line out if not using Ace Menu Engine dy -= line_height / 2 #Add Gender/Age lines here. bg_display_string = actor.gender + "/" + actor.age draw_text(dx + 300, dy, 48, line_height, bg_display_string) end end # Window_Base
It's two scripts total, one to read in the values, one to display them on screen.

I think Mr bubbles might also have a script for this too though?
 
Last edited by a moderator:

Lyseth

Potato Mage
Veteran
Joined
May 26, 2015
Messages
716
Reaction score
43
First Language
English
Primarily Uses
RMMV
Not directly, you would need to use a script for it. I managed to set it to read in a notetag with the gender in my game, then I wrote the gender (M or F only) on the party menu with a script call. But, I use Yanfly's menu Engine so my exact script calls won't work for you.

Still, the easiest way:

1: Add a notetag to the actor for their gender.

2: Add a command to read in the gender when the actor is initialized. Make sure to put a default for missing notetags! (I used ?). The code to do 1 and 2 is here:

class Game_Actor < Game_Battler attr_accessor :gender attr_accessor :age alias bg_genderage_initialize initialize def initialize(actor_id) #Set the default age and gender @gender = "?" @age = "?" #Call the aliased function bg_genderage_initialize(actor_id) #Read the gender notetag for the current actor $data_actors[actor_id].note[/<Gender:\s*(\w+)>/im] if $1 and $1 != "" @gender = $1 end #Read the age notetag for the current actor $data_actors[actor_id].note[/<Age:\s*(\w+)>/im] if $1 and $1 != "" @age = $1 end endend
Put it in a new script in your materials section, if you wish to use it. Terms of use, do whatever you want with it, as I wrote it for notetag reading practice. You also gain the ability to read in the age if you wish to use that!

3: Add a command to draw the gender in the appropriate spot. I used Yanfly Menu engine so my code will not work for you I'm afraid, maybe someone else can help with that?

I think Mr bubbles might also have a script for this too though?

Just a question, how will it not work for me?
 

optimum45

Veteran
Veteran
Joined
Mar 31, 2015
Messages
537
Reaction score
65
First Language
English
Primarily Uses
Yanfly's core scripts are what drive that snippet of the Yanfly Menu.  You would need to install the Yanfly Engine Core to make that snippet work.
 

Lyseth

Potato Mage
Veteran
Joined
May 26, 2015
Messages
716
Reaction score
43
First Language
English
Primarily Uses
RMMV
Yanfly's core scripts are what drive that snippet of the Yanfly Menu.  You would need to install the Yanfly Engine Core to make that snippet work.
Ah okay, is the engine core a nuisance to work with?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
It's more than the core script, I added it onto the Menu engine completely. That's why I didn't post all of the code, just the part that will work for you. As it is what I did post will read in a gender value, but not display it on screen.

Unfortunately, I don't know how to display it on the status screen like you want (in my game I put it on the party screen). Maybe another scripter can pick it up from here and display the symbol or the letter for the gender?

Edit: Here is what it looks like in my game, if curious. It isn't quite what you asked for though.

 
Last edited by a moderator:

Lyseth

Potato Mage
Veteran
Joined
May 26, 2015
Messages
716
Reaction score
43
First Language
English
Primarily Uses
RMMV
It's more than the core script, I added it onto the Menu engine completely. That's why I didn't post all of the code, just the part that will work for you. As it is what I did post will read in a gender value, but not display it on screen.

Unfortunately, I don't know how to display it on the status screen like you want (in my game I put it on the party screen). Maybe another scripter can pick it up from here and display the symbol or the letter for the gender?
Wait, so the bit you displayed will work for VX Ace?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Do not consider using an entire engine just to get one symbol to display on your screen.


The snippet provided is simply to register an actor as being male or female. It has nothing to do with displaying anything on the screen. You could go ahead and add that to your game if you want, and set up the notes, but you will need another script in order to display it on the status screen.


Be patient and wait for someone to come by who can write the script that you need.
 
Last edited by a moderator:

Lyseth

Potato Mage
Veteran
Joined
May 26, 2015
Messages
716
Reaction score
43
First Language
English
Primarily Uses
RMMV
Do not consider using an entire engine just to get one symbol to display on your screen.Be patient and wait for someone to come by who can write the script that you need.
I planned on reading up on it first anyway, and judging by some responses, it messed up some areas, so I don't think I'd want that to happen, as I've been working on this since May 24th.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
What Shaz said. I'm hoping what I posted here someone can edit to work on the default engine for you. All they should need to do is edit part two (I just posted part two in my first post so both parts are there) a little. Or, if you know scripting, feel free to use this as a base and edit to make it work for you.
 

Lyseth

Potato Mage
Veteran
Joined
May 26, 2015
Messages
716
Reaction score
43
First Language
English
Primarily Uses
RMMV
What Shaz said. I'm hoping what I posted here someone can edit to work on the default engine for you. All they should need to do is edit part two (I just posted part two in my first post so both parts are there) a little. Or, if you know scripting, feel free to use this as a base and edit to make it work for you.
Knowing myself, I may just end up failing with it if I tried. XD
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
it's probably just a matter of modifying the appropriate window (I don't have it in front of me, so can't be sure, but it's probably something like Window_ActorStatus or Window_Status) and instead of drawing a letter, call the draw_icon method with the correct icon index based on whether you have a M or F in the actor's gender variable. And then you'd need to get the appropriate graphic for each gender and save that into your icon file.


Just wait. I'm sure someone will give you the right script within 24 hours. It'll only be a few lines.


To prepare, you could modify your iconset now and add the two icons, and provide the index for each one. Then whoever does the last of the script for you will be able to give you a complete script, and you won't even have to modify it to show the correct icons.
 
Last edited by a moderator:

Lyseth

Potato Mage
Veteran
Joined
May 26, 2015
Messages
716
Reaction score
43
First Language
English
Primarily Uses
RMMV
it's probably just a matter of modifying the appropriate window (I don't have it in front of me, so can't be sure, but it's probably something like Window_ActorStatus or Window_Status) and instead of drawing a letter, call the draw_icon method with the correct icon index based on whether you have a M or F in the actor's gender variable. And then you'd need to get the appropriate graphic for each gender and save that into your icon file.Just wait. I'm sure someone will give you the right script within 24 hours. It'll only be a few lines.To prepare, you could modify your iconset now and add the two icons, and provide the index for each one. Then whoever does the last of the script for you will be able to give you a complete script, and you won't even have to modify it to show the correct icons.
I have added the gender icons, I figured that it'd be necessary to add this feature since my friends were a bit confused about which characters were which gender.
 

optimum45

Veteran
Veteran
Joined
Mar 31, 2015
Messages
537
Reaction score
65
First Language
English
Primarily Uses
There are people out here with amazing knowledge, far more able than I am.  I could do this for you, but someone else will very likely not only finish before I do, but think of an easy way that makes my hilarious coding look hilarious.   :guffaw:
 

Lyseth

Potato Mage
Veteran
Joined
May 26, 2015
Messages
716
Reaction score
43
First Language
English
Primarily Uses
RMMV
There are people out here with amazing knowledge, far more able than I am.  I could do this for you, but someone else will very likely not only finish before I do, but think of an easy way that makes my hilarious coding look hilarious.   :guffaw:
If no one gets back to me within the next 48 hours, I'll settle with your "hilarious" coding.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
What index do you have for the male and female icons? I kind of said you could use up the time adding them and stating their index/ids so whoever wrote the script could put that in and you wouldn't have to edit it.
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
797
Reaction score
350
First Language
English
Primarily Uses
N/A
Here's my take on a script.

Created it in a vanilla project, so it's fine with defaults but may have issues with custom scripts.

Anyway, you need to edit the index IDs (as Shaz said) to appropriate icons as I didn't see any in the default Icon list.

(The ones listed will only be good for a laugh if anything.)

Just go to the lines that denote the icons and make your changes.

After that, you need to tag male actor noteboxes with:

<gender:male>

and female actors with

<gender:female>

Let me know if I missed something and I'll try to explain it better.

module RPG
class Actor < BaseItem

def gender
@gender = nil
if self.note.include?("")
@gender = "Male"
elsif self.note.include?("")
@gender = "Female"
else
@gender = nil
end
return @gender
end
end
end

class Window_Base < Window

def draw_actor_nickname(actor, x, y, width = 180, g)
change_color(normal_color)
draw_text(x, y, width, line_height, actor.nickname)
draw_icon(g, x + width, y, true)


end
end



class Window_Status < Window_Selectable

def draw_block1(y)
if $data_actors[@actor.id].gender == "Male"gen_icon = 152 # Icon for Male Characters
 

elsif $data_actors[@actor.id].gender == "Female"
 

gen_icon = 52 # Icon for Female Characters
 

else
 

gen_icon = 0 #Icon for genderless / other characters
 

end
draw_actor_name(@actor, 4, y)
draw_actor_class(@actor, 128, y)
draw_actor_nickname(@actor, 288, y, gen_icon)
end
end
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You should have used code tags in that, to keep the formatting. It'll still work, but it's not pretty.
 

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