Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
I am pretty new to modding and want to add another option for recruitment at a town - ie:// recruit your 5 swadian recruits for 50 denars but also have other basic troops available - so multiple tier 1 "recruit" level units. How can I go about doing this? In the python script it looked like there was only 1 spot for available troops at a center, so how could I add another/accomplish this?
 
EliteFifty said:
I am pretty new to modding and want to add another option for recruitment at a town - ie:// recruit your 5 swadian recruits for 50 denars but also have other basic troops available - so multiple tier 1 "recruit" level units. How can I go about doing this? In the python script it looked like there was only 1 spot for available troops at a center, so how could I add another/accomplish this?

Try this tutorial:

http://forums.taleworlds.com/index.php/topic,202029.0.html
 
Why are half of my trees turning up white?
Specifically, the "leaves" are white but the trunks are still brown/grey.
My Rgl_log shows no loading errors, but about 50% of the trees in battlefield scenes are white instead of green.

http://www.imageshack.us/i/pcdG2DZJj
http://www.imageshack.us/i/pcFtPP1Lj
ipoiQtzBj

What is the most obvious cause?
How can I go about researching this?
GDW
 
gdwitt said:
Why are half of my trees turning up white?
Specifically, the "leaves" are white but the trunks are still brown/grey.
My Rgl_log shows no loading errors, but about 50% of the trees in battlefield scenes are white instead of green.

http://www.imageshack.us/i/pcdG2DZJj
http://www.imageshack.us/i/pcFtPP1Lj
ipoiQtzBj

What is the most obvious cause?
How can I go about researching this?
GDW

I think new textures you added is mounting itself over and over, or inappropriate to that trees texture. take a look to the tree brfs, it may be show you the problem.
 
Ok, apprently warband is very touchy about admin rights when it comes to creating new custom scenes.

Now that I have familiarised myself with the scening battles and scripts, I've come to this part of the script where I have changed the random plains battle map to a custom scene.

Code:
 ("setup_random_scene",
    [
      (party_get_current_terrain, ":terrain_type", "p_main_party"),
      (assign, ":scene_to_use", "scn_random_scene"),
      (try_begin),
        (eq, ":terrain_type", rt_steppe),
        (assign, ":scene_to_use", "scn_random_scene_steppe"),
      (else_try),
        (eq, ":terrain_type", rt_plain),
        (assign, ":scene_to_use", [i][b]"scn_multi_scene_1"[/b][/i], [u][b]"scn_multi_scene_2"[/b][/u]),
      (else_try),
        (eq, ":terrain_type", rt_snow),
        (assign, ":scene_to_use", "scn_random_scene_snow"),
      (else_try),
        (eq, ":terrain_type", rt_desert),
        (assign, ":scene_to_use", "scn_random_scene_desert"),
      (else_try),
        (eq, ":terrain_type", rt_steppe_forest),
        (assign, ":scene_to_use", "scn_random_scene_steppe_forest"),
      (else_try),
        (eq, ":terrain_type", rt_forest),
        (assign, ":scene_to_use", "scn_random_scene_plain_forest"),
      (else_try),
        (eq, ":terrain_type", rt_snow_forest),
        (assign, ":scene_to_use", "scn_random_scene_snow_forest"),
      (else_try),
        (eq, ":terrain_type", rt_desert_forest),
        (assign, ":scene_to_use", "scn_random_scene_desert_forest"),
      (else_try),
        (eq, ":terrain_type", rt_water),
        (assign, ":scene_to_use", "scn_water"),
      (else_try),
        (eq, ":terrain_type", rt_bridge),
        (assign, ":scene_to_use", "scn_random_scene_plain"),
      (try_end),
      (jump_to_scene,":scene_to_use"),
  ]),

Now, this means that my custom map works in replacing the random_plains_scene, although I have no idea how to randomise multiple custom scenes. I tried adding a second custom map(multi_scene_2) along, but it does not work. How do you make it so that it randomises the custom maps?
 
It seems you don't understand what (assign,) does. Go to http://mbcommands.ollclan.eu/home/ to find out what operations do. Even better, download this: http://forums.taleworlds.com/index.php/topic,213060.0.html



Randomisation is done like this:

(store_random_in_range, ":random", 0, 10), #this stores a random number between 0 and 9 in the local variable called :random
(try_begin),
  (le, ":rand", 4), #if the variable is less than or equal to 4
  (assign, ":scene_to_use", "scn_whatever_1"),
(else_try),
  (gt, ":rand", 5), #if the variable is greater than BUT NOT equal to 5
  (assign, ":scene_to_use", "scn_whatever_2"),
(try_begin),

You'll have to put this try_ block in place of this:


        (eq, ":terrain_type", rt_plain),
        (assign, ":scene_to_use", "scn_multi_scene_1", "scn_multi_scene_2"),


