[Mod] Forceload Lib [forceload_lib]

Post Reply
User avatar
orwell
Member
Posts: 958
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

[Mod] Forceload Lib [forceload_lib]

by orwell » Post

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
Attachments
forceload_lib.zip
(2.11 KiB) Downloaded 127 times
Last edited by orwell on Mon Jan 11, 2016 21:40, edited 1 time in total.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

Minetestforfun
Member
Posts: 940
Joined: Tue Aug 05, 2014 14:09
GitHub: MinetestForFun
IRC: MinetestForFun
In-game: MinetestForFun
Location: On earth
Contact:

Re: [Mod] Forceload Lib [forceload_lib]

by Minetestforfun » Post

Hi,

Great work.

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

User avatar
orwell
Member
Posts: 958
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: [Mod] Forceload Lib [forceload_lib]

by orwell » Post

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?
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

User avatar
rubenwardy
Moderator
Posts: 6978
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: [Mod] Forceload Lib [forceload_lib]

by rubenwardy » Post

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
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
orwell
Member
Posts: 958
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: [Mod] Forceload Lib [forceload_lib]

by orwell » Post

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 forum.minetest.net/viewtopic.php?t=12944)
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests