Textures in CSM

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

Textures in CSM

by matyilona200 » Post

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

User avatar
Lone_Wolf
Member
Posts: 2578
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: Textures in CSM

by Lone_Wolf » Post

You may have to put the textures in a texturepack (Inside Minetest/textures) for it to work
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

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

Re: Textures in CSM

by matyilona200 » Post

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: 2578
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: Textures in CSM

by Lone_Wolf » Post

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
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

User avatar
PolySaken
Member
Posts: 817
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: Textures in CSM

by PolySaken » Post

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
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.

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

Re: Textures in CSM

by Miniontoby » Post

Just move the textures into the textures folder of mt and enable it and then you can use it.

I also use that method
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests