You see the script that assigns banners to faction:SPD_Phoenix said: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.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?
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?
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)ThaneWulfgharn said:Of course:
header_troops:
module_skins:tf_other = 3
(
"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)],
]
),
I think there a few things you should be clear:ThaneWulfgharn said:You see the script that assigns banners to faction:SPD_Phoenix said: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.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?
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?
It is easy.Lords have a quite harder script.If I make a function like this:(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 will be easier to add banners,and it would work for lords,companions and even SOLDIERS!(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"),
I added the "slot_troop_banner" at module constants,but dosen't seem to work.
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.(troop_set_slot, "trp_knight_1_2", slot_troop_banner, "mesh_banner_lannister"),
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.
(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),
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.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.
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.)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 )
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.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.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.
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.Caba`drin said: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.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.