Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
SPD_Phoenix said:
ThaneWulfgharn said:
I don't get it.I changed it to spr_banner_x from mesh_banner_x that it was still nothing.Say,can we create a new function slot_troop_banner to set the place of slot_troop_banner_scene_prop?
Does not matter. As long as you can assign proper scene prop IDs to those slots so the game can understand. Or you will have to rewrite the code.

I'm still not very clear on what you try to archieve. Did you want to assign banner to lords using a loop instead of manually one by one? If so, how many lords and how many banners? Are you including companions?
You see the script that assigns banners to faction:
      (faction_set_slot, "fac_kingdom_1", slot_faction_banner, "mesh_banner_lannister"),
      (faction_set_slot, "fac_kingdom_2", slot_faction_banner, "mesh_banner_kingdom_b"),
      (faction_set_slot, "fac_kingdom_3", slot_faction_banner, "mesh_banner_kingdom_c"),
      (faction_set_slot, "fac_kingdom_4", slot_faction_banner, "mesh_banner_kingdom_a"),
      (faction_set_slot, "fac_kingdom_5", slot_faction_banner, "mesh_banner_kingdom_d"),
      (faction_set_slot, "fac_kingdom_6", slot_faction_banner, "mesh_banner_kingdom_e"),
      (faction_set_slot, "fac_kingdom_7", slot_faction_banner, "mesh_banner_kingdom_7"),
      (faction_set_slot, "fac_kingdom_8", slot_faction_banner, "mesh_banner_kingdom_8"),
      (faction_set_slot, "fac_kingdom_9", slot_faction_banner, "mesh_banner_kingdom_9"),
      (faction_set_slot, "fac_kingdom_10", slot_faction_banner, "mesh_banner_kingdom_10"),
      (faction_set_slot, "fac_kingdom_11", slot_faction_banner, "mesh_banner_kingdom_11"),
      (faction_set_slot, "fac_kingdom_12", slot_faction_banner, "mesh_banner_kingdom_f"),
It is easy.Lords have a quite harder script.If I make a function like this:
      (troop_set_slot, "trp_knight_1_2", slot_troop_banner, "mesh_banner_lannister"),
      (troop_set_slot, "trp_knight_1_3", slot_troop_banner, "mesh_banner_lannister"),
It will be easier to add banners,and it would work for lords,companions and even SOLDIERS!
I added the "slot_troop_banner" at module constants,but dosen't seem to work.
 
As well as my previous questions, I have a couple new ones.

1. I have made my own faction, and I want them to have custom banners, but they wont come up in game. I have the banners made and saved as a dds file as std_banners_h.dds however I'm not sure how to get them working. I heard somewhere that the number of banners is hardcoded, and you cannot add any more, is that true? Also I wanted to give my custom faction a banner, and have added the banner to the kingdom banners dds file, however I don't know how to get the faction to use it in game.

2. -snip- fixed myself.

Thanks for reading!
 
One more thing(this one must be short,so I don't believe it will be too hard to answer):Once I add a troop with a new gender/race,it will crash on every battle vs. that troop.
 
Of course:
header_troops:
tf_other          = 3
module_skins:
  (
    "other", 0,
    "whitewalker_body", "whitewalker_calf_l", "whitewalker_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
    [("white_walker_face",0xffcbe0e0,["hair_blonde"],[0xffffffff, 0xffb04717, 0xff502a19]),
    ], #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.5,
    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)],
    ]
  ),
 
 
Ok.I was using the old Module System.The new module 1.143 system,however,refuses to recognise even this script:
      (faction_set_slot, "fac_kingdom_1", slot_faction_banner, "mesh_banner_lannister"),
      (faction_set_slot, "fac_kingdom_2", slot_faction_banner, "mesh_banner_kingdom_b"),
      (faction_set_slot, "fac_kingdom_3", slot_faction_banner, "mesh_banner_kingdom_c"),
      (faction_set_slot, "fac_kingdom_4", slot_faction_banner, "mesh_banner_kingdom_a"),
      (faction_set_slot, "fac_kingdom_5", slot_faction_banner, "mesh_banner_kingdom_d"),
      (faction_set_slot, "fac_kingdom_6", slot_faction_banner, "mesh_banner_kingdom_e"),
      (faction_set_slot, "fac_kingdom_7", slot_faction_banner, "mesh_banner_kingdom_7"),
      (faction_set_slot, "fac_kingdom_8", slot_faction_banner, "mesh_banner_kingdom_8"),
      (faction_set_slot, "fac_kingdom_9", slot_faction_banner, "mesh_banner_kingdom_9"),
      (faction_set_slot, "fac_kingdom_10", slot_faction_banner, "mesh_banner_kingdom_10"),
      (faction_set_slot, "fac_kingdom_11", slot_faction_banner, "mesh_banner_kingdom_11"),
      (faction_set_slot, "fac_kingdom_12", slot_faction_banner, "mesh_banner_kingdom_f"),