There are plenty of examples of this kind of randomisation in the module system. Search for :rand, which is what the local variables for such scripts are called most of the time.
 
I think new textures you added is mounting itself over and over, or inappropriate to that trees texture. take a look to the tree brfs, it may be show you the problem.
This is a start.
So this is a texture issue?
How do I trace down duplicate textures?
Some of the brf files show textures from the dds folder.
Does this mean I've loaded it twice?
Or does a texture in a BRF file actually mean that I've loaded it twice?
 
Hello guys, how can I defeat a kingdom with codes?
ı added this script then I called its but Vaegir Kingdoms doesn't defeat, why?
("vaegir_yok_ol",
    [
(faction_set_slot, "fac_kingdom_2", slot_faction_state, sfs_inactive),
    (faction_set_slot, "fac_kingdom_2", slot_faction_leader, "trp_kingdom_2_lord"),
    (assign, "$players_kingdom", 0),
    (assign, "$players_oath_renounced_against_kingdom", 0),
    (assign, "$players_oath_renounced_given_center", 0),
    (assign, "$players_oath_renounced_begin_time", 0),
    #(call_script, "script_store_average_center_value_per_faction"),
    (call_script, "script_update_all_notes"),
    ]),

Another question
I added this code and all center give to player, but I want to fac_kaingdom_4's centers give to player how can?
(try_begin),
  (try_for_range, ":cur_center", centers_begin, centers_end),
      (store_faction_of_party, "fac_kingdom_4", ":cur_center"),
     
     
      (neg|party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
      (call_script, "script_give_center_to_lord", ":cur_center", "trp_player", 1),
(try_end)
 
frozenpainter said:
      (store_faction_of_party, "fac_kingdom_4", ":cur_center"),
That is not the use for that operation:
Code:
store_faction_of_party                = 2204  # (store_faction_of_party, <destination>, <party_id>),
                                              # Retrieves current faction allegiance of the party.

Call the script that gives a center to a faction and/or lord
  • give_center_to_faction
  • give_center_to_lord
 
I want to all Nord's center give to player at any time,
I can use this:
(call_script, "script_give_center_to_faction_aux", "p_town_1", "fac_kingdom_4"),
But when start the game, Swadians encountered p_town_1 I don't want p_town_1 because it not Nord Land in next time.
 
Do worldmaps with a LOT of forest(s) hurt performance?
My PC can handle a fairly large (~75k vertex) map made up of only forest terrain just fine, but I am interested in the "general" performance impact caused by forest terrain.
 
frozenpainter said:
I want to all Nord's center give to player at any time,
I can use this:
(call_script, "script_give_center_to_faction_aux", "p_town_1", "fac_kingdom_4"),
But when start the game, Swadians encountered p_town_1 I don't want p_town_1 because it not Nord Land in next time.
Iterate through all center parties, use store_faction_of_party as kalarhan posted, then call script_give_center_to_faction_aux if it's fac_kingdom_4.
 
wrwlf said:
Do worldmaps with a LOT of forest(s) hurt performance?
My PC can handle a fairly large (~75k vertex) map made up of only forest terrain just fine, but I am interested in the "general" performance impact caused by forest terrain.

The tree textures are instanced, as far as I know. That means you can have millions of polygons, even on low-end machines. And covering the map in those simple trees would probably only create a few tens of thousands of polys anyway.
 
jacobhinds said:
The tree textures are instanced, as far as I know. That means you can have millions of polygons, even on low-end machines. And covering the map in those simple trees would probably only create a few tens of thousands of polys anyway.
Instancing is a way to reduce the overhead of drawing several copies of the same mesh (not textures), but it does not affect vertex processing (i.e. polygon complexity and rendering cost). It's also not used by the map; the game batches all trees in a large chunk into a single mesh.
 
cmpxchg8b said:
jacobhinds said:
The tree textures are instanced, as far as I know. That means you can have millions of polygons, even on low-end machines. And covering the map in those simple trees would probably only create a few tens of thousands of polys anyway.
Instancing is a way to reduce the overhead of drawing several copies of the same mesh (not textures), but it does not affect vertex processing (i.e. polygon complexity and rendering cost). It's also not used by the map; the game batches all trees in a large chunk into a single mesh.
So trees in scenes and on the map are instanced?
 
I have a similar type of question. In M&B game engine, Which are define performance cost, number of vertices or number of meshes. Should I delete a mesh of invisible side? Or no difference? The following picture is an illustrated example.
First : Poly 46, Second : Poly 36
Thanks :wink:

uOuEZHA.jpg

3oMbUlz.jpg
 
Status
Not open for further replies.
Back
Top Bottom