![]() |
Make Breeding Random?
Is it possible to make it so that the adopts may or may not breed?
|
As in an adoptable in class 'Avian' has a 50/50 change of being able to breed with other 'Avian' class adoptables?
|
yep that's what I mean...
|
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.
|
wait. what?
|
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.
|
I can code... but I'm not advanced yet... could you help me write that?
|
Alright I will rewrite the breeding.php for you later this week.
|
All times are GMT -5. The time now is 09:48 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.