Feature - Implemented Access to KoLCharacter.getGender()

Theraze

Active member
I've looked through and can't find any way to access the character's gender without a server hit. Since mafia already knows this, would it be possible for us to have a my_gender() ASH command? This would simplify scripts like crafting_ideas so they don't need to ask you for your gender every execution... I've attached a quick patch that just adds my_gender() to RuntimeLibrary.

Examples - Male:
> my_gender

Returned: -1
Female:
> my_gender

Returned: 1
If you ever get 0, it means that mafia has absolutely failed to figure out what your gender is.

Edit: Personally, this would save a server hit every time I run crafting_ideas or Discoveries. At some point I'll update undiscovered to do the gender checks as well. :)
 

Attachments

  • MyGender.patch
    919 bytes · Views: 36
Last edited:

Theraze

Active member
Thanks! I'd looked through modref and various other places, but it appears the only item in the wiki that mentions that is the modifier_eval page itself, and only if you know which keyword it uses. Least that explains why I couldn't find it and none of the 206 scripts in my folder had it. :)

Again, thanks jason! My scripts are now updated to use the proper, existing capability!
 
Top