OwenBean wrote:Sorry - I get a failed to run init.lua
change name of file to "mobs"
Nicksahere wrote:Idk what it is but this mod spawns a ton, I mean a TON! I really need help, they lag up my game terribly
Sokomine wrote:Sheep in a deep valley seemed to reproduce fast:
(img)
Might be a client/network bug as after relogin the number of sheep was decresed a bit. In general, lots of mobs gather in pits. Their jumping is too random to "escape" and reach higher ground most of the time.
12Me21 wrote:You should add cats
Limux wrote:I have a problem.
When I kill a rat I have no rat in my inventory.
Sokomine wrote:Feel free to do a cat model! There are many animals which could be part of MT and for which we don't have a model yet
PilzAdam wrote:Try rightclicking the rat.
Michael Eh? wrote:Sheep look like pigs with a hoodie.
deathtimer = 0,self.deathtimer = self.deathtimer+dtime
if self.deathtimer > 600 then
self.object:remove()
endthefamilygrog66 wrote:With some help from Kaeza, I've added a few lines of code to the api.lua file in order to give the mobs a defined life-span, in this case 10 minutes (600 seconds); when each mob reaches that age, it simply disappears.
While not the best solution, it's probably the simplest, and it definitely helps with keeping the mob population under control, thus preventing (or at least reducing) server lag.
On line 30, I added:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
deathtimer = 0,
And then around line 145 (i.e. in the on_step function), I added:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
self.deathtimer = self.deathtimer+dtime
if self.deathtimer > 600 then
self.object:remove()
end
That's it!
If you want mobs to live longer/shorter, simply change the 600 to the number of seconds you prefer.
PilzAdam wrote:thefamilygrog66 wrote:With some help from Kaeza, I've added a few lines of code to the api.lua file in order to give the mobs a defined life-span, in this case 10 minutes (600 seconds); when each mob reaches that age, it simply disappears.
While not the best solution, it's probably the simplest, and it definitely helps with keeping the mob population under control, thus preventing (or at least reducing) server lag.
On line 30, I added:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
deathtimer = 0,
And then around line 145 (i.e. in the on_step function), I added:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
self.deathtimer = self.deathtimer+dtime
if self.deathtimer > 600 then
self.object:remove()
end
That's it!
If you want mobs to live longer/shorter, simply change the 600 to the number of seconds you prefer.
I added a lifetimer here: https://github.com/PilzAdam/mobs/commit/3ea8fb5d768403718a4c0fc5e412540709e94d3d
Someone needs to test this.
Sokomine wrote:That may help with lag on servers. Unfortionately, keeping simple mobs as farm animals will become even more difficult then. It already is more a matter of chance right now because the mobs cannot be caught and placed by players. Maybe that rat trap could be extended to sheep and deer so that they could be caught in a cage and carried arround, much like the lasso-catching in mobf.
Mossmanikin wrote:Love the update!
Only one thing: isn't the wheat meant to disappear when you feed the sheep?
When I feed them it stays in my inventory...
Users browsing this forum: Bing [Bot] and 22 guests