[csm] Location markers [locations_markers_csm]

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

Re: [csm] Location markers [locations_markers_csm]

by Monika_Miyazaki » Fri Nov 08, 2019 07:27

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: 263
Joined: Fri Mar 01, 2019 19:25
Location: The Netherlands
In-game: Miniontoby

Re: [csm] Location markers [locations_markers_csm]

by Miniontoby » Fri Nov 08, 2019 14:42

I hope it also
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell"
 

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

Re: [csm] Location markers [locations_markers_csm]

by Monika_Miyazaki » Fri Nov 08, 2019 21:35

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.
Image
Attachments
2019-11-09 00_33_17.png
(6.82 KiB) Not downloaded yet
Just Monika!
 

User avatar
Lone_Wolf
Member
 
Posts: 2216
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf

Re: [csm] Location markers [locations_markers_csm]

by Lone_Wolf » Sat Nov 09, 2019 00:24

@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
Content DB -|- Working on Voxel Knights
 

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

Re: [csm] Location markers [locations_markers_csm]

by Monika_Miyazaki » Sat Nov 09, 2019 08:11

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: 263
Joined: Fri Mar 01, 2019 19:25
Location: The Netherlands
In-game: Miniontoby

Re: [csm] Location markers [locations_markers_csm]

by Miniontoby » Sat Nov 09, 2019 15:32

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
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell"
 

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

Re: [csm] Location markers [locations_markers_csm]

by zing269 » Sat Nov 09, 2019 20:12

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: 263
Joined: Fri Mar 01, 2019 19:25
Location: The Netherlands
In-game: Miniontoby
 

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

Re: [csm] Location markers [locations_markers_csm]

by Monika_Miyazaki » Sun Nov 10, 2019 12:15

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: 2216
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf

Re: [csm] Location markers [locations_markers_csm]

by Lone_Wolf » Sun Nov 10, 2019 15:50

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
Content DB -|- Working on Voxel Knights
 

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

Re: [csm] Location markers [locations_markers_csm]

by Monika_Miyazaki » Sun Nov 10, 2019 16:52

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: 89
Joined: Sat Apr 30, 2016 19:10

Re: [csm] Location markers [locations_markers_csm]

by zing269 » Sun Nov 10, 2019 20:58

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.
 

Previous

Return to Client-side modding



Who is online

Users browsing this forum: No registered users and 2 guests