RaphaelIT7 / gmod-holylib

A library that contains some functions and optimizations for gmod.
46 stars 4 forks source link

SubMaterial #18

Closed DatGuy64 closed 2 weeks ago

DatGuy64 commented 2 weeks ago

Hi, currently in gmod you can't use SetSubMaterial on index superior to 31. is this something you can achieve ?

image

RaphaelIT7 commented 2 weeks ago

If I remember correctly, submaterials internally used an array internally to set & network it. Funnily enough, it uses the networkstrings like many other functions which means it's also limited to 4096 unique strings which is shared with stuff like util.AddNetworkString, NW and so on.

So I don't think I can do anything about that.

From what I found all that time ago:

    const char* m_SubMaterials[32];
    int m_SubMaterialIndex[32]; // This is the index for the string in the networkstring stringtable -> util.NetworkIDToString(i) == m_SubMaterials[i]

But with the last net compact update this might have changed internally.