Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
PitchPL said:
pete99 said:
Where would you go to change what footstep sound is used when? I don't want to have to actually replace the sounds in the sound files, but instead am interested in changing which sound from the sound file they use when walking.
Thanks,
module_sounds thats all what you can do  I belive

And to modify sounds on the world map edit module_map_icons.py:

map_icons = [
  ("player",0,"player", 0.2, snd_footstep_grass),
 
Code:
############################ BOUNTY TROOPS BEGIN
    ["bounty_1_knight",
		"Rogue Knight",
		"Rogue Knights",
		# tf_mounted | tf_guarantee_helmet | tf_guarantee_shield | tf_guarantee_armor | tf_guarantee_boots | tf_guarantee_horse | tf_guarantee_gloves,
	    tf_guarantee_helmet | tf_guarantee_shield | tf_guarantee_armor | tf_guarantee_boots | tf_guarantee_gloves,
		0, 0, fac_kingdom_1,
		[
      itm_cp391_sword,
      itm_sword_type_xiii,
      itm_sword_type_xiiib,
     
      itm_sword_type_xiiia,
      itm_mace_2,
      itm_mace_3,
      itm_mace_4,
      itm_morningstar,
      #itm_talak_mace,
      # itm_heraldic_lance,
      # itm_heavy_lance,

	  itm_mail_mittens,

      itm_mail_coif,
      
      itm_mail_coif_c,
      itm_rnd_helm_04,
      itm_great_helmet_decorative,
      itm_flat_topped_helmet_b,
      itm_great_helmet_a,
      itm_elm6,
      itm_elm8,
      itm_great_helmet_b,
      itm_great_helmet_c,
      itm_kettlehat_b,
        itm_rnd_helm_03,
     
      itm_norman_faceplate,
      itm_norman_coif_e,
      itm_vik_norman_helmet_b,
      itm_rnd_helm_05,
      itm_rnd_helm_06,
      itm_mail_coif,
      itm_rhodok_great_helmet,

      itm_mail_boots,
      itm_splinted_greaves,
      itm_frenchpepperpot2,
      itm_frenchpepperpot3,
      itm_munitionshelm2,
      itm_pepperpothelm1,
      itm_munitionshelm1,
      itm_frenchpepperpot,
     

      # itm_tab_shield_heater_c,

     (itm_tab_shield_heater_c, imod_thick),
     (itm_tab_shield_heater_c, imod_reinforced),	
	 
			itm_warhorse,

      itm_rnd_surcoat_01,
      itm_rnd_surcoat_02,
      itm_rnd_surcoat_03,
      itm_rnd_surcoat_04,
      itm_rnd_surcoat_05,
      itm_rnd_surcoat_06,
      itm_rnd_surcoat_07,
      itm_rnd_surcoat_08,
      itm_rnd_surcoat_09,
      itm_rnd_surcoat_10,
      itm_rnd_surcoat_11,
      itm_rnd_surcoat_12,
      itm_rnd_surcoat_13,
      itm_rnd_surcoat_14,
      itm_rnd_surcoat_15,
      itm_rnd_surcoat_16,
      itm_rnd_surcoat_17,
      itm_rnd_surcoat_18,
      itm_rnd_surcoat_19,
      itm_rnd_surcoat_20,
      itm_rnd_surcoat_21,
      itm_rnd_surcoat_22,
      itm_rnd_surcoat_23,
		],
    # horse_attrib_elite, nbl_knight_wp, nbl_knight_skills,
    horse_attrib_elite, wp(360), nbl_knight_skills,
		euro_face_1, euro_face_2
	],
Why is the game refusing to add the troop above to the ID_troops.py file and thus returns errors when i try to reference it? Maybe the game has a limit to the amount of troops? It added up to ID 3468 in my file.
Edit: Nevermind. I accidentally named two of the troops with the trp_ prefix so that's why.
 
KratosMKII said:
or are they hardcoded?

yes and no. Yes hardcoded, no as you can override the default behaviour (workaround them) of the engine and add your own rules, like stopping a horseman from dying because X, or updating health from NPC on a different rate.
 
Hello, I created a location similar to Zendar (no faction, own menu, using mt_town_default).

Other than quest NPCs that have their own lines in module_dialogs.py, I added some generic troops using

Code:
(set_visitor,14,"trp_steppe_bandit"),
(set_visitor,15,"trp_steppe_bandit"),
(set_visitor,16,"trp_steppe_bandit"),

in module_game_menus.py.

But when you initiate a conversation with them they all say "Surrender or die, make your choice". Is there a way to assign these troops another line only for this scene without interfering with their lines in other occasions?
 
hello guys i have two questions the first one : after i added some cities in my map and some villages so when i entered the city it was fine but  the villages how can i say it in words ok villagers are roaming in circles in an open field  :grin: :grin: so how do i fix them ? the second one that i put a faction on the other side on an big island for w\example but i see the lords and villagers trapped in the island they are moving on the last line of the shore running and dont cross the sea so what should i do thanks in advance and sorry for taking so much time in reading
 
Hi all,

Do operations like troop_set_name , troop_set_faction, troop_raise_profeciency, etc... persist throughout the game (e.g if I use troop_set_name to call "trp_swordsman" --> "@Spearman", will all trp_swordsman be called that from now on)?
 
Hello everyone!

I have a problem related to in-game materials. I would like to make a code which replaces the texture of an armor of an agent to another one (i.e plate armor text to heraldic armor text). All of that needs to happen on the same scene. I found a command but not sure if it is good for this: cur_item_set_material; as I don't know what string should be written in <string_no> spot.
 
RexDimitrius said:
Hello everyone!

I have a problem related to in-game materials. I would like to make a code which replaces the texture of an armor of an agent to another one (i.e plate armor text to heraldic armor text). All of that needs to happen on the same scene. I found a command but not sure if it is good for this: cur_item_set_material; as I don't know what string should be written in <string_no> spot.

string_no takes the material name as the argument
 
Khamukkamu said:
Do operations like troop_set_name , troop_set_faction, troop_raise_profeciency, etc... persist throughout the game (e.g if I use troop_set_name to call "trp_swordsman" --> "@Spearman", will all trp_swordsman be called that from now on)?

use can use them, save your game and use a savegame file editor to check for any special cases

in case you want to change troop inventory tho: remember to update your module.ini flag



RexDimitrius said:
cur_item_set_material
Code:
cur_item_set_material               = 1978  # (cur_item_set_material, <string_no>, <sub_mesh_no>, [<lod_begin>], [<lod_end>]),
                                            # Version 1.161+. Only call inside ti_on_init_item trigger. Replaces material that will be used to render the item mesh. Use 0 for <sub_mesh_no> to replace material for base mesh. LOD values are optional. If <lod_end> is used, it will not be loaded.



zidozido said:
villagers are roaming in circles in an open field
see a Native village for a example/template. You need to create the AI mesh (used for walking around) and the proper entry points to control where they go to. You can also study the mission template code used for moving them around.



Ibn Husayn said:
But when you initiate a conversation with them they all say "Surrender or die, make your choice". Is there a way to assign these troops another line only for this scene without interfering with their lines in other occasions?

dialogs are processed from top to bottom, with first comes first goes. They have the condition block that must be true, otherwise it tries the next, and the next, and the... until one (for NPCs) is found - remember player can get multiple dialogs options, so more than 1 is possible.

Now open your module_dilaogs.py and see that above. It has no conditions. So if all the others - above it - are not applicable because you forgot something, you have a bug, or it is a new type of dialog and you forgot to add it... that one will always fire.


Code:
[anyone,
 "start",
  [], # no conditions check
   "Surrender or die. Make your choice", "battle_reason_stated",[]],
 
Thank you kalarhan. I have another question.

I'm trying to make a scene where you fight hostile NPCs, similar to a bandit lair I'd say. I created a new mission templates and made those NPCs hostile by adding
Code:
mtef_team_1
to their respective entry points. However, they charge at me the moment I enter the scene. I want them to attack only when the player is in close range to them. Is there an easy way of doing this?
 
Maglubiyet said:
I want them to attack only when the player is in close range to them. Is there an easy way of doing this?

easy is hard to define, but you have a few options. You can disable the agents, keep them on a neutral team, spawn them at a event (not mission start), etc. See header_operations.py for the agents AI operations.

now if you need a example you can just check the Native mission template "bandit_lair", which uses a mix of custom AI (controlling destination), distance trigger, and alarming state.



KratosMKII said:
And i suppose the troop can be killed by using troop_set_health and set it to 0?
the soldiers on a scene are not troops, they are agents. So look for the agents operations instead.

to detect horse dying you can use trigger
Code:
ti_on_agent_killed_or_wounded = -26.0 # Agent has been defeated in battle (killed or wounded)
    # trigger param 1 = defeated agent_id
    # trigger param 2 = attacker agent_id
    # trigger param 3 = wounded flag: 0 = agent is killed, 1 = agent is wounded
    # If (set_trigger_result) with non-zero parameter is used in the code, it will override the agent's fate. Use value of 1 to force kill, and 2 to force wounded.
you can use the same trigger to avoid horseman death
 
KratosMKII said:
Thank you. And i suppose the troop can be killed by using troop_set_health and set it to 0?
You should use the command 'agent_deliver_damage_to_agent' for kill an agent (troop):
(agent_deliver_damage_to_agent, <agent_id_deliverer>, <agent_id>, <value>)
e.g. (agent_deliver_damage_to_agent, ":agent_for_kill", -1, 300) or (agent_deliver_damage_to_agent, ":agent_for_kill", ":agent_for_kill", 300)
 
kalarhan said:
zidozido said:
villagers are roaming in circles in an open field
see a Native village for a example/template. You need to create the AI mesh (used for walking around) and the proper entry points to control where they go to. You can also study the mission template code used for moving them around.

i am so sorry for not clarifying the problem because i didnt provide the information in a clear way my problem that they are roaming in a field  there is no village no buildings nothing except a nice green field so i would like to know where is the village ?
also i have a very weird syntax error when compiling the module and i dont know how to fix it its really annoying as almost every time i add a new thing in the mod i get the same error and fixing it by copy paste the code from a backup but the problem this time that there is no backup :smile: :smile:
here is the error :
Code:
Loading module... FAILED.
MODULE `scenes` ERROR:
Traceback (most recent call last):
  File "compile.py", line 107, in <module>
    from module_scenes import *
  File "F:\Mount and Blade - Warband\Modules\Alpujarras Wars V.4 test\code\module_scenes.py", line 2139
    try:
      ^
SyntaxError: invalid syntax


COMPILATION FAILED.

Press any key to continue . . .

and here is the code
Code:
("enterprise_tannery",sf_generate,"ch_meet_steppe_a", "bo_encounter_spot", (-40,-40),(40,40),-100,"0x000000012004480500040902000041cb00005ae800000ff5",
    [],[]),
  ("enterprise_winery",sf_indoors,"winery_interior", "bo_winery_interior", (-40,-40),(40,40),-100,"0",
    [],[]),
  ("enterprise_mill",sf_indoors,"mill_interior", "bo_mill_interior", (-40,-40),(40,40),-100,"0",
    [],[]),
  ("enterprise_smithy",sf_indoors,"smithy_interior", "bo_smithy_interior", (-40,-40),(40,40),-100,"0",
    [],[]),
  ("enterprise_dyeworks",sf_indoors,"weavery_interior", "bo_weavery_interior", (-40,-40),(40,40),-100,"0",
    [],[]),
  ("enterprise_linen_weavery",sf_indoors,"weavery_interior", "bo_weavery_interior", (-40,-40),(40,40),-100,"0",
    [],[]),
  ("enterprise_wool_weavery",sf_indoors,"weavery_interior", "bo_weavery_interior", (-40,-40),(40,40),-100,"0",
    [],[]),
  ("enterprise_brewery",sf_indoors,"brewery_interior", "bo_brewery_interior", (-40,-40),(40,40),-100,"0",
    [],[]),
  ("enterprise_oil_press",sf_indoors,"oil_press_interior", "bo_oil_press_interior", (-40,-40),(40,40),-100,"0",
    [],[]),


try:
 component_name = "scenes"
 var_set = { "scenes" : troops }
 from modmerger import modmerge
 modmerge(var_set)
except:
 raise
# modmerger_end

# modmerger_end
 
hello everyone!
I have a problem here that I don't know what's the problem, so I started editing the taverns and arenas, it was all okay till I arrived at the arenas, I wanted to have the arena in a scene like castles_interior and tavern, so I did this in module_scenes.
Code:
....
  ("town_5_arena",sf_generate,"wots_interior_dojo", "bo_wots_interior_dojo", (0,0),(100,100),-100,"0",["exit"],[]),
....
i tried to follow the tavern one, thought it might work without problem.
....
  ("town_5_tavern",sf_indoors, "wots_interior_inn", "bo_wots_interior_inn", (-100,-100),(100,100),-100,"0",["exit"],[]),
....
It compiled well without any problems and when i start a new game and try to test and work on my new scenes, everything goes ok till i try the arena scene
this happen
7td07tw.png
when i click "abandonner" or "recommencer" the game will crash, if i select "ignorer" few times, this happen
fWaH5jz.png

how do I fix this?
thanks in advance!
Edit 1: fixed, how stupid of me, I didn't set it to "sf_indoors" I left it to "sf_generate"

EDIT2:Another question how do I make the lords/NPCs who are spawned by an entry point for example lords in town castle/interior/keep spawn with an animation,
I have a sitting animation and I want them to spawn with it or play the animation the moment they are spawned, how do I do that?

EDIT3: What does this error mean?
Code:
  File "C:\Users\iqd\Desktop\WOTS Module_system 1.171\compiler.py", line 1576, i
n check_syntax
    if type(entity[index]) != list:
IndexError: list index out of range

FAILED.
MODULE `mission_templates` ERROR:
failed to parse element #24
  failed to parse element #0
    not enough elements in module `mission_templates` entity `arena_melee_fight`
 (4 total): (-19.0, 0, 0, 'list[len=30]')


COMPILATION FAILED.
 
Status
Not open for further replies.
Back
Top Bottom