[csm] Location markers [locations_markers_csm]

User avatar
Monika_Miyazaki
Member
 
Posts: 28
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: 329
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: 28
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.
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: 2272
Joined: Sun Apr 09, 2017 05:50
Location: Not there, THERE!
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
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: 28
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: 329
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: 107
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: 329
Joined: Fri Mar 01, 2019 19:25
Location: The Netherlands
In-game: Miniontoby
 

User avatar
Monika_Miyazaki
Member
 
Posts: 28
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: 2272
Joined: Sun Apr 09, 2017 05:50
Location: Not there, THERE!
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
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: 28
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: 107
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.
 

User avatar
Monika_Miyazaki
Member
 
Posts: 28
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 Jan 19, 2020 21:21

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!
 

User avatar
Evolution_Pixels
New member
 
Posts: 6
Joined: Tue Jan 14, 2020 08:14
Location: Moscow, Russia
GitHub: EvolutionPixG
In-game: EvolutionPixG

Re: [csm] Location markers [locations_markers_csm]

by Evolution_Pixels » Sun Jan 19, 2020 21:30

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.
RU: Простота залог надёжности любого софта или игры! EN: Simplicity pledge of reliability of any software or game!
 

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

Re: [csm] Location markers [locations_markers_csm]

by Miniontoby » Mon Jan 20, 2020 13:53

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 4 times


P.S. You need to have already the texture pack installed, because I didn't attached the textures
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell"
 

User avatar
Evolution_Pixels
New member
 
Posts: 6
Joined: Tue Jan 14, 2020 08:14
Location: Moscow, Russia
GitHub: EvolutionPixG
In-game: EvolutionPixG

Re: [csm] Location markers [locations_markers_csm]

by Evolution_Pixels » Mon Jan 20, 2020 15:04

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.
RU: Простота залог надёжности любого софта или игры! EN: Simplicity pledge of reliability of any software or game!
 

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

Re: [csm] Location markers [locations_markers_csm]

by Miniontoby » Tue Jan 21, 2020 08:21

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

Previous

Return to Client-side modding



Who is online

Users browsing this forum: No registered users and 0 guests