View Full Version : Face texture animation
I am working on a Resident Evil mod.
Now I want my zombies to change faces while attacking player. I know the command to animate textures but I don’t understand how its parameters work. I mean, how can I tell the routine to switch from “zombie_face_default.jpg” to “zombie_face_byte.jpg” ?
HairlessWookie
11-25-2002, 06:28 AM
Im not sure exactly how this works, but i do know that the jpegs for animating facetextures are defined in the skin's .kfs file somehow in 3dsmax. Each of the jpegs is assigned an animation frame. the acceptible frame numbers are 0-3, 0 being default(i think).
I'm not sure if you can use more than 0-3, but thats all remedy uses.
c_animatetexture(0,3,2)
c_animatetexture(face_ID, Frame_#, Time)
I'm not 100% sure if this is how it works but if you open a remedy-made .kfs file in wordpad you will see the names of the jpegs. But if you use milkshape for making skins, and open with wordpad, you will not see those. Same thing for alpha textures.
[ 11-25-2002, 06:33 AM: Message edited by: HairlessWookie ]
Maddieman
11-25-2002, 07:55 AM
C_AnimateTexture ( int textureGroup, int textureFrame, float time );
textureGroup: TextureAnimation index defined for the skin. Face is always index 0.
textureFrame: Which frame to display.
time: How many seconds the new frame is displayed until reverted to the previous one. Using 0 here makes the texture change permanent.
player->C_AnimateTexture( 0, 1, 0.5 );
<font size="2" face="Verdana, Arial">So the first parameter tells the game that you want to change the face texture; the second one tells it which texture to change it to (0 - default, 1 - grin, 2 - dead, 3 - wounded; near enough - you'll need to experiment with it), and the third tells it the duration (0 is permanent).
However, the thing I want to know is: is it possible to change the other texturegroups (i.e. the body)? http://forums.3drealms.com/ubb/icons/icon123.gif
I've tried a few times to get this working, to no avail, and I'm starting to wonder if it even is possible. If it isn't then that sort of makes the first parameter redundant.
Hearlesswookie is right. When you export skin from milkshape you cannot edit jpegs names in ASCII. So, how can I associate the textureFrame value (default, grin, dead, etc.) to the relative jpegs ?
I tried to name my jpegs as zombie1_default, zombie1_grin, etc but it doesn’t work…
Moreover I would like to create a texture set that uses different skins with the same model. I know how the script works (e.g. nypd.txt) but I don’t know how to build them using milkshape 3D. In truth, I was never able to import different kfs sets.
Maddieman
11-25-2002, 11:36 AM
Ok, first off, character random sets are defined with this code:
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> [TextureSet]
ExportData = Doe_Johnny_Set02.kfs;
[TextureSet]
ExportData = Doe_Johnny_Set01.kfs;
[TextureSet]
ExportData = Doe_Johnny_Set04.kfs;
[TextureSet]
ExportData = Doe_Johnny_Set03.kfs;
[TextureSet]
ExportData = Doe_Johnny_Set05.kfs;
[/code]</blockquote><font size="2" face="Verdana, Arial">Which means you need to export your model to different filenames with a different textures assigned to the materials. 3ds max allows you to select which aspects of a model you want to export (eg. geometry, materials, animation, etc) so I expect that you're supposed to export with only the materials checked. However, you may still be able to do this in milkshape, by exporting the entire model, and hope that the Max engine only reads the material data.
As for face textures, it appears that StratonAce has got it working (he's using brand new skins, not just replacing the old ones) but unfortunately the images/expressions are all the same - so I can't test it properly. Strat was using Milkshape at the time of that build so, if it does work he'd be the one to ask. However, I seem to remember an animated textures option in 3ds max; maybe I'll check it out sometime. The problem is, I can't import or export kfs files, so I can't really use it even if it does work.
This is the relavent code in the skin file:
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> [TextureAnimation]
Texturename = "FaceTexture";
GroupIndex = 0;
Character.h:
#define FACETEXTURE_SHOOTGRINTIME 0.7
#define FACETEXTURE_DODGESHOOTGRINTIME 2.0
#define FACETEXTURE_ID 0
#define FACETEXTURE_DEFAULT_ID 0
#define FACETEXTURE_GRIN_ID 1
#define FACETEXTURE_DEATH_ID 2
#define FACETEXTURE_WOUNDED_ID 3
[/code]</blockquote><font size="2" face="Verdana, Arial">I can't seem to find anythign else, so perhaps it's hardcoded.
[ 11-25-2002, 11:51 AM: Message edited by: Maddieman ]
HairlessWookie
11-26-2002, 01:03 PM
Well it seems even if it were hard coded and you were stuck with just group index 0 for face, that grouping would also have to be set up in 3dsmax. Which means that you could just assign the whole model to the face group and make the texture one big texture....would be a bitch to skin, but you could draw bullet holes and burn marks anywhere on the skin. I tried for weeks to do this in the script by drawing decals on the character in materials.txt and decals.txt, but it never worked. Now i know that decals are just for map objects.
Thanks for the help.
Now I am able to create different skin sets.
I also find that is pretty easy to change the material IDs in the original skin files (using HEX workshop for example). So I just rename the ASCII name of the jpegs and…it works!
HairlessWookie
12-04-2002, 05:00 PM
wow...where might i find this hex workshop...sounds pretty handy all around
You can download the shareware version at:
http://www.bpsoft.com/
vBulletin® v3.8.0 Beta 3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.