Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
You don't actually need a trigger, do it when the faction changes from
Code:
 script_give_center_to_faction
. script_game_start calls script_give_center_to_faction_aux instead so you don't have to worry about it starting with the wrong name. Same goes with faction name changes, although you could add a delay and check when they've conquered a town in
Code:
script_faction_recalculate_strength
which gets called quite often.
 
Thanks for the help so far. I might have taken a slight different direction and I've run into another problem.

I successfully added A elven race (Male and Female) and then I tried adding Dwarfs.

When i try to start the game as dwarf my game crashes right before it get to the face creation. So i figured it might be something with the module_skins.

Code:
dwarf_male_face_keys = [
(20,0, 0.7,-0.6, "Chin Size"),
(260,0, -0.6,1.4, "Chin Shape"),
(10,0,-0.5,0.9, "Chin Forward"),
(240,0,0.9,-0.8, "Jaw Width"),
(210,0,-0.5,1.0, "Jaw Position"),
(250,0,0.8,-1.0, "Mouth-Nose Distance"),
(200,0,-0.3,1.0, "Mouth Width"),
(50,0,-1.5,1.0, "Cheeks"),

(60,0,-0.4,1.35, "Nose Height"),
(70,0,-0.6,0.7, "Nose Width"),
(80,0,1.0,-0.1, "Nose Size"),
(270,0,-0.5,1.0, "Nose Shape"),
(90,0,-0.2,1.4, "Nose Bridge"),

(100,0,-0.3,1.5, "Cheek Bones"),
(150,0,-0.2,3.0, "Eye Width"),
(110,0,1.5,-0.9, "Eye to Eye Dist"),
(120,0,1.9,-1.0, "Eye Shape"),
(130,0,-0.5, 1.1, "Eye Depth"),
(140,0,1.0,-1.2, "Eyelids"),

(160,0,1.3,-0.2, "Eyebrow Position"),
(170,0,-0.1,1.9, "Eyebrow Height"),
(220,0,-0.1,0.9, "Eyebrow Depth"),
(180,0,-1.1,1.6, "Eyebrow Shape"),
(230,0,1.2,-0.7, "Temple Width"),

(30,0,-0.6,0.9, "Face Depth"),
(40,0,0.9,-0.6, "Face Ratio"),
(190,0,0.0,0.95, "Face Width"),

(280,0,0.0,1.0, "Post-Edit"),
]

Code:
(
    "dwarf_male", 2,
    "dwarf_body", "dwarf_calf_l", "dwarf_handL",
    "dwarf_head", dwarf_male_face_keys,
    ["man_hair_s","man_hair_n","man_hair_p","man_hair_r","man_hair_q","man_hair_v","man_hair_y9"], #man_hair_meshes ,"man_hair_y5","man_hair_y8",
    ["beard_dwarf_1","beard_dwarf_2", "beard_dwarf_3", "beard_dwarf_4","beard_dwarf_5","beard_dwarf_6","beard_dwarf_7","beard_dwarf_8",], #beard meshes ,
    ["hair_blonde_dwarf"], #hair textures
    ["dwarf_beard_blonde"], #beard_materials
    [("manface_young"   ,0xffd0e0e0,["hair_blonde"],[0xffb04717, 0xffb04717, 0xff502a19]),
     ("manface_young_2" ,0xffcbe0e0,["hair_blonde"],[0xffb04717, 0xff632e18, 0xff502a19, 0xff19100c]),
     ("manface_7"       ,0xffc0c8c8,["hair_blonde"],[0xff83301a, 0xff502a19, 0xff19100c, 0xff0c0d19]),     
     ("manface_midage"  ,0xffdfefe1,["hair_blonde"],[0xff2f180e, 0xff171313, 0xff07080c]),
     ("manface_midage_2",0xfde4c8d8,["hair_blonde"],[0xff2f180e, 0xff171313, 0xff07080c]),
     ("manface_rugged"  ,0xffb0aab5,["hair_blonde"],[0xff171313, 0xff07080c]),
	], #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_dwarf_yell"),(voice_victory,"snd_dwarf_victory")], #voice sounds
    "skel_dwarf", 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)],
     ]
  ), 

and my game_menu code

