[Mod] Forceload Lib [forceload_lib]

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

[Mod] Forceload Lib [forceload_lib]

by orwell » Fri Jul 31, 2015 08:45

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 38 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...
 

User avatar
Minetestforfun
Member
 
Posts: 936
Joined: Tue Aug 05, 2014 14:09
Location: On earth
GitHub: Darcidride
IRC: Darcidride + MinetestForFun
In-game: Darcidride + MinetestForFun
 

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

Re: [Mod] Forceload Lib [forceload_lib]

by orwell » Mon Aug 03, 2015 15:22

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: 5752
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Forceload Lib [forceload_lib]

by rubenwardy » Tue Aug 04, 2015 07:32

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
 

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

Re: [Mod] Forceload Lib [forceload_lib]

by orwell » Thu Aug 06, 2015 11:47

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


Return to WIP Mods



Who is online

Users browsing this forum: runs and 4 guests