theAthenian
So I did add a new race to the game(barf's skeleton exactly) but for some reason when I encounter troops who are of that race Warband crashes upon contact.
Here's my codes:
Now I do get an error upon start which is:
WARNING: Unable to find material of skull.lod (or something along those lines). Thing is there are no lods nor can I create any cause I don't know how.
So how do I fix those errors?
Here's my codes:
module_troops said:["looter","Skeleton Warrior","Skeleton Warriors",tf_barf_sklton|tf_allways_fall_dead,0,0,fac_undeads,
[itm_steel_shield,itm_legion_sword_hoplite,itm_ancient_helmet],
def_attrib|level(4),wp(20),knows_common,undead_face1, undead_face2],
module_skins said:(
"barf_sklton", 0,
"skeleton_cut", "skeleton_calf_L", "skeleton_hand_L",
"skull", man_face_keys,
[], #man_hair_meshes ,"man_hair_y5","man_hair_y8",
[], #beard meshes ,"beard_q"
[], #hair textures
[],
[("skull",0xffffffff,[]),
],#undead_face_textures
[(voice_die,"snd_woman_die"),(voice_hit,"snd_woman_hit"),(voice_yell,"snd_woman_yell")], #voice sounds
"skel_human", 1.0,
),
Now I do get an error upon start which is:
WARNING: Unable to find material of skull.lod (or something along those lines). Thing is there are no lods nor can I create any cause I don't know how.
So how do I fix those errors?
The solution on HOW TO ADD SKELETONS TO YOUR GAME:
xenoargh said:OK, here's the file version 1.1 and some code to make it all work.
First, get my update to Barf's Undead Army.
Now for some code:
module_skins, up at the top, with the rest of the facegen code:
Code:skeleton_face_keys = [ (0,0,0,0, "Chin Size"), (0,0,0,0, "Chin Shape"), (0,0,0,0, "Chin Forward"), (0,0,0,0, "Jaw Width"), (0,0,0,0, "Jaw Position"), (0,0,0,0, "Mouth-Nose Distance"), (0,0,0,0, "Mouth Width"), (0,0,0,0, "Cheeks"), (0,0,0,0, "Nose Height"), (0,0,0,0, "Nose Width"), (0,0,0,0, "Nose Size"), (0,0,0,0, "Nose Shape"), (0,0,0,0, "Nose Bridge"), (0,0,0,0, "Cheek Bones"), (0,0,0,0, "Eye Width"), (0,0,0,0, "Eye to Eye Dist"), (0,0,0,0, "Eye Shape"), (0,0,0,0, "Eye Depth"), (0,0,0,0, "Eyelids"), (0,0,0,0, "Eyebrow Position"), (0,0,0,0, "Eyebrow Height"), (0,0,0,0, "Eyebrow Depth"), (0,0,0,0, "Eyebrow Shape"), (0,0,0,0, "Temple Width"), (0,0,0,0, "Face Depth"), (0,0,0,0, "Face Ratio"), (0,0,0,0, "Face Width"), (0,0,0,0, "Post-Edit"), ]
Next, module_skins, below the woman skin definition:
Code:( "skeleton", 0, "barf_skeleton", "barf_skeleton_calf_l", "barf_skeleton_handL", "barf_skull", skeleton_face_keys, [], #man_hair_meshes ,"man_hair_y5","man_hair_y8", [], #beard meshes ,"beard_q" ["hair_blonde", "hair_red", "hair_brunette", "hair_black", "hair_white"], #hair textures ["beard_blonde","beard_red","beard_brunette","beard_black","beard_white"], #beard_materials [ ("barf_skull",0xffffffff,["hair_blonde"],[0xffffffff, 0xffffffff]), ], #man_face_textures, [], #voice sounds, put your own in here, following the template of the man / woman; I built custom sounds of moaning and stuff "skel_human", 1.0, psys_game_blood,psys_game_blood_2, ), #P.S., you can use any particle effect you want for blood. I built a "dusty" effect for mine.
Now, for a header_troops entry:
Note that that can be adjusted; you can have a fairly large number of custom races.Code:tf_skeleton = 2
Module_troops, up at the top with the other facecodes:
Code:skeleton_face1 = 0xffffffff00000000000000000000000000000000000000000000000000000000 skeleton_face2 = 0xffffffff00000000000000000000000000000000000000000000000000000000
Now, for a module_troops entry (please note; this is just an example, and does not have equipment; the skeletons can wear helmets and boots or use the custom skeleton armors as shown here:
Code:["death_knight_skeleton_archer","Death Knight Skeleton Archer (?)","Death Knight Skeleton Archers (?)",tf_skeleton|tf_always_fall_dead|tf_mounted|tf_guarantee_helmet|tf_guarantee_shield|tf_guarantee_ranged|tf_no_capture_alive,0,0,fac_death_knights,[itm_arrows,itm_long_bow,itm_strong_bow,itm_short_bow,itm_spiked_club,itm_mace_1,itm_tab_shield_round_a,itm_nordic_helmet,itm_nordic_archer_helmet,itm_skeleton_armor01,itm_skeleton_armor02,itm_skeleton_armor03],regular_ranged_attrib|level(25),wp_melee(75)|wp_archery(150),0,skeleton_face1,skeleton_face2],
Now, for the custom armors to work, you need some module_items entries like this one (please note that in my mod, all these numbers make perfect sense for fairly weak armor- don't just copy-pasta this code into Warband balance and expect good things to happen, lol:
Code:["skeleton_armor01","Skeleton Armor",[("barf_skeleton_armor",0)],itp_type_body_armor|itp_unique|itp_covers_legs,0,30000,weight(15)|abundance(0)|head_armor(0)|body_armor(125)|leg_armor(15)|difficulty(1),imodbits_none],
...that's pretty much it.
OK, so now I need to explain a few things I learned along the way:
1. You don't need a half-face to fix facial problems with custom races. You don't need a helmet. You need to use the original Mount and Blade format, not Warband (flags set to 0). It's that simple, and it only took hours to figure out (because it isn't documented anywhere). Whether this means that this technique breaks in With Fire and Sword, I can't say, but probably not.
2. You have to have a material named whatever_your_base_material_name_is.LOD to fix the face rendering at a distance. It can be the exact same shader, if that's what you want, it doesn't matter; the name is what matters.
3. This technique will not give you facegen. For facegen, you just need the facegen vertex frames, a half-face that has the center of the face's front uvs very precisely at the middle of a square face texture, set it for Warband and flag 30000. There were other weird flag settings, but they don't seem to matter.
That's pretty much all there is to it. Like I said before, when I finally worked it out, it's actually very simple... it's just the figuring it out that sucks, because there wasn't much to go on. Setting the skin code the way it is in this example means that the engine won't be applying any per-vertex color changes, so you can do whatever you want in terms of color. But you could very easily do elves with facegen- just export the human facegen frames, give them all pointy ears and adjust the nose-mouth ratio and slim the face a wee bit, and voila. Orks wouldn't take much more work, but you'd have to be careful to keep the geometry fitting in helmets, otherwise you'd be forced to go the static-head route or use helmets-for-heads like Persistant World does. Basically, though, it's all pretty easy, once you know why it doesn't work.
Lastly, I finally figured out what was causing the crashes. It was so simple and elementary that I shouldn't admit it; worse yet, I encountered it months ago, and promptly forgot about it. When you add new skins, you absolutely must start a fresh game. Must.
IOW, adding in new skins files is best done early in a project... or, if you have a long-established habit of cheerfully breaking people's savegames like I do, you just say, "if they want the features, they'll start a new game". Which isn't perfect, but that's how it works for me- luckily, players are surprisingly forgiving about it if you give them shiny new toys![]()