Code:
("start_dwarf_male",
      [],
      "Dwarven Male (Crashes, don't use yet)",
      [
        (assign, "$race", 2), #(2 = Dwarfen race)
        (troop_set_type, "trp_player", 4),
        (jump_to_menu, "mnu_start_character_1"),
      ]
      ),

      ("go_back",
      [],
      "Go_back",
      [
        (jump_to_menu, "mnu_start_game_1"),
      ]
      ),
    ],
  ),

And for what it's worth here are my header_troop codes

Code:
tf_male           = 0
tf_female         = 1
tf_elven_male     = 2
tf_elven_female   = 3
tf_dwarf_male     = 4
tf_undead         = 6

Any ideas what might be wrong?
 
(
    "dwarf_male", 2,
    "dwarf_body", "dwarf_calf_l", "dwarf_handL",

Why the number 2? I think, and I could be wrong as I have never used this, but I am pretty sure this number is used for skin flags (otherwise it should be 0). Set yours to 0, every new non female race I have is set to 0.

You can use this bit to tell the game if the race requires some body transformation - the way that female armour has narrower shoulders and breasts- if you open up openbrf and look at an armour which features a feminised form you will notice that the female form will be in frame number two with time 10. To tell the game to use this frame and time for a particular race you use -  skf_use_morph_key_10  as the time of the frame is 10. I presume you can also create your own new frames for particular races and use skf_use_morph_key_20 ect but I have never done it.
 
Somebody said:
You don't actually need a trigger, do it when the faction changes from
Code:
 script_give_center_to_faction
. script_game_start calls script_give_center_to_faction_aux instead so you don't have to worry about it starting with the wrong name. Same goes with faction name changes, although you could add a delay and check when they've conquered a town in
Code:
script_faction_recalculate_strength
which gets called quite often.
I also taught that this should be done by simple trigger- factions take specific towns and they change their names. This should take some time for me- if I manage to do it at all.
Other two questions still remains:
1. Where can I increase faction agresivity- so factions declare war to each other more often and to make peace  less.
2. Where can I increase chances that lords can be captured after battles. 
 
La Grandmaster said:
(
    "dwarf_male", 2,
    "dwarf_body", "dwarf_calf_l", "dwarf_handL",

Why the number 2? I think, and I could be wrong as I have never used this, but I am pretty sure this number is used for skin flags (otherwise it should be 0). Set yours to 0, every new non female race I have is set to 0.

You can use this bit to tell the game if the race requires some body transformation - the way that female armour has narrower shoulders and breasts- if you open up openbrf and look at an armour which features a feminised form you will notice that the female form will be in frame number two with time 10. To tell the game to use this frame and time for a particular race you use -  skf_use_morph_key_10  as the time of the frame is 10. I presume you can also create your own new frames for particular races and use skf_use_morph_key_20 ect but I have never done it.
I had it 0 originally but changed it to try to see if that is what caused the crash. Thanks for clearing that up for me LG. Yes I have noticed that, how it works. I learn something new everyday.
I also thought it might be the 
Code:
"skel_dwarf", 1.0,
that is causing my crash but it still happened when I used 
Code:
"skel_human", 1.0,
Though I am still at a loss on what is causing all this. 
 
I think I know what it is, missed it before, just noticed the 2 and thought that might be the problem. Your hair texture is the problem - 

You only define the hair texture  hair_blonde_dwarf
Code:
    ["hair_blonde_dwarf"], #hair textures
however your face textures all use the hair texture  "hair_blonde"
Code:
 [("manface_young"   ,0xffd0e0e0,["hair_blonde"],[0xffb04717, 0xffb04717, 0xff502a19]),

To fix this -
Either add hair_blonde to your list of hair textures at the beginning
Code:
  ["hair_blonde_dwarf", "hair_blonde"],#hair textures
or change each of your face textures to use hair_blonde_dwarf
Code:
  [("manface_young"   ,0xffd0e0e0,["hair_blonde_dwarf"],[0xffb04717, 0xffb04717, 0xff502a19]),
It depends on whether you want your dwarf faces to have their own hair texture or whether you want them to use the human one, or a mix of the two
 
May I repeat my questions?

1. Is it possible to determine, whether an item was added to the player inventory outside of a scene (because the ti_item_picked_up works only in module_mission_templates.py) for instance if the item was added by the loot screen or the trade screen or by an event on the map?
2. Is it possible for an item instance to have more than one imodbit?
3. Can I create additional imodbits?

Any advice would be greatly appreciated.
 
DerGreif said:
May I repeat my questions?

1. Is it possible to determine, whether an item was added to the player inventory outside of a scene (because the ti_item_picked_up works only in module_mission_templates.py) for instance if the item was added by the loot screen or the trade screen or by an event on the map?
2. Is it possible for an item instance to have more than one imodbit?
3. Can I create additional imodbits?

Any advice would be greatly appreciated.

1. Can you be more specific why would you need it? Maybe there is another solution. For the trading screen there is the script "game_event_buy_item"; for the rest...idk...(there are solutions like creating a temp troop, and every second or so, compare temp troop's inventory with the player troop's inventory, and then save the player troop's inventory into temp troop; however i don't recommend doing in this way, because it is a dirty way of doing it).
2. no
3. no; they are hardwired into the game.
 
The_dragon said:
DerGreif said:
May I repeat my questions?

1. Is it possible to determine, whether an item was added to the player inventory outside of a scene (because the ti_item_picked_up works only in module_mission_templates.py) for instance if the item was added by the loot screen or the trade screen or by an event on the map?
2. Is it possible for an item instance to have more than one imodbit?
3. Can I create additional imodbits?

Any advice would be greatly appreciated.

1. Can you be more specific why would you need it? Maybe there is another solution. For the trading screen there is the script "game_event_buy_item"; for the rest...idk...(there are solutions like creating a temp troop, and every second or so, compare temp troop's inventory with the player troop's inventory, and then save the player troop's inventory into temp troop; however i don't recommend doing in this way, because it is a dirty way of doing it).
2. no
3. no; they are hardwired into the game.
first of all, thanks for your answers! It is greatly appreciated!

Now to be more specific: I want to create two inventories. One party inventory which would use the native inventory window and options and a personal inventory of the player, which would be far more restricted but can be accessed in scenes, too, without using the baggage chest. To have an easy way of exchange between personal inventory and party inventory I thought I could utilise the loot screen. In the loot screen you have already one inventory on the left and your party inventory on the right. With the change_screen_loot operation it would be easy to have the personal inventory (stored in a dummy hero troop called player_inventory) on the right side and the party inventory on the left. But I wondered how I could update the player_inventory after the exchanges were made.

While I was typing this, I realised, I could look into the household/constable inventory scripts in Brytenwalda, which actually has exactly this functionality I was looking for, if I recall correctly that is.

Thanks again for your help!
 
La Grandmaster said:
I think I know what it is, missed it before, just noticed the 2 and thought that might be the problem. Your hair texture is the problem - 

You only define the hair texture  hair_blonde_dwarf
Code:
    ["hair_blonde_dwarf"], #hair textures
however your face textures all use the hair texture  "hair_blonde"
Code:
 [("manface_young"   ,0xffd0e0e0,["hair_blonde"],[0xffb04717, 0xffb04717, 0xff502a19]),

To fix this -
Either add hair_blonde to your list of hair textures at the beginning
Code:
  ["hair_blonde_dwarf", "hair_blonde"],#hair textures
or change each of your face textures to use hair_blonde_dwarf
Code:
  [("manface_young"   ,0xffd0e0e0,["hair_blonde_dwarf"],[0xffb04717, 0xffb04717, 0xff502a19]),
It depends on whether you want your dwarf faces to have their own hair texture or whether you want them to use the human one, or a mix of the two

Thanks! That fixed it.
 
I made some modifications to the khergit troop tree (who got their IDs as "steppe"). When exporting, I get this error:
Do you know what file I have to look for in order to replace those lines?
 
The Bowman said:
I made some modifications to the khergit troop tree (who got their IDs as "steppe"). When exporting, I get this error:
fr-titlu.jpg
Do you know what file I have to look for in order to replace those lines?
You'll also have to edit the part right below the culture hash (# Cultures) in module_scripts.
 
Somebody said:
Arven2802 said:
Hello,
  I have a question on lances in modding: When I want to extend a lance, it disappears.  How can I extend a lance?
The answer is probably in this, but I have neither the will nor time to search through the many pages.
Are you talking about the item not showing out when the couching animation plays? Never heard of that, try reinstalling the game.
No, I mean extend a lance in terms of length. For example giving a great lance length 320 instead of 240.  However, when I do it, I do not see it.
 
Two questions:
1) I've implemented the trolls from TLD, but they seem to not be able to take damage, and I am unsure of how to add hitboxes.
2) The passage to the dungeon is now causing crashes. I have made no modifications to the script from the last time it worked, so I have no idea what the problem is. :???:

Here is the code for the dungeon:
Code:
      ("first_backstory_player_lost_2",menu_text_color(0xFF000000)|mnf_disable_all_keys,
    "A long trek through the forest begins, going back to Praven. Eventually, just outside of Praven, where you are meant to be sold, you spot a chance to escape! You manage to use a sword lying on the ground to free your bonds, and free a few other men as well. You can sneak or fight your way out, along with the other men.",
  "none",
    [(set_passage_menu, "mnu_first_backstory_player_lost_2"),],
    [
     ("continue",[],"Continue...",
       [
	   (call_script, "script_start_slaver_camp_backstory"), #Enters scene
        ]
       ),
	  ("cave",[(eq,1,0)],"You shouldn't see this...",
       [
	      (call_script, "script_enter_cave"),
		  (finish_mission, 0),
        ],"Enter the Cave."
       ),
    ]
  ),
Code:
   #script_enter_cave
   (
   "enter_cave",
   [
   (music_set_situation, mtf_sit_fight),
   (play_track, "track_dungeon_rpg", 1),
   (modify_visitors_at_site, "scn_final_cave"),   
   (reset_visitors),
   (set_visitor, 0, "trp_player"),
   (set_visitor, 1, "trp_ghoul"),
   (set_visitor, 2, "trp_troll"),
   (set_visitor, 3, "trp_ghoul"),
   (set_visitor, 4, "trp_undead"),
   (set_visitor, 5, "trp_undead"),
   (set_visitor, 6, "trp_troll"),
   (set_visitor, 7, "trp_undead"),
   (set_visitor, 8, "trp_troll"),
   (set_visitor, 9, "trp_undead"),
   (set_visitor, 10, "trp_troll"),
   (set_visitor, 11, "trp_siren"),
   (set_visitor, 12, "trp_siren"),
   (set_visitor, 13, "trp_ghoul"),
   (set_visitor, 14, "trp_ghoul"),
   (set_visitor, 15, "trp_necromancer"),
   (try_for_range, ":npc", companions_begin, companions_end),
   (main_party_has_troop, ":npc"),
   (set_visitor, 16, ":npc"),
   (try_end),
   (set_visitor, 17, "trp_ghoul"),
   (set_visitor, 18, "trp_troll"),
   (set_visitor, 19, "trp_troll"),
   (set_visitor, 20, "trp_ghoul"),
   (set_visitor, 21, "trp_ghoul"),
   (set_visitor, 22, "trp_undead"),
   (set_visitor, 23, "trp_undead"),
   (set_visitor, 24, "trp_troll"),
   (set_visitor, 25, "trp_ghoul"),
   (set_visitor, 26, "trp_ghoul"),
   (set_visitor, 27, "trp_troll"),
   (set_visitor, 28, "trp_troll"),
   (set_visitor, 29, "trp_undead"),
   (set_visitor, 30, "trp_ghoul"),
   (set_visitor, 31, "trp_ghoul"),
   (set_jump_mission,"mt_final_cave"),
   (jump_to_scene, "scn_final_cave"),
   (change_screen_mission),
   ]),
 
Dusk Voyager said:
The Bowman said:
I made some modifications to the khergit troop tree (who got their IDs as "steppe"). When exporting, I get this error:
fr-titlu.jpg
Do you know what file I have to look for in order to replace those lines?
You'll also have to edit the part right below the culture hash (# Cultures) in module_scripts.

Found it. Also, something was in presentations too.
 
Status
Not open for further replies.
Back
Top Bottom