Mod works, identical code does not work client-side

KCoombes
Member
 
Posts: 395
Joined: Thu Jun 11, 2015 23:19
Location: SW Florida, USA
In-game: Knatt

Mod works, identical code does not work client-side

by KCoombes » Mon Apr 09, 2018 19:13

I wrote a simple code to place a HUD image on the screen. As a typical mod, it functions exactly as expected. However, using the exact same code as a CSM, I get the following error:

ERROR[Main]: ...est-0.4.16-win32-msvc\bin\..\clientmods\box\init.lua:1: attempt to call field 'register_on_joinplayer' (a nil value)

Any ideas?
 

User avatar
rubenwardy
Moderator
 
Posts: 5364
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Mod works, identical code does not work client-side

by rubenwardy » Mon Apr 09, 2018 19:16

As the error suggests, that function does not exist. Learning to read error messages is rather important as a programming skill

Have a look here for available functions: https://github.com/minetest/minetest/bl ... ua_api.txt
Core Developer | Donate | My Twitter | Mods | Mods 4 Android | Node Box Editor | Minetest Modding Book

Hello profile reader

LgiOxMFYXOqtqVqMPhbw1Bn3oNRvEC7j
 

KCoombes
Member
 
Posts: 395
Joined: Thu Jun 11, 2015 23:19
Location: SW Florida, USA
In-game: Knatt
 

User avatar
rubenwardy
Moderator
 
Posts: 5364
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
 


Return to Client-side modding



Who is online

Users browsing this forum: No registered users and 1 guest