View Full Version : Make Breeding Random?
SilverDragonTears
08-24-2011, 03:43 PM
Is it possible to make it so that the adopts may or may not breed?
ipengu
08-24-2011, 04:03 PM
As in an adoptable in class 'Avian' has a 50/50 change of being able to breed with other 'Avian' class adoptables?
SilverDragonTears
08-24-2011, 04:10 PM
yep that's what I mean...
ipengu
08-24-2011, 04:29 PM
You COULD always make a little bit of script that picks a random number, and adds it to the end of 'Avian' like 'Avian9385' or 'Avian2468' Then theres what.... 1 in 10,000 chance that same person would HAPPEN to get the same numbered 'Avian' class.
SilverDragonTears
08-24-2011, 04:55 PM
wait. what?
Hall of Famer
08-24-2011, 09:25 PM
Well you can create a new field called 'breedchance' in table prefix_adoptables, which stores the probability of successful breeding(from 0 to 100). Then modify the breeding.php to add another if...else statement. Inside this conditional statement will you need to define a new variable that generates random number from 0 to 100. What you should do next is to insert another if...else statement that checks if this random number is greater or smaller than the value in field 'breedchance'. Breeding will be successful if the random number is smaller than the value 'breedchance', or it will fail.
SilverDragonTears
08-24-2011, 09:47 PM
I can code... but I'm not advanced yet... could you help me write that?
Hall of Famer
08-25-2011, 04:58 AM
Alright I will rewrite the breeding.php for you later this week.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.