Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Knight of the Rose said:
Can someone please explain how to make fog stay in a siege custom built map?  I add fog weather effects but once the map resets or I reload it the fog is gone and the sun is back in the sky.

You need to add the fog trough the Module system, know how to do that? Module_mission_templates.py. Add the fog then search for the multiplayer_sg for finding siege, after a bunch of black coloured text add a common that directs to the weather effect.
 
Kazzan said:
Knight of the Rose said:
Can someone please explain how to make fog stay in a siege custom built map?  I add fog weather effects but once the map resets or I reload it the fog is gone and the sun is back in the sky.

You need to add the fog trough the Module system, know how to do that? Module_mission_templates.py. Add the fog then search for the multiplayer_sg for finding siege, after a bunch of black coloured text add a common that directs to the weather effect.

Im fairly new to mapping so sorry for the confusion,  I have never messed with this file before.  I found the relative area you speak of in that file,  but I do not understand how to add "a common" to direct my weather effect for that map.  I also do not see the specific map I want to add the fog to in that file.
 
Please, use the term "scene". The thing called "map" is the single-player world map with the castles and parties and etc.
To set the fog only for your current scene you have to use something like this:
Code:
# The following is called a "trigger" - it will run once in the beginning of the siege.
(0,0,ti_once,[ <check if the scene played is your one> ],  # I have not modded Warband yet, so I don't know how do to this.
           [(set_fog_distance, <distance_in_meters>, [fog_color]), # Perhaps the current scene ID is stored in a global variable.
           ]),
     
