OK, I coded in a couple of changes...
First, I commented out the section in the Spawn function that sets texture and helmtexture to 255.
Second, I added code into the LoadBot function after the bot object is created. This new code checks for non-standard race, and if the race is non-standard it sets texture and helmtexture to equal face value, and sets gender to 2. If, however, it is a standard race, then it sets texture and helmtexture to 255 and leaves gender unchanged.
I compiled and tested with that setup. I found that non-standard race models now work correctly instead of displaying generic humans, so the issue was definitely because the bots were using a gender value other than 2. However, I also found that the face value for the bots affects their skin texture. So taking the puma/panther race as an example again, race 439, setting up so that it has face 3 the LoadBot function will set texture to 3, helmtexture to 3, and race to 2, but when the bot spawns it has the standard puma skin, not the black panther skin that it should have from texture 3 and helmtexture 3. Using #bot face command to set face to 0 then causes the skin to change and correctly display as a black panther, but also overrides the bot size value to the race default size value. This also results in having a face value for the bot database entry changed to a 0 as well, so future spawn would have the wrong skin texture either way.
This suggests that it may not be possible to have a bot that is of a non-standard race, and that also has a skin texture other than the default of 0. I thought I might be able to correct this by sending an illusion packet for the correct values (3 for texture and helmtexture, but 0 for face), but I found that this also modifies the bot entry in the database. I tried modifying the SendIllusionPacket function so that it stores the original face value from the MOB, modifies it per the parameters in the function call, and then sets it back to original again after the entity_list has been updated. Unfortunately, that resulted in still having the wrong skin texture in-game, as though the face value being reset back to original affects the MOB even after the entity_list entry has been updated.
I'm not sure I can make the necessary changes to make it work with the desired texture and helmtexture values for values other than 0. I'd definitely like some suggestions on how that might be accomplished. In the meantime I'm going to look through the bot command for #bot face and see if that gives me any ideas.
Drake Phoenix
|