Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 09-17-2011, 10:34 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 82,368
SilverDragonTears is on a distinguished road
Default Random Breeding

How can I make it so breeding is random meaning a 50% chance of producing offspring.
__________________

Check out SilvaTales
Reply With Quote
  #2  
Old 09-18-2011, 07:34 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 333,685
Hall of Famer is on a distinguished road
Default

So you want breeding to have 50% chance of success and 50% chance of failure? You may want to use the mt_rand() function to generate random number at equal chance, a typical way of doing this is:

PHP Code:
$rand mt_rand(0,1); //Generate a random number between 0 and 1
if($rand == 0){
  
// codes to execute for successful breeding.
}
else{
  
// shows an error message saying breeding has failed.

Hopefully this is the correct interpretation of your request.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #3  
Old 09-18-2011, 01:31 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 82,368
SilverDragonTears is on a distinguished road
Default

Where do I put this?
__________________

Check out SilvaTales
Reply With Quote
  #4  
Old 09-18-2011, 01:39 PM
Nemesis's Avatar
Nemesis Nemesis is offline
Member
 
Join Date: Mar 2011
Location: Ohio, United States
Posts: 641
Gender: Male
Credits: 49,000
Nemesis is on a distinguished road
Default

what about having liters? lol
__________________
https://gemnode.com
Free Hosting for Mysidia Adopt Sites
Just join our forum and request your free hosting account
Reply With Quote
  #5  
Old 09-18-2011, 01:44 PM
AlexC's Avatar
AlexC AlexC is offline
Moderator
 
Join Date: Dec 2009
Location: Canada
Posts: 753
Gender: Unknown/Other
Credits: 67,275
AlexC is an unknown quantity at this point
Default

oh god, I'd love the chance to have litters. You could enter in an amount, say there is a random chance of your pet having between 0-4 babies maybe?
__________________
Reply With Quote
  #6  
Old 09-18-2011, 05:25 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 333,685
Hall of Famer is on a distinguished road
Default

Well massive baby production was not brought into our attention before since normally you do not want your members to have a huge number of adoptables through breeding, especially for rare species. I may create a Mod for that someday, but again be careful with this possible feature since it can potentially ruin your site.

@ Silverdragontears: In your breeding.php file of course. Do you have a modified version of that script file already? If so, please send me the content of your breeding.php file through PM so I can tell you where to add these random number generation lines.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #7  
Old 09-18-2011, 11:49 PM
Nemesis's Avatar
Nemesis Nemesis is offline
Member
 
Join Date: Mar 2011
Location: Ohio, United States
Posts: 641
Gender: Male
Credits: 49,000
Nemesis is on a distinguished road
Default

LOLOLOLOLOLOLOLOLLOL

"Massive Baby Production" HOF that killed me

XD XD XD
__________________
https://gemnode.com
Free Hosting for Mysidia Adopt Sites
Just join our forum and request your free hosting account
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Random egg Skaiya Questions and Supports 2 03-30-2014 02:42 PM
Random breeding outcome/ rare breeding SilverDragonTears Questions and Supports 0 03-25-2012 02:33 AM
Make Breeding Random? SilverDragonTears Suggestions and Feature Requests 7 08-25-2011 04:58 AM
Random 3D Art alonaria Art Gallery 4 06-13-2011 05:19 PM
Random 5 is not realy random! RipJawWolfFang Questions and Supports 9 04-30-2009 06:03 AM


All times are GMT -5. The time now is 08:09 AM.

Currently Active Users: 9713 (0 members and 9713 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636