[csm] Location markers [locations_markers_csm]

User avatar
Monika_Miyazaki
Member
Posts: 28
Joined: Sun Sep 22, 2019 17:21
In-game: Monika_Miyazaki
Location: Moscow, Russia

Re: [csm] Location markers [locations_markers_csm]

by Monika_Miyazaki » Post

Krock wrote:
Monika_Miyazaki wrote:The developers are surely aware of this.
No, there's yet no report of such an issue.
I created an issue https://github.com/minetest/minetest/issues/9091 on GitHub. So that this problem can be solved faster.
PS. Sad to hear that even the developer did not know about this error. Although it has been around for 1 year already (maybe more). I can and will be wrong, but I've seen this mistake in some other CSM mods.
Just Monika!

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [csm] Location markers [locations_markers_csm]

by Miniontoby » Post

I hope it also
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
Monika_Miyazaki
Member
Posts: 28
Joined: Sun Sep 22, 2019 17:21
In-game: Monika_Miyazaki
Location: Moscow, Russia

Re: [csm] Location markers [locations_markers_csm]

by Monika_Miyazaki » Post

Monika_Miyazaki wrote:
Krock wrote:
Monika_Miyazaki wrote:The developers are surely aware of this.
No, there's yet no report of such an issue.
I created an issue https://github.com/minetest/minetest/issues/9091 on GitHub. So that this problem can be solved faster.
PS. Sad to hear that even the developer did not know about this error. Although it has been around for 1 year already (maybe more). I can and will be wrong, but I've seen this mistake in some other CSM mods.
Issue was closed. And the mod question isn't settled.
Last edited by Monika_Miyazaki on Sun Jan 19, 2020 21:55, edited 1 time in total.
Just Monika!

User avatar
Lone_Wolf
Member
Posts: 2578
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [csm] Location markers [locations_markers_csm]

by Lone_Wolf » Post

@Monika_Miyazaki: Remember this is a client side mod. Not a mod. From the error you posted it looks like you put the clientside mod in the mods folder
This topic helps with installing clientside mods: viewtopic.php?f=53&t=17830

The error is due to the CSM not checking if minetest.localplayer is nil. I'm pretty sure they said that in the github issue
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

User avatar
Monika_Miyazaki
Member
Posts: 28
Joined: Sun Sep 22, 2019 17:21
In-game: Monika_Miyazaki
Location: Moscow, Russia

Re: [csm] Location markers [locations_markers_csm]

by Monika_Miyazaki » Post

Lone_Wolf wrote:@Monika_Miyazaki: Remember this is a client side mod. Not a mod. From the error you posted it looks like you put the clientside mod in the mods folder
This topic helps with installing clientside mods: viewtopic.php?f=53&t=17830

