Mod works, identical code does not work client-side

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

Mod works, identical code does not work client-side

by KCoombes » Post

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: 6085
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

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

by rubenwardy » Post

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

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

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

by KCoombes » Post

Your link is a 404

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

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

by rubenwardy » Post

Fixed

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest