Home Community Mys-Script Creative Off-Topic |
|
|
Thread Tools | Display Modes |
#1
|
||||
|
||||
Hall of Famer's gender ratio system
Well this one is based on Arianna's gender mod. As far as I know, Kaeliah already has a gender ratio/chance system before I made this one, so I do not take any credits for this script. Dont forget to credit Arianna though, she was the first one to bring up this excellent gender idea that Rusnak Adoptables were originally, lacking.
Before you proceed, make sure you you have Arianna's gender system on your script already. Her thread can be found here: http://www.rusnakweb.com/forum/showthread.php?tid=1367&page=1 It is rather straight forward to follow Arianna's mod-installation guide, so I wont explain much. The script simply defines a new variable Gender, which is a random number that has 50-50 chance of being male or female. The myadopts.php also displays an adoptable's gender. For those of you who do not know how to add a gender column to the 'owned_adoptables' table, I've attached this screenshot below for you to follow the instruction. Shouldnt be hard though, there's no coding involved: Alright lets get started on this gender ratio system. Before we proceed, it is necessary to add a new column called 'genderratio' to the table adoptables. Its strongly advised that you add it to the last column. After this is done, go to admin.php and find the codes below: PHP Code:
PHP Code:
You can see that we add codes for gender ratio in admin control panel, so you will be able to define gender ratio in acp instead of going all the way to PHPmyadmin. You will have to modify nadopt.php next, otherwise you will not be able to create new adoptables! In nadopt.php, find: PHP Code:
PHP Code:
PHP Code:
PHP Code:
Alright now we are done with nadopt.php. This isnt over yet, we will have to add codes for the actual gender ratio system. In doadopt.php, find: PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
So yes, we are all set now. Isnt this easy? Well there is a flaw in this code that the gender ratio is actually not 50-50 when you set the gender ratio to be 50. This is because there are actually 101 integers between 0 to 100. One way to solve this problem is to use another if-else statement that deals with gender ratio = 50, another way is to increase the gender ratio maximum from 100 to 1000, or even 10000. This may sound confusing, but please give a try if you are an aspiring coder. Also, keep in mind that this is actually female gender ratio, not male gender ratio. A gender ratio of 80 typically tells us that you have 80% chance to get female adoptable, and 20% chance of getting male adoptable. Similarly, a gender ratio of 15 means that you only have 15% chance to get a female adoptable. What if you enter a gender ratio above 100? Well, if you actually look into the codes I wrote, I define it as genderless and such cases may exist for adoptables like Magnemite and Shellder in pokemon series. Make good use of it if you can. Here is an example of my genderless Magnemite: Thats the end of it. Sorry I wrote a lot, and thanks for taking the time and trouble to go through the entire article. I hope it helps. Hall of Famer |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mys v1.3.3 Gender Ratio Mod for Mys v1.3.3 | Hall of Famer | Mys v1.3.x Mods | 17 | 05-23-2019 03:34 PM |
Mys v1.3.2 Gender Ratio Mod for Mys v1.3.2 | Hall of Famer | Mys v1.3.x Mods | 6 | 01-08-2013 02:02 PM |
Mys v1.3.1 Gender Ratio Mod for v1.3.1 | Hall of Famer | Mys v1.3.x Mods | 15 | 08-17-2012 03:25 AM |
Hall of Famer's HP system | Hall of Famer | Mys v1.1.x Mods | 13 | 04-25-2012 07:08 AM |
Hall of Famer's Gender Ratio Mod v1.2 | Hall of Famer | Mys v1.2.x Mods | 45 | 04-02-2012 12:42 PM |
What's New? |
What's Hot? |
What's Popular? |