The error is due to the CSM not checking if minetest.localplayer is nil. I'm pretty sure they said that in the github issue
Actually, the mod is set correctly. I know how to install the CSM mod(I'm not an idiot).
And the mods folder is so empty.
Just Monika!

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [csm] Location markers [locations_markers_csm]

by Miniontoby » Post

I make a CSM for someone and that code doesn't work as CSM, but it does work as a normal mod.

I conclude that the code of csm's is other than an normal mod or than the older csm mod codes

But I think that also all the "minetest." functions doesn't work
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

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

Re: [csm] Location markers [locations_markers_csm]

by zing269 » Post

I modified the minetest.register_globalstep function

Code: Select all

minetest.register_globalstep( function( dtime )

	-- wait until the player exists
	while not player do
		player = minetest.localplayer
	end

	--registering key presses
That removed the error but as soon as I set a marker my screen goes completely gray. I'm assuming the grayness is a different issue.

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [csm] Location markers [locations_markers_csm]

by Miniontoby » Post

Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
Monika_Miyazaki
Member
Posts: 28
Joined: Sun Sep 22, 2019 17:21
In-game: Monika_Miyazaki
Location: Moscow, Russia

Re: [csm] Location markers [locations_markers_csm]

by Monika_Miyazaki » Post

zing269 wrote:I modified the minetest.register_globalstep function

Code: Select all

minetest.register_globalstep( function( dtime )

	-- wait until the player exists
	while not player do
		player = minetest.localplayer
	end

	--registering key presses
That removed the error but as soon as I set a marker my screen goes completely gray. I'm assuming the grayness is a different issue.
Yeah. Totally gray screen is a mistake, too, but it's a different kind of mistake. An error during the gray screen can be seen in the console where there are explanations.
Just Monika!

User avatar
Lone_Wolf
Member
Posts: 2578
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [csm] Location markers [locations_markers_csm]

by Lone_Wolf » Post

zing269 wrote:I modified the minetest.register_globalstep function

Code: Select all

minetest.register_globalstep( function( dtime )

	-- wait until the player exists
	while not player do
		player = minetest.localplayer
	end

	--registering key presses
That removed the error but as soon as I set a marker my screen goes completely gray. I'm assuming the grayness is a different issue.
Don't use a while loop. That will freeze the entire client until player exists. Do this instead:

Code: Select all

minetest.register_globalstep( function( dtime )

	-- wait until the player exists
	if not player and not minetest.localplayer then
		return
	elseif not player then
		player = minetest.localplayer
	end

	--registering key presses
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

User avatar
Monika_Miyazaki
Member
Posts: 28
Joined: Sun Sep 22, 2019 17:21
In-game: Monika_Miyazaki
Location: Moscow, Russia

Re: [csm] Location markers [locations_markers_csm]

by Monika_Miyazaki » Post

Lone_Wolf wrote: Don't use a while loop. That will freeze the entire client until player exists. Do this instead:

Code: Select all

minetest.register_globalstep( function( dtime )

	-- wait until the player exists
	if not player and not minetest.localplayer then
		return
	elseif not player then
		player = minetest.localplayer
	end

	--registering key presses
This code does not help to make a mod work normally. And I know where to insert it in the init.lua script.
When the mark is entered via the W+S+LMB command, the grey screen appears. The error is only visible in the console. MT 5.2.0 dev.
Just Monika!

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

Re: [csm] Location markers [locations_markers_csm]

by zing269 » Post

The problem is that localplayer does not exist when the mod is loaded so the lines "local player = minetest.localplayer" that are outside of any function will set player to nil. "player" must either be initialized inside of each function that uses it or pass it as a parameter.


@Lone_Wolf - Yeah, the while loop is not the way to go.


edit:

By adding Lone_Wolf's code to every function that uses "player" I have gotten the mod to mostly work, it doesn't seem to save the markers. Most likely modstorage related.

User avatar
Monika_Miyazaki
Member
Posts: 28
Joined: Sun Sep 22, 2019 17:21
In-game: Monika_Miyazaki
Location: Moscow, Russia

Re: [csm] Location markers [locations_markers_csm]

by Monika_Miyazaki » Post

A Pull request was created that corrects all problems with the initialization of the player.
I expect the Pull request to be accepted soon.
PS. GitHub account from which the Pull request from EvolutionPixG was made is not mine, but my friend's.
Last edited by Monika_Miyazaki on Sun Jan 19, 2020 21:31, edited 1 time in total.
Just Monika!

Evolution_Pixels
New member
Posts: 7
Joined: Tue Jan 14, 2020 08:14
Location: Russian Federation

Re: [csm] Location markers [locations_markers_csm]

by Evolution_Pixels » Post

Monika_Miyazaki wrote:A Pull request was created that corrects all problems with the initialization of the player.
I expect the Pull request to be accepted soon.
PS. GitHub account from which the Pull request from Evolution Pixels was made is not mine, but my friend's.
Corrected. Done. I don't understand why it wasn't fixed before.

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [csm] Location markers [locations_markers_csm]

by Miniontoby » Post

Now the code does work

I have changed it and I attached it to my post
locations_markers_csm.zip
the working one
(15.55 KiB) Downloaded 73 times
P.S. You need to have already the texture pack installed, because I didn't attached the textures
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

Evolution_Pixels
New member
Posts: 7
Joined: Tue Jan 14, 2020 08:14
Location: Russian Federation

Re: [csm] Location markers [locations_markers_csm]

by Evolution_Pixels » Post

Miniontoby wrote:Now the code does work

I have changed it and I attached it to my post
locations_markers_csm.zip
P.S. You need to have already the texture pack installed, because I didn't attached the textures
This fix has already been sent to PR in the GitHub mod repository.
Read the two messages above(in case you just haven't noticed).
I'm still waiting for PR to be accepted into the repository by the author mod.

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [csm] Location markers [locations_markers_csm]

by Miniontoby » Post

I already know and I made a zip with your code so that while everyone is waiting until the author is accept it you have the good code
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

matyilona200
Member
Posts: 14
Joined: Sun May 20, 2018 14:41
GitHub: matyilona

Re: [csm] Location markers [locations_markers_csm]

by matyilona200 » Post

Sorry for neglecting the mod, and thank you for the fix!
I added the fix, and moved the repo over to mesehub.

User avatar
The32bitguy
Member
Posts: 42
Joined: Sun Mar 29, 2020 00:36
GitHub: The32bitguy
In-game: TaxCollector
Location: Australia

Re: [csm] Location markers [locations_markers_csm]

by The32bitguy » Post

Monika_Miyazaki wrote:
Fri Oct 11, 2019 10:28
Monika_Miyazaki wrote:This csm mod does not work on minetest 5.1.0 rc1.

Image

03.10.19_15.58.png
I see that nobody cares about this mistake.
And nobody wants to help.
Nice formating, you should ask for your money back.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest