I am also trying to make it so sheep breed. However my knowledge on scripting is limited, and I am not sure how to go about creating the script.
I would like it to on:changeday to check whether or not there is 2 or more units in range to create or spawn a unit, but I would also like it so if there is a certain number of units in range it will not spawn anymore units.
If anyone could give me an idea of how I need to set up a script for it, that would be great. Although I am not sure how complicated it would be to make such a script.
It would also be great if a random chance was set up to spawn a unit instead of having a new unit every day.
Any help would greatly be appreciated.
Thank you.
EDIT: Okay, I managed to throw together this script and it works.
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
on:changeday { 	local $c; 	$c+=count_inrange("unit",15,250,"self"); 		if ($c>1){ 			if ($c<5){ 				if (random(5)==1){ 					create "unit",15,getx("self"),getz("self"); 				} 			} 		} 	freevar $c; 	}
However, each of the sheep seem to create a new unit. Is there a way to make it so only 1 sheep create a new one instead of all of them or is that getting too complicated? or would I have to have two separate units a male and female and do it that way?
If I have to use 2 separate units how roughly would the script look?
This might make it a bit more tricky, but is there also a way if this is possible to make it on the first sheep that is "bred" it can add a diary entry.
edited 3×, last 02.11.08 11:49:01 am