[mod] Simple Anchor [simple_anchor]

zing269
Member
 
Posts: 69
Joined: Sat Apr 30, 2016 19:10

[mod] Simple Anchor [simple_anchor]

by zing269 » Sun Mar 18, 2018 17:50

A node that keeps the map block it is in loaded when players are not near by.

Image

Image

Place the node to add its location to the force load list. Remove the node to remove it from the list. Punch it to see the area.

Area display based on Protector Redo by TenPlus1

Download: https://github.com/zing269/simple_ancho ... master.zip
Source: https://github.com/zing269/simple_anchor

Licenses: MIT and CC BY
Attachments
simple_anchor_2.png
(366.34 KiB) Not downloaded yet
simple_anchor_1.png
(502.66 KiB) Not downloaded yet
 

Chem871
Member
 
Posts: 870
Joined: Sat Aug 19, 2017 21:49
Location: SCP-2935
GitHub: Chemguy99
In-game: Nyx Serris

Re: [mod] Simple Anchor [simple_anchor]

by Chem871 » Sun Mar 18, 2018 17:53

Sounds useful for singleplayer farms, nice.
What is SCP-055 again? I forgot.
 

zing269
Member
 
Posts: 69
Joined: Sat Apr 30, 2016 19:10

Re: [mod] Simple Anchor [simple_anchor]

by zing269 » Sun Mar 18, 2018 21:04

Chem871 wrote:Sounds useful for singleplayer farms, nice.


That is the reason I wrote it. All the other mods I found seemed overly complicated for my usage.
 

User avatar
RSLRedstonier
Member
 
Posts: 449
Joined: Wed May 10, 2017 21:00
Location: some were in middle earth
GitHub: RSL-Redstonier
In-game: RSLRedstonier

Re: [mod] Simple Anchor [simple_anchor]

by RSLRedstonier » Mon Mar 19, 2018 00:34

does it load the area EXCACLTLY like a player would, or is it pseudo loading?(

also love the area grid
"A programmer is just a tool which converts caffeine into code"

try out my skytest mod always being updated!
https://forum.minetest.net/viewtopic.php?f=9&t=17568
 

zing269
Member
 
Posts: 69
Joined: Sat Apr 30, 2016 19:10

Re: [mod] Simple Anchor [simple_anchor]

by zing269 » Mon Mar 19, 2018 01:08

RSLRedstonier wrote:does it load the area EXCACLTLY like a player would, or is it pseudo loading?(

also love the area grid


Honestly, that is pure speculation on my part. I call get_voxel_manip on the position of the node and use get_emerged_area to get the pmin and pmax of the actual loaded area. I'm assuming that the engine loads areas in a similar manner to get_voxel_manip but I could easily be wrong. I haven't looked through the actual engine code to confirm my suppositions.

I can't take credit for the area grid, I took that almost entirely from TenPlus1's Protection Redo.
 

User avatar
RSLRedstonier
Member
 
Posts: 449
Joined: Wed May 10, 2017 21:00
Location: some were in middle earth
GitHub: RSL-Redstonier
In-game: RSLRedstonier

Re: [mod] Simple Anchor [simple_anchor]

by RSLRedstonier » Mon Mar 19, 2018 16:11

zing269 wrote:I can't take credit for the area grid, I took that almost entirely from TenPlus1's Protection Redo.

but it was YOUR idea to include it which means while TenPlus1 made the original code you decided to modifi and use it
"A programmer is just a tool which converts caffeine into code"

try out my skytest mod always being updated!
https://forum.minetest.net/viewtopic.php?f=9&t=17568
 

User avatar
cx384
Member
 
Posts: 492
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: [mod] Simple Anchor [simple_anchor]

by cx384 » Wed Mar 28, 2018 08:53

Nice mod, there is already a forceload mod but the show area function is very helpful.
viewtopic.php?t=10006
Can your read this?
 

zing269
Member
 
Posts: 69
Joined: Sat Apr 30, 2016 19:10

Re: [mod] Simple Anchor [simple_anchor]

by zing269 » Wed Mar 28, 2018 20:13

cx384 wrote:Nice mod, there is already a forceload mod but the show area function is very helpful.
viewtopic.php?t=10006


Thanks. I looked at that mod but decided I wanted a simpler mechanism.

That mod keeps a list of force loaded positions in a file and uses a globalstep to validate each position. This method is undoubtedly more robust than my implementation since the validation will remove a position if the anchor node is removed by any means.

In my mod the node is only removed if the anchor node's on_destruct callback fires, but there is no globalstep or additional file involved.
 


Return to WIP Mods



Who is online

Users browsing this forum: doyousketch2, texmex and 6 guests