The other thread:
remapshader and player skins - does it work?
But I think Berzerkr already knows this one.
remapshader... anything I'm missing?
Looking further I could be partly incorrect. It looks like G_ShaderIndex and G_FindConfigstringIndex don’t just find the index but actually write the names in the config too. And because G_FindConfigstringIndex first tries to find the name before adding it, it might be possible to do more than 16 original shaders PROVIDING that the sum of different shader names (original and new) don’t exceed 32. If correct you could replace 16 shaders with 16 other shaders or you could replace 31 shaders with just one new shader. But I still come back to nothing appears to reset remappedShaders nor remapCount so you can’t get close to the 128 limit.
Regarding that 128 limit. I was initially thinking that was the limit for remapshader commands in the script as well. However, after running into the 16 shader limit so quickly, I believe now that the 128 limitation is for misc_models. In my first map, I used several lantern .md3 models that I downloaded that I believe were originally designed to be used in quake maps and as such, were looking for quake textures. I used a remap in each of the models to point each texture on the lanterns to new shaders.
Each of those .md3 models had the remap included as a key/value in their entity. However, I can’t remember if each copy of the model counts as 1 remap individually, or if all instances of the same model using the same remap key/value counts as 1.
My map contained at least 16-20 of those lamps, each one had 2 remap keys in them.
This limit (max 128) of remapshader calls is actually related to different shaders see AddRemap() function but you won’t get noticed about reaching the limit. I’ve added a warning in that case for ET:Legacy and I’ve also fixed the issue TomTom7777 mentioned: Vanilla doesn’t reset the num/remapshader array. We did run into issues with baserace_desert after starting bremen_final: The configstring has had remapshader entries from the previous map. Fix: http://www.etlegacy.com/projects/etlegacy/repository/revisions/ad9db31af78394f5c0ef048b512bd7f29e0a9d0c/diff/src/game/g_utils.c?utf8=✓&type=sbs
Hint for mappers: When you develop ‘remapshader’ with vanilla mod don’t run any other map before.