Page 1 of 1

[Mod] Forceload Lib [forceload_lib]

PostPosted: Fri Jul 31, 2015 08:45
by orwell
This mod is 1. not developed anymore, 2. outdated and 3. not being used by any other mod and 4. should not be used by any other mod anymore.
Moderators, if you see this, please move this thread to "old mods"

This is a helper mod that keeps entities that want to be kept active active.
Mod makers can depend on this mod and add a function to their entity definition. If it returns true, forceload_lib will set forceloaded positions at the entity's location (and remove them if it leaves its place)

In entity definition:
keep_active = function(self)
--find out if the entity should be left active when leaving the loaded area
return true
end

--
Depends: nothing
License: WTFPL

Re: [Mod] Forceload Lib [forceload_lib]

PostPosted: Sat Aug 01, 2015 20:57
by Minetestforfun
Hi,

Great work.

Is it possible to generate map with an automated script and this mod ?

Re: [Mod] Forceload Lib [forceload_lib]

PostPosted: Mon Aug 03, 2015 15:22
by orwell
I don't know how far forceloading allows map generating. It would be possible, but combining with this mod is not useful.
Are you able to write mods?

Re: [Mod] Forceload Lib [forceload_lib]

PostPosted: Tue Aug 04, 2015 07:32
by rubenwardy
This mod iterates over all LuaEntities - there could easily be thousands if you use a sign mod. You also don't actually check that the area has been loaded correctly.

I made a mod like this which allows the forceloads to be made persistent over server restarts. Here is the code: https://github.com/rubenwardy/forceload ... nit.lua#L9

Re: [Mod] Forceload Lib [forceload_lib]

PostPosted: Thu Aug 06, 2015 11:47
by orwell
Thanks!
I have seen this mod some time ago.
I will look at your code to improve my mod.

Thousands of signs on a server? I think the on_step of these signs will consume much more time than my iteration.
The mod was originally (or still is) a helper for my elevator mod. (see [url]forum.minetest.net/viewtopic.php?t=12944[/url])