The non original Banners are shown as empty banners.
 
ThaneWulfgharn said:
Of course:
header_troops:
tf_other          = 3
module_skins:
  (
    "other", 0,
    "whitewalker_body", "whitewalker_calf_l", "whitewalker_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
    [("white_walker_face",0xffcbe0e0,["hair_blonde"],[0xffffffff, 0xffb04717, 0xff502a19]),
    ], #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.5,
    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)],
    ]
  ),
 
Are you sure, that 3 is the correct index of your race? Keep in mind, you begin with 0 not 1. If this is the only race you added, the correct number would be 2. (male=0, female=1, other=2)
 
Is there any way to change the land roughness factor. Like random battle scenes generator would make more flatter ground, even in mountains. I know that I can edit the size of battlemap, but is there way to change the shape ?
 
ThaneWulfgharn said:
SPD_Phoenix said:
ThaneWulfgharn said:
I don't get it.I changed it to spr_banner_x from mesh_banner_x that it was still nothing.Say,can we create a new function slot_troop_banner to set the place of slot_troop_banner_scene_prop?
Does not matter. As long as you can assign proper scene prop IDs to those slots so the game can understand. Or you will have to rewrite the code.

I'm still not very clear on what you try to achieve. Did you want to assign banner to lords using a loop instead of manually one by one? If so, how many lords and how many banners? Are you including companions?
You see the script that assigns banners to faction:
      (faction_set_slot, "fac_kingdom_1", slot_faction_banner, "mesh_banner_lannister"),
      (faction_set_slot, "fac_kingdom_2", slot_faction_banner, "mesh_banner_kingdom_b"),
      (faction_set_slot, "fac_kingdom_3", slot_faction_banner, "mesh_banner_kingdom_c"),
      (faction_set_slot, "fac_kingdom_4", slot_faction_banner, "mesh_banner_kingdom_a"),
      (faction_set_slot, "fac_kingdom_5", slot_faction_banner, "mesh_banner_kingdom_d"),
      (faction_set_slot, "fac_kingdom_6", slot_faction_banner, "mesh_banner_kingdom_e"),
      (faction_set_slot, "fac_kingdom_7", slot_faction_banner, "mesh_banner_kingdom_7"),
      (faction_set_slot, "fac_kingdom_8", slot_faction_banner, "mesh_banner_kingdom_8"),
      (faction_set_slot, "fac_kingdom_9", slot_faction_banner, "mesh_banner_kingdom_9"),
      (faction_set_slot, "fac_kingdom_10", slot_faction_banner, "mesh_banner_kingdom_10"),
      (faction_set_slot, "fac_kingdom_11", slot_faction_banner, "mesh_banner_kingdom_11"),
      (faction_set_slot, "fac_kingdom_12", slot_faction_banner, "mesh_banner_kingdom_f"),
It is easy.Lords have a quite harder script.If I make a function like this:
      (troop_set_slot, "trp_knight_1_2", slot_troop_banner, "mesh_banner_lannister"),
      (troop_set_slot, "trp_knight_1_3", slot_troop_banner, "mesh_banner_lannister"),
It will be easier to add banners,and it would work for lords,companions and even SOLDIERS!
I added the "slot_troop_banner" at module constants,but dosen't seem to work.
I think there a few things you should be clear:
- Slot: in simple term, slots are memory allocation created to store information for easy recall/use later. It named for what it will store or do. The content of uninitialized slots will be nothing (null is not the same as zero) or -1 (not valid or not exist). Value must be assign to slots be for they can be used later or they won't do anything. If you change the name of the slot, you will have to change all the code referencing it to use the new name.

- Assigning banner:
(troop_set_slot, "trp_knight_1_2", slot_troop_banner, "mesh_banner_lannister"),
This is manual assigning. You can do this for each lord. However, you don't give the lords the mesh id (mesh_ ) from module_meshes. You should give them scene prop id (spr_ ) from module_scene_props. Even though they use the same texture and mesh, the internal code might use them differently. You can probably assigning the mesh id instead, but you will have to change other code to reference the mesh id as well. Use loop: when you want to assign sequential banner ids to sequential lord ids, it is most efficient to use loop so that lord_1 gets banner #1, lord_2 gets banner #2 and so on. Or you want to assign all lords (of the same faction or grouping) to use the same banner.

- Adding new banners: you need to add them to module_meshes, module_scene_props, module_map_icons in the same order. Also need to add or modify code such as background color in module_scripts, selection presentation in module_presentations.

First of all, you need to change your code to assign scene_prop ids to the slot (it was suggested earlier). That probably the main problem.
 
SPD_Phoenix said:
I think there a few things you should be clear:
- Slot: in simple term, slots are memory allocation created to store information for easy recall/use later. It named for what it will store or do. The content of uninitialized slots will be nothing (null is not the same as zero) or -1 (not valid or not exist). Value must be assign to slots be for they can be used later or they won't do anything. If you change the name of the slot, you will have to change all the code referencing it to use the new name.

that's wrong...
all slots are set to 0 by default. that's the reason of many bugs like player troops as guards(player = 0) because the guard slot was not set.
 
Hi, need some help with maps. I have just replaced the native map (Warband) with another and after moving all the coordinates of the cities etc. I get a recurring error after a few seconds of play:
Unable to position party Training Field at (70.50, 72.00)
What confuses me is that I changed the coordinates of that field but it still tries to place it at the old location.

Any ideas?

Many thanks.
 
I had a mysterious training field once as well. For some reason it was invisible at first and showed up after a little while at a position I didn't define.

Anyway, the solution to this lies within simple_triggers

Code:
(1,
   [
      (try_begin),
        (eq, "$training_ground_position_changed", 0),
        (assign, "$training_ground_position_changed", 1),
		(set_fixed_point_multiplier, 100),
        (position_set_x, pos0, 7050),
        (position_set_y, pos0, 7200),
        (party_set_position, "p_training_ground_3", pos0),
      (try_end),
 
That seems to have solved the problem, no more error after a few seconds!
You have helped me once again. Thank you very much!
 
Ikaguia said:
SPD_Phoenix said:
I think there a few things you should be clear:
- Slot: in simple term, slots are memory allocation created to store information for easy recall/use later. It named for what it will store or do. The content of uninitialized slots will be nothing (null is not the same as zero) or -1 (not valid or not exist). Value must be assign to slots be for they can be used later or they won't do anything. If you change the name of the slot, you will have to change all the code referencing it to use the new name.

that's wrong...
all slots are set to 0 by default. that's the reason of many bugs like player troops as guards(player = 0) because the guard slot was not set.
If that is the case, it was a bad design. Empty/unassigned placeholder should be null, not zero. I thought that the module system defined some values to be read as integer from the slots, so null and negative are set to zero. Anyway, I don't use uninitilized slots, so I get away with a lot of bug.
 
question, is the only thing (besides troop edits) that needs to be converted to 1.143 is just the new merchant refresh script? or is there another one added im not seeing?(tryin to convert my mod to 1.143 :razz:)
 
Alakeram said:
question, is the only thing (besides troop edits) that needs to be converted to 1.143 is just the new merchant refresh script? or is there another one added im not seeing?(tryin to convert my mod to 1.143 :razz:)
The 4 new merchant refresh scripts and the 4 module_triggers triggers that call them. Those are the only things necessary to make any mod work in 1.143. The rest of the 1.143 module system changes are all bug-fixes and balancing. (Though there are a few good fixes in there--appropriate village icons is eye candy, for instance...and then the disastrous changes to the lord respawn after capture/defeat system.)

SPD_Phoenix said:
Ikaguia said:
SPD_Phoenix said:
I think there a few things you should be clear:
- Slot: in simple term, slots are memory allocation created to store information for easy recall/use later. It named for what it will store or do. The content of uninitialized slots will be nothing (null is not the same as zero) or -1 (not valid or not exist). Value must be assign to slots be for they can be used later or they won't do anything. If you change the name of the slot, you will have to change all the code referencing it to use the new name.

that's wrong...
all slots are set to 0 by default. that's the reason of many bugs like player troops as guards(player = 0) because the guard slot was not set.
If that is the case, it was a bad design. Empty/unassigned placeholder should be null, not zero. I thought that the module system defined some values to be read as integer from the slots, so null and negative are set to zero. Anyway, I don't use uninitilized slots, so I get away with a lot of bug.
I'm not certain exactly what the uninitialized slots hold--whether it is truly 0 or 'null'--but they pass a (x_slot_eq, x, slot, 0) test when uninitialized and an (x_get_slot, value, x, slot) will return 0 from an uninitialized slot as well.
 
Caba`drin said:
SPD_Phoenix said:
If that is the case, it was a bad design. Empty/unassigned placeholder should be null, not zero. I thought that the module system defined some values to be read as integer from the slots, so null and negative are set to zero. Anyway, I don't use uninitilized slots, so I get away with a lot of bug.
I'm not certain exactly what the uninitialized slots hold--whether it is truly 0 or 'null'--but they pass a (x_slot_eq, x, slot, 0) test when uninitialized and an (x_get_slot, value, x, slot) will return 0 from an uninitialized slot as well.
All slots certainly do start as 0, the same as global variables ("$global") but unlike local variables (":local") which start uninitialized, and could be anything (should be treated that way unless you figure out the engine internals somehow, which still wouldn't be good coding practice). I find that slots defaulting to 0 can be useful (use it for the most common setting of the slot, and only set differently for the exceptions). The module system only deals with integers and strings, there is no "null" value.
 
Status
Not open for further replies.
Back
Top Bottom