Where fog_color is the colour-code in hexadecimal format.
And something else: If you do not know, the lines starting with "#" are comments, (if (you're not a programmer) keep reading; else break; :wink:) which means that they won't have effect on the compiled game so you can write notes or whatever you want in them.
 
Lumos said:
Please, use the term "scene". The thing called "map" is the single-player world map with the castles and parties and etc.
To set the fog only for your current scene you have to use something like this:
Code:
# The following is called a "trigger" - it will run once in the beginning of the siege.
(0,0,ti_once,[ <check if the scene played is your one> ],  # I have not modded Warband yet, so I don't know how do to this.
           [(set_fog_distance, <distance_in_meters>, [fog_color]), # Perhaps the current scene ID is stored in a global variable.
           ]),
     
Where fog_color is the colour-code in hexadecimal format.
And something else: If you do not know, the lines starting with "#" are comments, (if (you're not a programmer) keep reading; else break; :wink:) which means that they won't have effect on the compiled game so you can write notes or whatever you want in them.

Thank you very much!  I do know that the # are comments.  I am guessing the scene name is the one located in the strings file.  I will give it a try and see what happens. 

 
The scene_id is the first field for each entry in module_scenes - it's used with a scn_x prefix whenver you reference it from other files. The name in module_strings is indeed what shows up, but the game doesn't know that automatically. While they share the same multi_scene_# reference, their prefixes are different.
And to check the scene, use (store_current_scene, ":cur_scene"),(eq, ":cur_scene", "scn_multi_scene_#"),
 
im confused now and getting an indent error.  The map is called "multi_great_wall" in the module_scenes file.  Can you give me the exact code for moderate fog and a greyish tint?  That way I can see how its done and do it in the future myself.  Also I need to know where to put this code,  or does it matter? I added it to the end of the module_mission_template file and im getting an indent error when compiling.
 
Theoretically, it should be like this:
Code:
(0,0,ti_once, [(store_current_scene, ":cur_scene"),(eq, ":cur_scene", "scn_multi_great_wall"),],
    [(set_fog_distance, 20, 0xA9A9A9), # We'll use the "Dark Grey" colour and 20 meters
       ]),
And for the placement: Search in module_mission_templates for "multiplayer_sg". It should look something like this, but with more code:
Code:
  (
    "multiplayer_sg",mtf_something,
    "Some text that never shows up here",
    [
     (1,mtef_defenders|mtef_team_0,0,aif_start_alarmed,12,[]),
     # More lines like this one here - they are for the entry points
     ],
    [
         # * LOTS OF TRIGGERS HERE *


	# Place the trigger here

    ],
  ),
You just have to see where the last brackets (the "], ),") are and to place the trigger above them. It should work.
Know that I copied this template structure from a 1.011 file, so it might look otherwise in Warband. But the principle should be the same.
Kazzan sugegsted another method that will allow you to use the same fog in other mission templates. It's not necessary to be done in that way, but I've covered it in the spoiler below:
In the beginning of the file, before the "mission_templates = [" line, add the trigger, but in this format:
Code:
common_fog = (0,0,ti_once, [(store_current_scene, ":cur_scene"),(eq, ":cur_scene", "scn_multi_great_wall"),],
    [(set_fog_distance, 20, 0xA9A9A9), # We'll use the "Dark Grey" colour and 20 meters
       ]) # Notice the lack of comma after the bracket. In 1.011 if the trigger has a "name", the bracket counts as an error
Then in the zone I marked above you need to put only this: "common_fog," instead of a whole trigger.
I hope this helps.
 
WOOOO BABY ALL RIGHT!!! *claps,  does a spin and then moonwalks*  Works great!  Thank you soooo much you're the man!  :cool:

Now last question... the sun!  How do you get it to stay in a spot I assign?  Seems it doesn't want to stick either.  In fact the whole edit weather function is borked.  lol

BTW check out my channel,  you can see some of the maps I am making and know that your help is going to a good cause :smile:

http://www.youtube.com/user/DeafBlindDave78
 
Quick question for you guys: Has anyone had issues with the WB Edit mode? Even with the scene frozen and single threading forced, it goes renegade every once in a while and crashes on me. I get no RGL error even with admin privileges. Has anyone gone through this?

Kind Regards,
Lynores.
 
Lynores said:
Quick question for you guys: Has anyone had issues with the WB Edit mode? Even with the scene frozen and single threading forced, it goes renegade every once in a while and crashes on me. I get no RGL error even with admin privileges. Has anyone gone through this?

Kind Regards,
Lynores.
I've had that in certain scenes too. In other scenes I never crashed. I don't know a fix either.
 
Ok So I got the fog to work on my map,  but for some reason no one sees it when I play online except for someone with admin tools installed.  How do I get it so everyone sees the fog?
 
Code:
(agent_get_horse, ":player_horse", ":player_agent")

I am trying to find The players horse each battle but I am unsure on how to go about it, I always assumed I could find it using the above code but it seems to not work what does it output? the agent_id of the horse? or am I completely off track?

Edit: now that I think about it wouldn't it output a true/false statement? (0 or 1)

 
(get_player_agent_no, ":player_agent"),
(agent_get_horse, ":player_horse", ":player_agent"),
":player_horse" is a destination which will contain the agent id of the horse (-1 if invalid), while ":player_agent" is an input which was the output for (get_player_agent_no). You can then use (agent_get_rider) to find the player's id again (if you really wanted), or (agent_get_item_id) to determine which item the horse's agent is.
 
Knight of the Rose said:
Ok So I got the fog to work on my map,  but for some reason no one sees it when I play online except for someone with admin tools installed.  How do I get it so everyone sees the fog?
Oops. My bad. I believe that you have to send a message to the server. I don't know how to do it, though...
 
Alright, I'm having some trouble getting mice set up for the Redwall mod. I didn't have many difficulties just with the rats, but now I'm never getting a clean compile and as far as I can figure out, there is nothing wrong with the line in question.

here is my entire skins file. I'm hoping that someone will be able to help me out here.

Code:
man_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"),
]


woman_face_keys = [
(230,0,0.8,-1.0, "Chin Size"),
(220,0,-1.0,1.0, "Chin Shape"),
(10,0,-1.2,1.0, "Chin Forward"),
(20,0, -0.6, 1.2, "Jaw Width"),
(40,0,-0.7,1.0, "Jaw Position"),
(270,0,0.9,-0.9, "Mouth-Nose Distance"),
(30,0,-0.5,1.0, "Mouth Width"),
(50,0, -0.5,1.0, "Cheeks"),

(60,0,-0.5,1.0, "Nose Height"),
(70,0,-0.5,1.1, "Nose Width"),
(80,0,1.5,-0.3, "Nose Size"),
(240,0,-1.0,0.8, "Nose Shape"),
(90,0, 0.0,1.1, "Nose Bridge"),

(100,0,-0.5,1.5, "Cheek Bones"),
(150,0,-0.4,1.0, "Eye Width"),
(110,0,1.0,0.0, "Eye to Eye Dist"),
(120,0,-0.2,1.0, "Eye Shape"),
(130,0,-0.1,1.6, "Eye Depth"),
(140,0,-0.2,1.0, "Eyelids"),


(160,0,-0.2,1.2, "Eyebrow Position"),
(170,0,-0.2,0.7, "Eyebrow Height"),
(250,0,-0.4,0.9, "Eyebrow Depth"),
(180,0,-1.5,1.2, "Eyebrow Shape"),
(260,0,1.0,-0.7, "Temple Width"),

(200,0,-0.5,1.0, "Face Depth"),
(210,0,-0.5,0.9, "Face Ratio"),
(190,0,-0.4,0.8, "Face Width"),

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


rat_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"),
]


mouse_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"),
]


comp_less_than = -1;
comp_greater_than = 1;


skins = [
  (
    "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_brunete","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]),     
#     ("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)], ## PROBLEM HERE??!##
     [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)],
     ]
  ),
 
  (
    "woman", skf_use_morph_key_10,
    "woman_body",  "woman_calf_l", "f_handL",
    "female_head", woman_face_keys,
    ["woman_hair_p","woman_hair_n","woman_hair_o","woman_hair_q","woman_hair_r","woman_hair_t","woman_hair_s"], #woman_hair_meshes
#    ["woman_hair_a","woman_hair_b","woman_hair_c","woman_hair_d","woman_hair_e","woman_hair_f","woman_hair_g"], #woman_hair_meshes
    [],
    ["hair_blonde", "hair_red", "hair_brunette", "hair_black", "hair_white"], #hair textures
    [],
    [("womanface_young",0xffe3e8ef,["hair_blonde"],[0xffffffff, 0xffb04717, 0xff502a19, 0xff19100c]),
     ("womanface_b",0xffdfdfdf,["hair_blonde"],[0xffa5481f, 0xff502a19, 0xff19100c, 0xff0c0d19]),
     ("womanface_a",0xffe8dfe5,["hair_blonde"],[0xff502a19, 0xff19100c, 0xff0c0d19]),
     ("womanface_brown",0xffaf9f7e,["hair_blonde"],[0xff19100c, 0xff0c0d19, 0xff007080c]),
     ("womanface_african",0xff808080,["hair_blonde"],[0xff120808, 0xff007080c]),
#     ("womanface_midage",0xffe5eaf0,["hair_black","hair_brunette","hair_red","hair_white"],[0xffffcded, 0xffbbcded, 0xff99eebb]),
     ],#woman_face_textures
    [(voice_die,"snd_woman_die"),(voice_hit,"snd_woman_hit"),(voice_yell,"snd_woman_yell")], #voice sounds
    "skel_human", 1.0,
    psys_game_blood,psys_game_blood_2,
  ),

     (
    "ratm", skf_use_morph_key_20,
    "bilgerat_body",  "rat_foot_L", "rat_hand_L",
    "rat_head", rat_face_keys,
    ["rat_ears","rat_ears_nick","rat_ears_nick1","rat_ears_ragged","rat_ears_ragged1","rat_ears_ring","rat_ears_ring1"], #woman_hair_meshes
#    ["woman_hair_a","woman_hair_b","woman_hair_c","woman_hair_d","woman_hair_e","woman_hair_f","woman_hair_g"], #woman_hair_meshes
    [],
    ["rat_mat"], #hair textures
    [],
    [("ratface",0xffe3e8ef,["rat_mat"],[0xffffffff, 0xffb04717, 0xff502a19, 0xff19100c]),
     #("womanface_b",0xffdfdfdf,["hair_blonde"],[0xffa5481f, 0xff502a19, 0xff19100c, 0xff0c0d19]),
     #("womanface_a",0xffe8dfe5,["hair_blonde"],[0xff502a19, 0xff19100c, 0xff0c0d19]),
     #("womanface_brown",0xffaf9f7e,["hair_blonde"],[0xff19100c, 0xff0c0d19, 0xff007080c]),
     #("womanface_african",0xff808080,["hair_blonde"],[0xff120808, 0xff007080c]),
#     ("womanface_midage",0xffe5eaf0,["hair_black","hair_brunette","hair_red","hair_white"],[0xffffcded, 0xffbbcded, 0xff99eebb]),
     ],#woman_face_textures
    [(voice_die,"snd_snarl"),(voice_hit,"snd_snarl"),(voice_yell,"snd_snarl")], #voice sounds
    "skel_rat", 1.0,
    psys_game_blood,psys_game_blood_2,
  ),

    (
    "mouse", skf_use_morph_key_30,
    "fieldmouse_body",  "mouse_foot_L", "mouse_hand_L",
    "mouse_head", mouse_face_keys,
    ["mouse_ears"], #woman_hair_meshes
#    ["woman_hair_a","woman_hair_b","woman_hair_c","woman_hair_d","woman_hair_e","woman_hair_f","woman_hair_g"], #woman_hair_meshes
    [],
    ["mouse_mat"], #hair textures
    [],
    [("mouse_mat",0xffe3e8ef,["mouse_mat"],[0xffffffff, 0xffb04717, 0xff502a19, 0xff19100c]),
     #("womanface_b",0xffdfdfdf,["hair_blonde"],[0xffa5481f, 0xff502a19, 0xff19100c, 0xff0c0d19]),
     #("womanface_a",0xffe8dfe5,["hair_blonde"],[0xff502a19, 0xff19100c, 0xff0c0d19]),
     #("womanface_brown",0xffaf9f7e,["hair_blonde"],[0xff19100c, 0xff0c0d19, 0xff007080c]),
     #("womanface_african",0xff808080,["hair_blonde"],[0xff120808, 0xff007080c]),
#     ("womanface_midage",0xffe5eaf0,["hair_black","hair_brunette","hair_red","hair_white"],[0xffffcded, 0xffbbcded, 0xff99eebb]),
     ],#woman_face_textures
    [(voice_die,"snd_snarl"),(voice_hit,"snd_snarl"),(voice_yell,"snd_snarl")], #voice sounds
    "skel_mouse", 1.0,
    psys_game_blood,psys_game_blood_2,
  ),

  ]
This is the line that the compiler has a problem with:

[[1.7, comp_greater_than, (1.0,face_width), (1.0,temple_width)],
NameError: 'face_width' is not defined.

Can anyone spot my problem here? It continues to elude me.
 
Mandible said:
NameError: 'face_width' is not defined.

Can anyone spot my problem here? It continues to elude me.
Umm,  because 'face_width' is not defined  :mrgreen:
Should be a list of those constants in module_skins.py. Yours does not have it somehow. Check how vanilla has it
 
But it is defined, isn't it? Right in man_face_keys. (190,0,0.0,0.95, "Face Width"),

That's it, right? I didn't change this, its the same as native is.
 
Oh I see... Huh... Wonder how that got deleted... I understand what I did wrong now. I thought that it was defined in the brackets. Anyway, its all good. Thanks.
 
Question:

I am making a mod in my native language, so i need that the qualities of the equipments be written after the name of it. So for example a Rusty Sword need to be Sword Rusty...and so on ...Lance Cracked ... Shield Round.

Is it possible to do that using the imodbits thing? Or the only way is to make the same item several times for each quality(which is a helluva work :sad:)
 
Status
Not open for further replies.
Back
Top Bottom