SP Tutorial Module System Adding a new race (Read second post)

Users who are viewing this thread

Hi
Is there a tutorial for how to add a new race (as in a new fantasy race eg orcs) into the game? Lets assume I have all the materials and meshes and textures ect and that I know how to add everything into module skins (becuase I think I do know how to do that) whats the next step?
Where is tf female and  tf undead? Do I need to create tf orc or would that happen just by adding the stuff into module skins?
How would I make the orc a playable race? Do I need to add a new character gender (and how would I?)
 
ok heres how you do it:

first go to module skins and after the undead entry put yours in, it should look like this:

Code:
  (
    "orc", 0,
    "orc_body", "orc_calf_l", "orc_handL",
    "orc_head", undead_face_keys,
    [],
    [],
    [],
    [],
    [("orcface_a",0xffffffff,[]),
     ("orcface_b",0xffcaffc0,[]),
     ], 
    [], #voice sounds
    "skel_human", 1.0,
  ),

Make sure you put this above the last ] and obviously your entry will be different to mine.

Ok now build your module and we will go to the next part.

Next we will make it so troops types can use our new race.

Go to header_troops and open it up, near the top you will see the following:

Code:
tf_male           = 0
tf_female         = 1
tf_undead         = 2

we change this into:

Code:
tf_male           = 0
tf_female         = 1
tf_undead         = 2
tf_orc        = 3

anymore you add will be 4, 5 and so on. Now build the module system.

Next go to troops_module and find your orc troop, the line where it says tf_mounted or any other tf_ simply add tf_orc at the start.

As for the final part im not sure but i think it is the following:
open up module_games_menus and you will the following:

