How do I create seperate materials in the game engine?

I humbly request assistance with a material problem I am having.
The character I have uses a script that swaps a texture in the
material for another image, but all instances of this character in
the game engine also change their materials. This character is
to be used in a self-populating town and I need each character to
change their materials individually for some randomness in my characters.
Creating multiple characters is not an option because the town might
contain ~35*4 characters at the most (spread out and using LOD) and
~5**4 material combinations. I read that


obj['dummytexture'] = VideoTexture.Texture()
obj['dummytexture'].source = logic.grouptexture

could help, but I would like to know if there are any other options (like creating a material in the bge) or an example of the previous solution. I am currently using a terminal that is not mine;
so I cannot check at the moment.