Edit Texture not in First Slot

I’m trying to edit textures in the game. Unfortunately, texture.materialID and texture.Texture apparently only work if the texture your trying to edit with is in the first (top) texture slot. I need my texture to be in a slot further down since the texture order affects the way the material appears.

I’ve gone as far as looking at the source code for texture initialization, and it appears that it only uses 0 as the material texture index.

Anyone know if there’s any way around this or if there are plans to add the ability to specify which texture slot to use in a future release?

You’re talking about using bge.texture, right? It’s not documented in the 2.6 docs, but I believe you can add a parameter in the bge.texure.Texture() call to use a different channel:

VideoTexture.Texture(obj, matID, textureID)

This is pretty much the only place where I think the BGE could use better documentation. The bge.texture area is rather sparsely filled out. The Python API seems to be generated automatically, so it would require patches to fix them up, but the Wiki doesn’t seem to contain the same information (the API).

Thanks SolarLune, that seems to work fine.

I was pretty annoyed by the API for bge.texture as well. It’s missing a lot of stuff, and the things that are there aren’t very well documented or explained. Hopefully it gets improved in the future.