Code:
    [
      ("start_male",[],"Male",
       [
           (troop_set_type,"trp_player",0),
           (assign,"$character_gender",tf_male),
           (jump_to_menu,"mnu_start_character_1"),
        ]
       ),
      ("start_female",[],"Female",
       [
           (troop_set_type,"trp_player",1),
           (assign,"$character_gender",tf_female),
           (jump_to_menu,"mnu_start_character_1")
        ]
       ),

now your code should look like the following:

Code:
    [
      ("start_male",[],"Male",
       [
           (troop_set_type,"trp_player",0),
           (assign,"$character_gender",tf_male),
           (jump_to_menu,"mnu_start_character_1"),
        ]
       ),
      ("start_female",[],"Female",
       [
           (troop_set_type,"trp_player",1),
           (assign,"$character_gender",tf_female),
           (jump_to_menu,"mnu_start_character_1")
        ]
       ),
      ("start_orc",[],"Orc",
       [
           (troop_set_type,"trp_player",3),
           (assign,"$character_gender",tf_orc),
           (jump_to_menu,"mnu_start_character_1")
        ]
       ),

Im not sure if the number should be 2 or 3 (as header_troops states that an orc is 3) but i think that is right, you will have to make all the class stats for an orc aswell but I think thats easy too work out.

Hope all this stuff helps,

Thanks, Dindi

edit: thanks grail knight
 
Thanks a hell of a lot.
Edit:
I dont know what I've done wrong but everytime I run the module system after putting in the new skin it says there is an error in process skins and definesd the error as
Index Error: tuple index out of range.
The error is in the line skins scale [14]
Any idea whats wrong?
 
  #ORC #### 
    (
    "orc", 0,
    "shirt", "orc_calf_l", "o_handL",
    "orc_head",
    [], #man_hair_meshes
    [], #beard meshes
    ["hair_blonde", "hair_red", "hair_brunette", "hair_black", "hair_white"], #hair textures
    ["beard_blonde","beard_red","beard_brunette","beard_black","beard_white"],
    [("orc",0xffebf0f0,["hair_black"]),   
    ("orc_1",0xffebf0f0,["hair_black"]),   
      ("orc_6",0xffebf0f0,["hair_black"]),   
    ("orc_2",0xffebf0f0,["hair_black"]),   
    ("orc_3",0xffebf0f0,["hair_black"]),   
    ("orc_4",0xffebf0f0,["hair_black"]),   
    ("orc_5",0xffebf0f0,["hair_black"]),   


    ], #test_face_textures,
    [(voice_die,"snd_man_die"),(voice_hit,"snd_man_hit"),(voice_grunt,"snd_man_grunt"),(voice_grunt_long,"snd_man_grunt_long"),(voice_yell,"snd_man_yell"),(voice_warcry,"snd_man_warcry"),(voice_victory,"snd_man_victory")], #voice sounds
      "skel_human", 1.0,
),
Thats the code the error is basicaly
Index Error: tuple index out of range.
The error is in the line skins scale [14]
 
pentagathus said:
  #ORC #### 
    (
    "orc", 0,
    "shirt", "orc_calf_l", "o_handL",
    "orc_head",
    [], #man_hair_meshes
    [], #beard meshes
    ["hair_blonde", "hair_red", "hair_brunette", "hair_black", "hair_white"], #hair textures
    ["beard_blonde","beard_red","beard_brunette","beard_black","beard_white"],
    [("orc",0xffebf0f0,["hair_black"]),   
    ("orc_1",0xffebf0f0,["hair_black"]),   
      ("orc_6",0xffebf0f0,["hair_black"]),   
    ("orc_2",0xffebf0f0,["hair_black"]),   
    ("orc_3",0xffebf0f0,["hair_black"]),   
    ("orc_4",0xffebf0f0,["hair_black"]),   
    ("orc_5",0xffebf0f0,["hair_black"]),   


    ], #test_face_textures,
    [(voice_die,"snd_man_die"),(voice_hit,"snd_man_hit"),(voice_grunt,"snd_man_grunt"),(voice_grunt_long,"snd_man_grunt_long"),(voice_yell,"snd_man_yell"),(voice_warcry,"snd_man_warcry"),(voice_victory,"snd_man_victory")], #voice sounds
      "skel_human", 1.0,
),
Thats the code the error is basicaly
Index Error: tuple index out of range.
The error is in the line skins scale [14]

Hey pentagathus,

Looks to me like your being screwed over by the new face gen system, there is an extra part to the syntax now...

The extra part is the hair colour slider you see when you gen a face.

Try:

Code:
("orc_1",0xffebf0f0,["hair_black"],[color=red][0xff007080c, 0xff007080c][/color]), 

This will give you a range of black to black :grin:

You will need this declaration for each texture :wink:
 
Ah thanks.
Edit:
Nope still not working. I think it might be becuase I havent created orc face keys.
Edit:
Yep I added orc face keys and it's compiling all rgiht now. Thanks for the hair thingy demize.
 
Bad Necro?  :roll:
but in Warband this:
Code:
  (
    "orc", 0,
    "orc_body", "orc_calf_l", "orc_handL",
    "orc_head", undead_face_keys,
    [],
    [],
    [],
    [],
    [("orcface_a",0xffffffff,[]),
     ("orcface_b",0xffcaffc0,[]),
     ],
    [], #voice sounds
    "skel_human", 1.0,
  ),

works only for Singleplayer!  :???:

What I´m searching for is how to edit the game_menu which shows up just before you start Multiplayer!! 
If we talk about an orcish face only there is a working walkarround even for multiplayer:
Simply implement it as a custom face:
Code:
(
    "man", 0,
    "man_body", "man_calf_l", "m_handL",
    "male_head", man_face_keys,
    ["man_hair_s","man_hair_m","man_hair_n","man_hair_o", "man_hair_y10", "man_hair_y12","man_hair_p","man_hair_r","man_hair_q","man_hair_v","man_hair_t","man_hair_y6","man_hair_y3","man_hair_y7","man_hair_y9","man_hair_y11","man_hair_u","man_hair_y","man_hair_y2","man_hair_y4"], #man_hair_meshes ,"man_hair_y5","man_hair_y8",
    ["beard_e","beard_d","beard_k","beard_l","beard_i","beard_j","beard_z","beard_m","beard_n","beard_y","beard_p","beard_o",   "beard_v", "beard_f", "beard_b", "beard_c","beard_t","beard_u","beard_r","beard_s","beard_a","beard_h","beard_g",], #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
    [("manface_young_2",0xffcbe0e0,["hair_blonde"],[0xffffffff, 0xffb04717, 0xff502a19]),
     ("manface_midage",0xffdfefe1,["hair_blonde"],[0xffffffff, 0xffb04717, 0xff632e18, 0xff502a19, 0xff19100c]),
     ("manface_young",0xffd0e0e0,["hair_blonde"],[0xff83301a, 0xff502a19, 0xff19100c, 0xff0c0d19]),     
#     ("manface_old",0xffd0d0d0,["hair_white","hair_brunette","hair_red","hair_blonde"],[0xffffcded, 0xffbbcded, 0xff99eebb]),
     ("manface_young_3",0xffdceded,["hair_blonde"],[0xff2f180e, 0xff171313, 0xff007080c]),
     ("manface_7",0xffc0c8c8,["hair_blonde"],[0xff171313, 0xff007080c]),
     ("manface_midage_2",0xfde4c8d8,["hair_blonde"],[0xff502a19, 0xff19100c, 0xff0c0d19]),
     ("manface_rugged",0xffb0aab5,["hair_blonde"],[0xff171313, 0xff007080c]),
#     ("manface_young_4",0xffe0e8e8,["hair_blonde"],[0xff2f180e, 0xff171313, 0xff007080c]),
     ("manface_african",0xff807c8a,["hair_blonde"],[0xff120808, 0xff007080c]),     
    
[b]("orc_head",0xff807c8a,["hair_blonde"],[0xff120808, 0xff007080c]), [/b]   
 
#  ("manface_old_2",0xffd5d5c5,["hair_white"],[0xffffcded, 0xffbbcded, 0xff99eebb]),
     ], #man_face_textures,
    [(voice_die,"snd_man_die"),(voice_hit,"snd_man_hit"),(voice_grunt,"snd_man_grunt"),(voice_grunt_long,"snd_man_grunt_long"),(voice_yell,"snd_man_yell"),(voice_stun,"snd_man_stun"),(voice_victory,"snd_man_victory")], #voice sounds
    "skel_human", 1.0,
    psys_game_blood,psys_game_blood_2,
    [[1.7, comp_greater_than, (1.0,face_width), (1.0,temple_width)], #constraints: ex: 1.7 > (face_width + temple_width)
     [0.3, comp_less_than, (1.0,face_width), (1.0,temple_width)],
     [1.7, comp_greater_than, (1.0,face_width), (1.0,face_depth)],
     [0.3, comp_less_than, (1.0,eyebrow_height), (1.0,eyebrow_position)],
     [1.7, comp_greater_than, (1.0,eyebrow_height), (1.0,eyebrow_position)],
     [-0.7, comp_less_than, (1.0,nose_size), (-1.0,nose_shape)],
     [0.7, comp_greater_than, (1.0,nose_size), (-1.0,nose_shape)],
     [2.7, comp_greater_than, (1.0,chin_size), (1.0,mouth_nose_distance), (1.0,nose_height), (-1.0,face_width)],
     ]
  ),

lol shows up for all with the same module you know but the other body-parts remain default sadly  :sad:
 
I have question.
You teach me how to make new race but on the same scale. :???:
How to make something smaller like goblin, hobbit?

Not in WB, in the normal M&B.
 
Thx a lot! Very useful!
I have a question. I want add dwarf race from the TLD mod to my mod. Can somebody tell me how can i add a new skeleton? (or something) Im sure i must change some file in the main game data dir.

(sry for my bad english)
 
Sorry about the necro post, but this thread almost got me where I wanted and it's a good tutorial for what the topic is.

I've been trying to add a custom race as well that would use a body/head model that isn't standard.  I can get everything working in the menus and all, so that I can select a third option under Male and Female, but in-game it's just the standard female model.  I've done a thousand things to fix this problem, but I'm not even sure why it's doing it.

Is there somewhere special I need to put the model/mesh/texture files for the custom shape, other than the module's resources folder?  (Yes, I have it set to load the .brf files in module.txt).  The models I'm trying to use are already implemented as ingame models, but of course they're removed constantly since they're just armor pieces.  Makes me wish I knew how Warsword Conquest included it's nonstandard troop models.
 
@Sceloporus -
You ever figure the skin-replacement issue out? I'm having this exact same issue, have quadruple-checked all of my code, have all the BRFs loaded (in fact they were working earlier ??) and cannot figure out what's going wrong for the life of me.

Thanks.

-Brad
 
I've been trying to add a custom race as well that would use a body/head model that isn't standard.  I can get everything working in the menus and all, so that I can select a third option under Male and Female, but in-game it's just the standard female model.  I've done a thousand things to fix this problem, but I'm not even sure why it's doing it.

Is there somewhere special I need to put the model/mesh/texture files for the custom shape, other than the module's resources folder?  (Yes, I have it set to load the .brf files in module.txt).  The models I'm trying to use are already implemented as ingame models, but of course they're removed constantly since they're just armor pieces.  Makes me wish I knew how Warsword Conquest included it's nonstandard troop models.

You ever figure the skin-replacement issue out? I'm having this exact same issue, have quadruple-checked all of my code, have all the BRFs loaded (in fact they were working earlier ??) and cannot figure out what's going wrong for the life of me.

I figured it out!  :grin: I'm going to post an explanation of my solution to help anyone else who might run into this really frustrating issue.

The culprits are the header_troops.py and module_skins.py files in the module system directory.
When defining your troop flags in header_troops.py for separate races, genders, etc, you have to order the flags and match them with the order of the skins in module_skins.py. If the troop flags go above the total number of skins defined in module_skins.py, any troop with a type flag between the max # of skins, and the max flag # will be automatically assigned the last skin in your skins file.

In both of the cases quoted above, it's likely that the last skin in the module_skins.py was the female skin, and both of us just arbitrarily assigned troop flags (I know I did), which resulted in a huge slew of customized troops just automatically being assigned the female skin.

I'm not going to post my updated files exactly, but just keep in mind that the order of the defined skins has to exactly match up with the order of the corresponding flags.
 
Heyho! Sorry for bringing up this old thread, but maybe someone of you could help me.

Simply put, i did everything like its told here, checked it again and again over the last 4 hours, tested around etc. But everytime i start a new game, select the new race and setup the skills it crashes as soon as i get to the charakter looks screen. Any idea why that is? (Yes the brf and textures are all placed. Even tested it with the original undead ones. It seems it only works when i use the standard human framework and dont replace anything)
 
Good day, added a new race, but when you choose in the game, you will get the following:

http://ibb.co/kXuCTH
What could be the problem?

P.S.: in the added texture of the brf-file.
 
What is the limit of the number of races you can add? Because I've added the 16th (default male and female + undead + 13 others) and now all tavern travelers have messed-up faces, and the new race appears as the default male.
 
Back
Top Bottom