|
Help Forum |
 |
| Changing the way creatures breed | |
|

TheSecond
   

|
5/14/2013 | |
I have entered full-on mad scientist mode.
After finding out that that genetics only play a small part in how creatures breed, I took a look in DS creatureBreeding.cos. Sure enough, this code controls what creature is able to breed with who, and what gender is able to fertilize which.
So far as I can tell, this is the code which handles who fertilizes whom:
targ ownr
** if the amount of eggs in the world is less than the egg limit then they can breed!
doif va75 < va73
* dbg: outs "Breeding in Progress... ;o)"
*and you are male
doif va00 eq 1
* dbg: outs "male"
*pass on sperm
mate
else
*ELSE you are female - tell him to try to pass on sperm :-)
* dbg: outs "female"
anim [036 037 036 037]
mesg wrt+ _it_ 200 0 0 0
endi
*stim both creatures with MATE
stim writ ownr 45 1
stim writ _it_ 45 1
endi
else
* one of them is not capable <redacted>
snde "kis1"
*tell it activated
mesg writ _it_ 0
*stim yourself with activate 1
stim writ targ 13 1
endi
*<redacted>
wait 15
pose 12
wait 20
endm
*CREATURE - MALE - GIVE SPERM - [200]
* Scriptorium doesn't handle wildcards of the
* form 4 0 1 200 for speed reasons - but the MATE
* won't cause any trouble if run on the female.
scrp 4 0 0 200
mate
endm
|
Genetically, both of my test subjects (one male, the other female) should be able to pass sperm and carry an egg. However, when I edit the caos like so:
*and you are male
doif va00 eq 1
* dbg: outs "male"
*pass on sperm
anim [036 037 036 037]
mesg wrt+ _it_ 200 0 0 0
else
*ELSE you are female - tell him to try to pass on sperm :-)
* dbg: outs "female"
mate
endi
|
Nothing happens. the norns kisspop, all of the associated chemicals behave as expected, but there is no pregnancy in either norn.
So, does anyone have an idea of what is going on in the background? Is there a check I'm missing that does not allow a male creature to carry eggs, or a female to pass sperm?
My favorite norn is still Belldandy. |
 Patient Pirate
ylukyun
     Manager
|
5/14/2013 | |
As far as I can work out, that check is in the mate command itself. It also checks for species (genus) and fertility levels. A bit odd seeing all of those are already in the script. The only way to get around it is by manually rewriting the fertilization code on a CAOS level, as in Amaikokonut's creature crossbreeding script or Jennie's Gay Norn program. |
 Peppery One
Papriko
    
|
5/14/2013 | |
When you rewrite it like that, replacing the MATE command with a hand-written code, all your resulting creatures will be labelled as "spliced" in the creatures history.
When you can live with that, then you can mess around with it. You should have a look at the command "GENE CROS".
Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis... |

TheSecond
   

|
5/14/2013 | |
Interesting, Papriko. I don't see much difference between spliced and regular birth, honestly.
Anyway, thanks for the tip, I'll have a look.
My favorite norn is still Belldandy. |
 Patient Pirate
ylukyun
     Manager
|
5/15/2013 | |
Don't forget to check for fertility! |

TheSecond
   

|
5/15/2013 | |
But of course!
Anyway, I've determined that my new Mate script needs to check the breed of the creatures that are trying to mate, that way the males and females can mate normally, and hopefully also mate with the hermaphroditic breed.
Something like:
Pseudocode:
If I am herm then
if my partner is herm then
custom mate herm + herm
else if my partner is male
custom mate male + herm
else (my partner is female)
custom mate herm + female
end if
else if I am male then
if my partner is female
normal mate
else (My partner is herm)
custom mate male + herm
end if
else (I am female)
if my partner is male
request sperm
else (My partner is herm)
custom mate female + herm
end if
end if
|
Now, by looking at the current breeding script, I know that I can determine the gender of a creature with the SPCS command. the question is, how to identify the hermaphrodites? According to the game engine they are either going to be male or female...
I have thought about the herms expressing a special emitter that releases Chemical X, and then checking for Chemical X in the custom mating script, but I wonder if there's an easier way?
My favorite norn is still Belldandy. |
 Patient Pirate
ylukyun
     Manager
|
5/16/2013 | |
I think you can assign a special variable to the creature at birth, something like "nornIsHerm = true". Or you could possibly give it an ovxx value? |
 Peppery One
Papriko
    
|
5/16/2013 | |
Or you use NEW: CREA to create creatures with the gender 3. Most things already should be able to handle them. If not you'd probably just need a few minor script fixes.
Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis... |