PDA

View Full Version : Mys 1.3.4 Updated! Merged Breeding Mod for 1.3.4


Missy Master
01-29-2014, 03:46 PM
NOTE: you must use parents that mesh exactly in size and shape for this to work!

What happens here is the inserted image url created in breeding supersedes the 'standard' of the adopt.

This Mod will allow you to take a custom image for the parents, mother and father, and then blend them when they breed to create a blended/merged offspring or offsprings.

You can get some really fantastic results if you manually insert the image for each parent in imageurl in owned_adoptables.



**Important!:

You will need three folders in the main directory you likely don't have:


images
backup_images
deco_images

All your pet images will need to be in /images.

Also, they must be exactly the same shape and size.

The background must be white. Very important.


Okay so you will want to add these four files, just upload them to overwrite what you have.

I strongly suggest you clear the image around the actual adopt, in case you want to add something later, or just to not have anything but the pet image be carried over and merged in the child image.



the code:


1. The breeding script goes in the /adminacp section.

2. The class_breeding script goes in classes.

3. The class_ownedadoptable goes as well in classes!

4. Breedingview goes in View


Thanks to HOF for this really wonderful Mod!! :) This was based off one of my own Mods but it wasn't working here at all, and HOF graciously altered it for us!


Mother

http://www.sim-life.com/Simantics/images/RSRa.png

Father

http://www.sim-life.com/Simantics/images/ESRa.png

Child

http://sim-life.com/Simantics/images/1391184488KS.png

squiggler
01-29-2014, 04:33 PM
Would you be willing to upload examples? I'm not sure I understand how this would work or how the result would look.

Missy Master
01-31-2014, 09:32 AM
I'll upload some later today, sure! :)

That will make it easy to see what this great script can do!

Missy Master
01-31-2014, 10:21 AM
Examples added!

Remember the image has to be something that will mesh exactly with all others of that breed/species whatever --- identical, for the mesh to work.

Keep levels and all that in mind, for me, I'm only allowing breeding at 4th level.

Kyttias
01-31-2014, 03:15 PM
Wow, this is pretty fascinating. Just how did you stumble upon this?

What exactly is it doing? Multiplying? Overlaying? Xor? I can't even tell. I'll take a look, because I'm super curious as to how this was achieved.

Any idea what would happen if the species were the same dimensions but one had a glow around it? Would the baby keep the glow, or would it cause a glitching mess? I assume it would keep the glow, but I'm not necessarily sure what color it would be in (and I suppose it doesn't particularly matter).

Does this work with transparent pngs and gifs?

How hard would it be to limit it to a specific species, especially if all your species come at a variety of dimensions? Or is that already a feature in this mod (or do we have to rely on our visitors not to merge strange things and create glitches)? (Breeding groups should help with this, right? Because I don't mind babies of species A or species B, which is what breeding groups are meant to do, but this will only work with things on the same species. I guess I'll just have to make a species that only breeds like this?)

(( unrelated: I rather like the breeding system on Flight Rising, where the babies end up being one of range of colors between the two parents. Colors are come in sections (primary, secondary and tertiary accents) and are likely stored on the server as separate pieces and then merged with php. And they also merge down textures as genetics. At FR, the color is obviously determined by a set array of variables, and isn't merged using... whatever you are? Yours is very creative, however! I wouldn't want to completely imitate FR, anyway. ))

Hall of Famer
01-31-2014, 03:17 PM
These are interesting examples Anna, I am sure people will understand what this mod does better. I dunno about the color part though, is the new color produced by mixing pink and green? XD

Missy Master
02-01-2014, 03:49 PM
@HOF:

Thanks! And yes that was a horrible choice of mine for merged colors ughhh!! hahah!


@ Kyttias

Glad you like it! :)

1. It's overlaying, as I understand the mechanics of it. I coded it from a base script for image merging I had commissioned. It's imagemerge basically.

2. If the same shape and size is kept, and one has a glow or something else, anything else really, on one parent, that should transfer over. You can mess with the opacity too, in class-breeding!

3. I can't say if it will work with transparent, I'd say just experiment, really. Whatever is on the image for the parents is directly melded and merged, so you want a clear background around each pet image if you DON'T want that to carry over.

4. For my own site, right now I have it limited to one level and one breed that's onsite, but it's a really good question about limiting it --- I wouldn't trust the members to not try to mix and match, and while the results might be amusing, that can get really -- a little too interesting lol.

I am thinking that the limiting will have to come from controlling who breeds with who and what--- always the like-species that will 'match'.

AndromedaKerova
11-10-2014, 02:42 PM
Sadly it seems the examples images no longer work. Could you possibly replace them with new ones?

Micolai
06-17-2020, 12:09 AM
I'm getting this error. How can I fix it?

Warning: Missing argument 1 for Breeding::mergedBreed(), called in /home/wildhors/public_html/classes/class_breeding.php on line 52 and defined in /home/wildhors/public_html/classes/class_breeding.php on line 84

and my code in that area in that file is this:

private function mergedBreed($species){
if($this->female->getType() != $this->male->getType()) throw new BreedingException("class");
$name = "Child of {$this->female->getName()} & {$this->male->getName()}";
if(!$this->imageurl) $this->imageurl = $this->getImageurl($name);
$num = rand(1, $this->settings->number);
for($i = 0; $i < $num; $i++){
$this->offsprings->append(new Adoptable($this->female->getType()));
}
}

Hall of Famer
07-09-2020, 02:22 PM
Actually you can try PMing Missy Master herself, have you tried that?

Micolai
07-09-2020, 07:33 PM
Actually you can try PMing Missy Master herself, have you tried that?

I had lol but she said she couldn't really help because she got your help with this mod haha. But then if I remember right you said you don't help with third party mods.

Missy Master
07-11-2020, 10:19 AM
I did try to work out what was wrong, but I'm not finding it.

I know when we initially added this, years ago, you did the insert of it for me :)

I didn't write the code either, I had it coded for me ten years ago. Not really sure what's going wrong with it, it used to work just fine with the latest version of Mysid!

Micolai
07-17-2020, 10:41 PM
Yeah I'm not really sure either lol. I put the files in all the correct areas, but it still wants to give me this:

Warning: Missing argument 1 for Breeding::mergedBreed(), called in /home/wildhors/public_html/classes/class_breeding.php on line 52 and defined in /home/wildhors/public_html/classes/class_breeding.php on line 84

Missy Master
07-18-2020, 12:02 AM
If you read on my Mod you will see it requires an imageurl in ownedadoptables in SQL.

I'm wondering if that might be the issue, it needs to merge two images, and if it doesn't have two in that field ....

Micolai
07-19-2020, 11:10 PM
I ended up going into the database and added the imageurl to the owned adoptables but I still had the same error code. I'm not really sure what's going on XD I'm sorry I'm being a pain :[

https://i.imgur.com/evQLsvE.png

Missy Master
07-19-2020, 11:31 PM
You aren't being a pain at all :)

You have a right to get some help, I wish I could work this out ... I had hoped the error was due to it trying to call up a non existent imageurl.

Hmmmm... Gotta love the detail it gives 'An error has occurred.' haha.

Need more clues!

Missy Master
07-19-2020, 11:34 PM
I did look at the two class_breeding errors too btw.

I don't see anything that should be throwing this ...

Micolai
07-19-2020, 11:52 PM
It may be conflicting with the rarity mod I added maybe?

Missy Master
07-22-2020, 01:26 PM
It might be, not sure.

I paid for the Mod to be coded years ago, and at one point it was a chooseable option in the CP.

I don't see it now.

HOF was the one who had to help with inserting it in the code and working :) I failed lol.

It does need an imageurl always supplied in imageurl field, for it to work.