redheadturkey:
To do that, you would have to look into timing.
It would depend on how you want it done.
But I would suggest a countdown on the breeding page.
Then after that time, the user can get the pet.
Just thinking on it a little, I think you would have to have the pet created instantly like the script does.
But then have it so the pet isn't given to them, but the system.
So you make a clone of the owned_adoptables. but called it something like bred_adoptables.
You would have to add some extra fields, like who it belongs to and stuff.
Then say, since it has a date on it. You'd need to have a script that checks that date, and compares it to today's date. Then if the right time has passed, it gives the adopable to right owner. Then updates the 'created date' to the date of the day you're getting it.
Sounds really hard XD but I'm just bad at explaining things. I don't understand php with dates too much. But I'm sure you can do it.
You'd need to set up a cron, and have it run like once a day. Which will do all this work for you XD
Or, you could just have a countdown on the page, then once the countdown is over, it displays a button in which the user clicks, and it gives them their pet XD No need for cron then o-o
mysql_query("INSERT INTO ".$prefix."owned_adoptables VALUES ('', '$type', '$name','$loggedinname','0','0', '$code', '','$alts','notfortrade','no','$gender')");
After this;
PHP:
// Now we actually process the adoption and add it to the database...
// We need a unique code for the adoptable so we can show it to the user when we're done here...
$code = rand(1, 20000);
Thanks, but that's one of the solutions I tried..
the breeding now works correctly, the egg is being transferred into my adopts, but it keeps displaying the query on the new egg page and I can't get rid of it..
..just a minor nuisance me and future users will just have to live with, I guess..
The first inquiry is just a small bug, but I thought I'd ask. If I try to mate without having a second gender I get error-messages. Is there some way to block this by adding a "No male/female co-breeder available" message or something like that in the textbox?
Secondly, the new-born are born without names. It's really not a problem, I was just wondering if there's a way to put a placeholder name like 'Newborn' or something so it doesn't just say "Get stats for" and "Get BBCodes / HTML Codes for" in the pet management section.
That's all. Thanks for all the walkthroughs and all the help.
Sorry ma, but we can't actually view code that has been made on your home computer. You can try attaching the file or uploading it to a host so we can see it there.
Oh btw, it would be nicer if there is a way to specify gender ratio for different species of adoptables. I will see what I can do with this. I've already made it possible for adoptables to evolve based on gender difference(for instance, Kirlia evolves into Gardevoir if its female, and Gallade if its male), and this is worth trying too. XD
Excellent work Arianna! Had some issues with it messing up pre-existing code, but with a few minor edits, it works flawlessly.
P.S. You're ridiculously patient dealing with so many requests of troubleshooting. Know that there are some of us who legitimately try to learn and resolve issues on our own rather than abusing your time. Some of us also understand that troubleshooting for varying code, is not an easy task.
@ Arianna: Is there a simple way to modify this code so there is a waiting period after a certain creature breeds? That way users can't just breed the same ones over and over again?
You'd want it to be pet ID specific, as opposed to just letting all female rest, etc ------------- there would be a way, I might try to code it later ^^
@ Kaeliah: Sorry about that. Didn't realize she wasn't here anymore. It's sad to hear she's not active.
@ redheadturkey: Pet ID specific. Hmm. Some ideas come to mind, but I don't exactly trust the accuracy of my coding at this point. I still might dink around. If nothing else it might give others ideas and get wheels turning in a good direction.
Maybe somehow doing a modified version of the sick code, but working in time variables. Sick status seems to work the same way only instead of a happy default, the default would be an ability to breed. Instead of sick until a condition is met, unable to breed until condition is met, the condition being time span rather than click from owner. Time variable replaces owner ID and information to return to default status. I dunno. Most likely I'm on the entirely wrong track. Just throwing it out there.