Textures in CSM

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

Textures in CSM

by matyilona200 » Sat Jun 15, 2019 10:50

Looking through client_lua_api.txt I don't see any mention of textures. I tried adding them in the textures folder like in a ssm, but it did not work, I get "Could not load image xyz while building texture; Creating a dummy image". Is there any way of adding new textures in a csm, for use with formspecs/hud? I added a mwe, which just tries to adds a hud element with an image.
Attachments
csm_texture_mwe.zip
(1.11 KiB) Downloaded 29 times
 

User avatar
Lone_Wolf
Member
 
Posts: 2248
Joined: Sun Apr 09, 2017 05:50
Location: Not there, THERE!
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf

Re: Textures in CSM

by Lone_Wolf » Sat Jun 15, 2019 20:35

You may have to put the textures in a texturepack (Inside Minetest/textures) for it to work
Content DB -|- Working on Voxel Knights
 

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

Re: Textures in CSM

by matyilona200 » Wed Jun 26, 2019 20:16

That's a good workaround, but I'd like to have it bundled in the mod.
The example file structure of a csm suggests that it can have textures, although the client_lua_api.txt does not seem to show it.

An other problem which I think is related is using dofile() in a csm.
In a server side mod, I can use get_modpath() with get_current_modname() and append the filename that I want to include.
I tried
Code: Select all
dofile("file.lua")
dofile("modname/file.lua")
dofile("clientmods/modname/file.lua")

All return "Coudln't find script" errors.

It all seems connected to how clientmods are interpreted, I'll try looking into it a bit more and see if there are any issues on github that could be related.
 

User avatar
Lone_Wolf
Member
 
Posts: 2248
Joined: Sun Apr 09, 2017 05:50
Location: Not there, THERE!
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf

Re: Textures in CSM

by Lone_Wolf » Wed Jun 26, 2019 20:19

matyilona200 wrote:That's a good workaround, but I'd like to have it bundled in the mod.
The example file structure of a csm suggests that it can have textures, although the client_lua_api.txt does not seem to show it.

A lot of the CSM doc is just copied from the SSM doc. This has lead to a few confusing cases like this
Content DB -|- Working on Voxel Knights
 

User avatar
PolySaken
Member
 
Posts: 425
Joined: Thu Nov 09, 2017 05:18
Location: djelibabi
GitHub: PolySaken-I-Am
In-game: PolySaken

Re: Textures in CSM

by PolySaken » Sat Nov 16, 2019 05:32

As far as I know you'll have to use a full path for everything since a dump of the core table doesn't seem to give a get_path function for mods or worlds
there is a get_builtin_path function, but it doesn't seem to lead to the builtin folder or root folder of minetest
 


Return to Client-side modding



Who is online

Users browsing this forum: No registered users and 1 guest