Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Sayd Ûthman said:
thank's it made it clearer in my mind,so if i understand correctly, the first block will run for the first agent, the second block for the second agent and so on ?? but it is supposed to take only 3 and you said 5 agents :razz:
Nope :grin: , all blocks run for all agents, the 5 agents were only example (short one), there may be as well 1000 agents or more.
There are 3 blocks for 3 lowest values (the start value is 100000  to assure that every tested value will be lower).
In most cases the start values will be replaced after first three runs/agents (because all distance values will be lower than start values), it may take longer if the distances will be equal values.
Generally after three runs the min_distance values are changed.
there are 5 agents at distances 15,10,70,13,14;

before loop the values are:
min_distance_1= 100000
min_distance_2= 100000
min_distance_3= 100000

1st run of try_for_agents loop:
cur_dist= 15
min_distance_1= 15  (15 is less than 100000 so it's replaced)
min_distance_2= 100000
min_distance_3= 100000

2nd run of try_for_agents loop:
cur_dist= 10
min_distance_1= 10 (10 is less than 15 so it's replaced, 15 is shifted to min_distance_2)
min_distance_2= 15
min_distance_3= 100000

3rd run of try_for_agents loop:
cur_dist= 70
min_distance_1= 10 (70 is greater than 10, nothing change)
min_distance_2= 15 (70 is greater than 15, nothing change)
min_distance_3= 70 (70 is less than 100000 so it's replaced)

4th run of try_for_agents loop:
cur_dist= 13
min_distance_1= 10 (13 is greater than 10, nothing change)
min_distance_2= 13 (13 is less than 15 so it's replaced, 15 is shifted to min_distance_3)
min_distance_3= 15

5th run of try_for_agents loop:
cur_dist= 14
min_distance_1= 10 (14 is greater than 10, nothing change)
min_distance_2= 13 (14 is greater than 13, nothing change)
min_distance_3= 14 (14 is less than 15 so it's replaced)
 
Is it possible to add new ground textures? I searched and people said no in 2010 - just wondering if changed over the years.

If not, is it possible to replace the native ones modular-ly?

Also, are auto-generated trees in scenes more efficient than those placed as scene-props?
 
Lav said:
celestialred said:
Anyone have an idea what this error code could be point towards?
Check the syntax in your module_troops.py file. Apparently one of your troop tuples has a number where the MS expects to see a string. In troops, this is either name or plural name I think.

You were totally correct. Somehow, I had accidentally deleted a plural on a lord. How I did that...no clue. Lol.

Thank you Lav, I appreciate it.  :grin:

I have one last question...

Is it possible to declare a new type of weapon at all? I know this probably seems like an absurd question.

<3

CR
 
How to tangent-dir a mesh. I knew how to make a normal-map, but haven't known how to tangent dir?
Is there any one know ?
 
as0017 said:
How to tangent-dir a mesh. I knew how to make a normal-map, but haven't known how to tangent dir?
Is there any one know ?

You can do this in OpenBRF, right click on a model and select 'recalculate tangent dirs'.


I have a question.

How can you check in multiplayer if someone is not alive, but spectating? Checking the team doesn't work, cause you're only in spectator when you choose not to play. Checking if the agent is alive doesn't work either, cause the agent gets removed after some time and also when you haven't spawned yet you have no agent. Ah... nevermind, you can check if they have an agent and if they don't they're in spec ^^
 
SonKidd said:
Is it possible to add new ground textures?
Also, are auto-generated trees in scenes more efficient than those placed as scene-props?

1. You can't add but can replace ground textures, look at materials.brf file. It's very simple.
2. Auto-generated trees allow to create smaller scenes (I mean *.sco files with less Kb) and save your time, but if You will change Flora_kinds.py after creating scenes, some trees may appear in places where you don't need at all.
 
Hey everyone,

I have a couple of questions many of you could probably help me (and subsequently others) with that are beginning to creep up.

1. What is a good way to optimize all the textures in a mod? I would like to find ways to reduce the CPU/RAM load with things like texture quality, lots of rigged meshes, etc.

2. What are some good ways to combine and condense the number of BRF files? Are there any do's and don't's you'd recommend?

3. What are some good tips/ideas about music file formats? While .ogg is preferred due to it's size, I'm finding that due to encoding issues, some of my .ogg files simply won't play. They are tagged correctly, because when I move them into being wav files, they play fine.
Error: Unable to load town_british_purcell.ogg StoreStats - success


4. I encountered two interesting bugs that have me somewhat stumped. In my rgl_log I have this:

"HERR_BUFFER_LOCK_FAILED - 145092"

Shortly after that, I CTD'd.

5.  SCRIPT ERROR ON OPCODE 1677: Invalid Map Icon ID: 306; LINE NO: 20:
At script: create_kingdom_hero_party.

I encountered this one shortly after I made all the lords carry the banner of their nation. Curiously, none of the kingdom lord parties seem to carry their banner. This is my code.

Code:
 We assume there are enough banners for all kingdom heroes.

      #faction banners
      (faction_set_slot, "fac_kingdom_1", slot_faction_banner, "mesh_banner_kingdom_f"),
      (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_f"),
      (faction_set_slot, "fac_kingdom_8", slot_faction_banner, "mesh_banner_kingdom_b"),
      (faction_set_slot, "fac_kingdom_9", slot_faction_banner, "mesh_banner_kingdom_c"),
      (faction_set_slot, "fac_kingdom_10", slot_faction_banner, "mesh_banner_kingdom_a"),
      (faction_set_slot, "fac_kingdom_11", slot_faction_banner, "mesh_banner_kingdom_d"),
      (faction_set_slot, "fac_kingdom_12", slot_faction_banner, "mesh_banner_kingdom_e"),
	  #(faction_set_slot, "fac_kingdom_13", slot_faction_banner, "mesh_banner_kingdom_e"),

      (try_for_range, ":cur_faction", npc_kingdoms_begin, npc_kingdoms_end),
        (faction_get_slot, ":cur_faction_king", ":cur_faction", slot_faction_leader),
        (faction_get_slot, ":cur_faction_banner", ":cur_faction", slot_faction_banner),
        (val_sub, ":cur_faction_banner", banner_meshes_begin),
        (val_add, ":cur_faction_banner", banner_scene_props_begin),
        (troop_set_slot, ":cur_faction_king", slot_troop_banner_scene_prop, ":cur_faction_banner"),
      (try_end),
      #(assign, ":num_khergit_lords_assigned", 0),
      #(assign, ":num_sarranid_lords_assigned", 0),
      #(assign, ":num_other_lords_assigned", 0),

      (try_for_range, ":kingdom_hero", active_npcs_begin, active_npcs_end),
        (this_or_next|troop_slot_eq, ":kingdom_hero", slot_troop_occupation, slto_kingdom_hero),
        (troop_slot_eq, ":kingdom_hero", slot_troop_occupation, slto_inactive_pretender),

        (store_troop_faction, ":kingdom_hero_faction", ":kingdom_hero"),
        (neg|faction_slot_eq, ":kingdom_hero_faction", slot_faction_leader, ":kingdom_hero"),
        (try_begin),
          (eq, ":kingdom_hero_faction", "fac_kingdom_1"), #French
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, "spr_banner_a"),
        (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_2"), #British
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, "spr_banner_b"),
        (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_3"), #HRE
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, "spr_banner_c"),
        (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_4"), #Bavaria
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, "spr_banner_d"),
        (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_5"), #Dutch
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, "spr_banner_e"),
        (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_6"), #Spanish Bourbons
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, "spr_banner_f"),
        (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_7"), #Denmark
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, "spr_banner_g"),
        (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_8"), #Sweden
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, "spr_banner_h"),
        (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_9"), #Prussia
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, "spr_banner_i"),
        (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_10"), #Spanish Habsburgs
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, "spr_banner_k"),
        (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_11"), #Poland
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, "spr_banner_j"),
        (else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_12"), #Russia
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, "spr_banner_l"),
        (try_end),
      
        #(try_begin),
        #  (this_or_next|lt, ":banner_id", banner_scene_props_begin),
        #  (gt, ":banner_id", banner_scene_props_end_minus_one),
        #  (display_message, "@{!}ERROR: Not enough banners for heroes!"),
        #(try_end),

The mesh_banner_kingdom redundancy is until our arms are finish being made. How would I write another "else_try" for the kingdom leader (which is what I presume the error is about since none of them seem to carry their nation's banner).

Thank you all :smile:

<3

CR
 
Dargor said:
SonKidd said:
Is it possible to add new ground textures?
Also, are auto-generated trees in scenes more efficient than those placed as scene-props?

1. You can't add but can replace ground textures, look at materials.brf file. It's very simple.
2. Auto-generated trees allow to create smaller scenes (I mean *.sco files with less Kb) and save your time, but if You will change Flora_kinds.py after creating scenes, some trees may appear in places where you don't need at all.

ah thanks.

Is it possible to make the changes of ground textures modular?
 
celestialred said:
1. What is a good way to optimize all the textures in a mod? I would like to find ways to reduce the CPU/RAM load with things like texture quality, lots of rigged meshes, etc.

3. What are some good tips/ideas about music file formats? While .ogg is preferred due to it's size, I'm finding that due to encoding issues, some of my .ogg files simply won't play. They are tagged correctly, because when I move them into being wav files, they play fine.
Error: Unable to load town_british_purcell.ogg StoreStats - success
For all things optimization, trust in xeno: [INFO] Texture optimization: some fine print.

[Info] Optimization Announcement: Sound and your Mods

celestialred said:
2. What are some good ways to combine and condense the number of BRF files? Are there any do's and don't's you'd recommend?
Might want to chat with monnikje about that...he's done more combining and recombining of .brfs from Native and umpteen OSPs than I can shake a stick at.
 
Caba`drin said:
celestialred said:
1. What is a good way to optimize all the textures in a mod? I would like to find ways to reduce the CPU/RAM load with things like texture quality, lots of rigged meshes, etc.

3. What are some good tips/ideas about music file formats? While .ogg is preferred due to it's size, I'm finding that due to encoding issues, some of my .ogg files simply won't play. They are tagged correctly, because when I move them into being wav files, they play fine.
Error: Unable to load town_british_purcell.ogg StoreStats - success
For all things optimization, trust in xeno: [INFO] Texture optimization: some fine print.

[Info] Optimization Announcement: Sound and your Mods

celestialred said:
2. What are some good ways to combine and condense the number of BRF files? Are there any do's and don't's you'd recommend?
Might want to chat with monnikje about that...he's done more combining and recombining of .brfs from Native and umpteen OSPs than I can shake a stick at.

Thanks Caba :smile: I appreciate it. You're always quite helpful.

<3

CR
 
Caba`drin said:
captain lust said:
Just started scripting in the module system...

Wondering if there is any code for the banners that appear above the heads of friendly troops or if it's all hard-coded. Basically, I'm looking to modify it so that a spectator (in multiplayer) can view these banner icons for all troops, as a way to give a clearer indication about which team each player is on.

Any advice or nudges in useful directions would be appreciated :smile:.
The mission_template_trigger named "common_battle_init_banner" calls the script "script_troop_agent_set_banner" that in turn calls another script "script_agent_troop_get_banner_mesh" that figures out which banner to draw over the various agents.

You likely need only to concern yourself with the final of these scripts.
Put this to one side for a while but now I'm trying to work it out again.

Cannot, for the life of me, see where it tells the game to only show the banner icons for your teammates. Any clues?
 
I had the same idea, but never got around to it. Lemme take a look-see for ya.

Edit: A quick look doesn't show anything about setting them explicitly, so I'm going to wager a guess that it's done implicitly (hardcoded) via team relations. If so, a quick fix should be to set the spectator team as allies to both playing teams. This *should* be perfectly safe, as the spec team shouldn't be spawning any agents. *knocks on wood.
 
captain lust said:
Caba`drin said:
The mission_template_trigger named "common_battle_init_banner" calls the script "script_troop_agent_set_banner" that in turn calls another script "script_agent_troop_get_banner_mesh" that figures out which banner to draw over the various agents.

You likely need only to concern yourself with the final of these scripts.
Put this to one side for a while but now I'm trying to work it out again.

Cannot, for the life of me, see where it tells the game to only show the banner icons for your teammates. Any clues?
Sorry for the poor advice lust. I could have sworn there was an (agent_is_ally) check in one of those scripts or in the tableau material code ("game_troop_label_banner"), but it must have been a figment of my imagination.
 
Status
Not open for further replies.
Back
Top Bottom