Remotely loading an entity? [SOLVED]

Post Reply
User avatar
ElCeejo
Member
Posts: 210
Joined: Thu Feb 28, 2019 23:29
GitHub: ElCeejo
In-game: ElCeejo
Location: Your Mother's house

Remotely loading an entity? [SOLVED]

by ElCeejo » Post

I'm looking for a way to load an entity if no players are nearby, simple as that. I've tried using minetest.forceload_block() but I can't get that to work, not sure if I'm doing something wrong but it never succeeds in forceloading.
Last edited by ElCeejo on Mon Oct 19, 2020 04:03, edited 1 time in total.

u18398

Re: Remotely loading an entity?

by u18398 » Post

ElCeejo wrote:
Sat Oct 17, 2020 04:04
I'm looking for a way to load an entity if no players are nearby, simple as that. I've tried using minetest.forceload_block() but I can't get that to work, not sure if I'm doing something wrong but it never succeeds in forceloading.
That is what I use in my mod aviator and there it works for me. Maybe you would like to take a look in my code.
It is already 2 or more years old, so I do not exactly remember how I did it.

User avatar
ElCeejo
Member
Posts: 210
Joined: Thu Feb 28, 2019 23:29
GitHub: ElCeejo
In-game: ElCeejo
Location: Your Mother's house

Re: Remotely loading an entity?

by ElCeejo » Post

Looks like your code just attempt to forceload a block if a local variable is true. In my case this doesn't seem to work, I have to be doing something wrong but I can't find any sort of documentation explaining why it would fail.

u18398

Re: Remotely loading an entity?

by u18398 » Post

ElCeejo wrote:
Sat Oct 17, 2020 18:25
Looks like your code just attempt to forceload a block if a local variable is true. In my case this doesn't seem to work, I have to be doing something wrong but I can't find any sort of documentation explaining why it would fail.
the variable controls if the radius of aviator is bigger then server active_block_range setting and if it is
the block is forceloaded.
there is a setting in minetest.conf concerning max_forceloaded_blocks. I had to increase it to a higher number
(maybe 1000 I did ?) to make it work.

User avatar
ElCeejo
Member
Posts: 210
Joined: Thu Feb 28, 2019 23:29
GitHub: ElCeejo
In-game: ElCeejo
Location: Your Mother's house

Re: Remotely loading an entity?

by ElCeejo » Post

Huh, looks like I was trying to forceload too many blocks. Lowering it from 32x32x32 to 4x4x4 worked. Thanks for the help!

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests