Remotely loading an entity? [SOLVED]

Post Reply
User avatar
ElCeejo
Member
Posts: 75
Joined: Thu Feb 28, 2019 23:29
GitHub: ElCeejo
In-game: ElCeejo
Location: In a Dragons Lair

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.

Gundul
Member
Posts: 1022
Joined: Thu Aug 27, 2015 10:55
GitHub: berengma
IRC: Gundul
Location: Europe/Asia

Re: Remotely loading an entity?

by Gundul » 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.
My servers: Jungle, Lilly in the valley, 3xile

User avatar
ElCeejo
Member
Posts: 75
Joined: Thu Feb 28, 2019 23:29
GitHub: ElCeejo
In-game: ElCeejo
Location: In a Dragons Lair

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.

Gundul
Member
Posts: 1022
Joined: Thu Aug 27, 2015 10:55
GitHub: berengma
IRC: Gundul
Location: Europe/Asia

Re: Remotely loading an entity?

by Gundul » 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.
My servers: Jungle, Lilly in the valley, 3xile

User avatar
ElCeejo
Member
Posts: 75
Joined: Thu Feb 28, 2019 23:29
GitHub: ElCeejo
In-game: ElCeejo
Location: In a Dragons Lair

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: Google [Bot] and 2 guests