Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Does anybody know what exactly itp_secondary/itp_primary do?

I think it makes the AI use the primary weapon unless there is a script that commands them to use the secondary weapon.
However I made an item that has only itp_secondary which resulted in the fact that the player can't use it at all. (He can wear it as a weapon but he can't draw it.)

The Module System Documentation about it:
- It uses item flags that mark it as a one-handed melee weapon. Troops who are equipped with "practice_sword" will consider "practice_sword" when choosing a primary melee weapon from their inventory listing. They will also consider "practice_sword" when choosing a backup (secondary) weapon.

But I didn't find an item that had only itp_secondary. So is it useless afterall? 
 
Deutch1 said:
anyone know how you model clothes for warband im completley clueless here.

check the openBRF subforum: http://forums.taleworlds.com/index.php/board,215.0.html



Masterancza said:
Should this operation...

(agent_equip_item, <agent_id>, <item_id>, [weapon_slot_no]),

...looks in practice like this...

(agent_equip_item, ":agent", [1]),

...or like this:

(agent_equip_item, ":agent", 1),

I'm interested in [weapon_slot_no], not item_id!

agent_get_wielded_item will retrieve the item_id.

Like was said above when you see a [<something>] that means you do not need to inform that, unless it makes sense. Watch out for this warning:
then the agent must have an empty weapon slot for the operation to succeed.

 
Quick question.

Is it possible to have an item purchasable by all faction merchants? Curious because I made a few items that don't really fit under one specific faction so allowing them to be sold by all factions would be great. May not even be possible but figured I'd ask. Python edits would be preferred because I'd like it to "stick" through re-compiles. Using them in Floris.

Is it really as simple as Morgh's editor makes it seem? Can I really just select all 5 factions and call it a day? Guess I could test it but don't want to trash everything in my next play-through and not realize it tell 100+ hours into the game lol. If it really isn't set up to accept more than one faction then that's fine. Not a huge deal. Just thought I'd ask.

Thanks in advance.
 
200Down said:
Quick question. Is it possible to have an item purchasable by all faction merchants?
Curious because I made a few items that don't really fit under one specific faction so allowing them to be sold by all factions would be great. May not even be possible but figured I'd ask. Python edits would be preferred because I'd like it to "stick" through re-compiles. Using them in Floris.

Is it really as simple as Morgh's editor makes it seem? Can I really just select all 5 factions and call it a day? Guess I could test it but don't want to trash everything in my next play-through and not realize it tell 100+ hours into the game lol. If it really isn't set up to accept more than one faction then that's fine. Not a huge deal. Just thought I'd ask.

Thanks in advance.

Somebody said:
Either check all the factions, or don't specify a faction at all for it to be available to all merchants for that item's type.

Code:
####################################################################################################################
#  Each item record contains the following fields:
#  1) Item id: used for referencing items in other files.
#     The prefix itm_ is automatically added before each item id.
#  2) Item name. Name of item as it'll appear in inventory window
#  3) List of meshes.  Each mesh record is a tuple containing the following fields:
#    3.1) Mesh name.
#    3.2) Modifier bits that this mesh matches.
#     Note that the first mesh record is the default.
#  4) Item flags. See header_items.py for a list of available flags.
#  5) Item capabilities. Used for which animations this item is used with. See header_items.py for a list of available flags.
#  6) Item value.
#  7) Item stats: Bitwise-or of various stats about the item such as:
#      weight, abundance, difficulty, head_armor, body_armor,leg_armor, etc...
#  8) Modifier bits: Modifiers that can be applied to this item.
#  9) [Optional] Triggers: List of simple triggers to be associated with the item.
#  10) [Optional] Factions: List of factions that item can be found as merchandise.
####################################################################################################################

Look at number 10 above. It is the list of factions for a item, but it is marked as [optional]. That means you do not need to inform it, you can leave it blank (end your item at position 8 or 9). Same will apply to any other optional entry in the modules.
 
Ok thanks a bunch.

Got another one for ya. Need to remove the "Upgrade to" part of the line when upgrading troops. Have some troop names that are a bit too long and getting cut off. Would fit fine without that "upgrade to" text though. Any idea what py that would be in? Dug around awhile and didn't find anything but didn't check every py for references to upgrade_to or upgrade to. I just gave up. Thanks for the quick response on the last question btw.
 
Essentially, copy languages/en/ui.csv file to Modules/<YourModule>/languages/en/ui.csv, find ui_upgrade_to_value parameter and change it however you wish (retaining %-markers so the engine will know where to put troop name and upgrade price).
 
Life_Erikson said:
Does anybody know what exactly itp_secondary/itp_primary do?
In my experience, weapons which are marked with itp_secondary only, cannot be equipped at all. No idea why, but it seems the choice is between declaring item as itp_primary or itp_primary|itp_secondary.

I also searched long and hard for effects of these flags, but everything I found was extremely inconclusive.
 
THANK YOU soo much guys! Glad I didn't keep looking, seems I woulda just been running in circles :smile: That's exactly the info I needed. Thanks again, yall are very helpfull.

Edit:

Worked like a charm in both cases  :razz:

Seeing as how you all are so knowledgeable about this stuff. One last one. Promise, at least for awhile haha.

So, this is a weird one.
Something that's gotten under my skin sense day one with this game is the simple fact that my dude screams continuously in combat. Doesn't bother me that everyone else does but good lord........, literally every time I raise a melee weapon it's constant yelling from my character which drowns out all other sounds sense it seems to be at a higher decibel. It's like the sound file is continuously looped over and over. I've pretty much just shut off sound for the time being cuzz it drove me that crazy after awhile. Is there a way to adjust or even completely remove the yelling sounds from your "own" character? I'm assuming that editing the male yelling sound file to basically a blank wave would only accomplish removing every male's yelling which I'd rather not do. Hell, I'd be fine even with just a lowered chance it happening or even a lower dB level for the player character.

See, told yaz it's a weird one  :roll: Seriously if nobody knows of the top of their head then no worries. Really it's an odd request and don't expect anyone to even have tried it before. Just hoping someone may know the general direction where I could start looking.


 
Code:
("man_yell",sf_priority_5|sf_vol_8, ["man_yell_4.ogg","man_yell_4_2.ogg","man_yell_7.ogg","man_yell_9.ogg","man_yell_11.ogg","man_yell_13.ogg","man_yell_15.ogg","man_yell_16.ogg","man_yell_17.ogg","man_yell_20.ogg","man_shortyell_4.ogg","man_shortyell_5.ogg","man_shortyell_6.ogg","man_shortyell_9.ogg","man_shortyell_11.ogg","man_shortyell_11b.ogg",
                        "man_yell_b_18.ogg","man_yell_22.ogg", "man_yell_c_20.ogg"]),

Perhaps by  replacing some sounds by others more varied, not necessarily with yells
(existing screams are too similar and it gives the impression of repetitiveness ...)

Off topic : What's this invasion of cats? !!
 
fladin said:
Code:
("man_yell",sf_priority_5|sf_vol_8, ["man_yell_4.ogg","man_yell_4_2.ogg","man_yell_7.ogg","man_yell_9.ogg","man_yell_11.ogg","man_yell_13.ogg","man_yell_15.ogg","man_yell_16.ogg","man_yell_17.ogg","man_yell_20.ogg","man_shortyell_4.ogg","man_shortyell_5.ogg","man_shortyell_6.ogg","man_shortyell_9.ogg","man_shortyell_11.ogg","man_shortyell_11b.ogg",
                        "man_yell_b_18.ogg","man_yell_22.ogg", "man_yell_c_20.ogg"]),

Perhaps by  replacing some sounds by others more varied, not necessarily with yells
(existing screams are too similar and it gives the impression of repetitiveness ...)

Off topic : What's this invasion of cats? !!

Actually, that may work quite well. Just use the existing one and change pitches, length, and tempo of it to get more varied ones....., nice idea. I'll give it a shot sometime and see how much I can do with just plain old audacity. Should be good enough to do that much anyways.

Have any clue where to introduce the code though or where the current one resides that calls on the current sound files? I've yet to ever mess with anything related to sounds in the game so totally clueless there.

Edit: Derp, nevermind hadn't noticed the sound py before. haha
 
Anyone have idea why my code is not working? It don't shows any errors, it's just not working. This code should force troops, that have spears to equip it, because the're never using it when they have some other weapons in inventory. (Yes, I have added walka_dzida, to the lead_charge triggers. I'm not a noob in modding, but there are things that I don't know.) Please, only advanced modders.

walka_dzida = (
  1, 0, 0, [],
    [
  (store_trigger_param_1, ":enemy_agent"),
  (try_for_agents, ":agent"),
  (agent_is_active, ":agent"),
      (agent_is_human, ":agent"),
  (neq, ":agent", "trp_player"),
  (agent_get_item_slot, ":item", ":agent", 0),
  (item_get_type, ":type", ":item"),
  (eq, ":type", itp_type_polearm),#dzida/wlocznia/pika/kostur
      (try_begin),
      (item_get_weapon_length, ":zasieg", ":item"),
      (agent_is_active, ":enemy_agent"),
      (agent_is_human, ":enemy_agent"),
  (neq, ":enemy_agent", "trp_player"),
      (neg|agent_is_ally, ":enemy_agent"),
  (agent_get_position, pos1, ":agent"),
  (agent_get_position, pos2, ":enemy_agent"),
      (get_distance_between_positions, ":dystans", pos1, pos2),
  (agent_get_item_slot, ":item_2", ":agent", 1),
  (try_end),
  (try_begin),
      (ge, ":dystans", ":zasieg"),
      (agent_equip_item, ":agent", ":item"),
  #(display_message, "@Debug: Infantry should use spears now."),
      (try_end),
      (try_begin),
      (lt, ":dystans", ":zasieg"),
      (agent_equip_item, ":agent", ":item_2"),
  #(display_message, "@Debug: Infantry should use non-spear weapons now."),
      (try_end),  
  ]) 
 
fladin said:
a (try_end),  is missing

Oh, yeah because I've used (try_for_agents, blah blah blah...), Now I see. I will try my code in game again.

EDIT

It shows error after correction. Any idea what causes it? The code seems to be ok.

1z1r5a0.png

 
perhaps it may be necessary to check if the agent has an item in slot 0

something like :

    (agent_get_item_slot, ":item", ":agent", 0),
    (gt,":item",0),
    (item_get_type, ":type", ":item"),
    (eq, ":type", itp_type_polearm),#dzida/wlocznia/pika/kostur
 
walka_dzida = (
  1, 0, 0, [],
    [
    (store_trigger_param_1, ":enemy_agent"), # the trigger is regular, so it has no parameters
    (try_for_agents, ":agent"),
    (agent_is_active, ":agent"),
      (agent_is_human, ":agent"),
    (neq, ":agent", "trp_player"), # agents and troops are completely different things. Troops are templates for agents. You should use get_player_agent_no and compare with that
    (agent_get_item_slot, ":item", ":agent", 0),
    (item_get_type, ":type", ":item"), # you should check that the item is not -1. -1 means bare hands
    (eq, ":type", itp_type_polearm),#dzida/wlocznia/pika/kostur
      (try_begin),
      (item_get_weapon_length, ":zasieg", ":item"),
    (agent_is_active, ":enemy_agent"),
      (agent_is_human, ":enemy_agent"),
    (neq, ":enemy_agent", "trp_player"),
      (neg|agent_is_ally, ":enemy_agent"),  # invalid stuffs since enemy_agent is unknown

    (agent_get_position, pos1, ":agent"),
    (agent_get_position, pos2, ":enemy_agent"),
      (get_distance_between_positions, ":dystans", pos1, pos2),
    (agent_get_item_slot, ":item_2", ":agent", 1),
    (try_end),
    (try_begin),
      (ge, ":dystans", ":zasieg"),
      (agent_equip_item, ":agent", ":item"), # if the agent has the item, but it is not wielded, use agent_set_wielded_item; same below
    #(display_message, "@Debug: Infantry should use spears now."),
      (try_end),
      (try_begin),
      (lt, ":dystans", ":zasieg"),
      (agent_equip_item, ":agent", ":item_2"),
    #(display_message, "@Debug: Infantry should use non-spear weapons now."),
      (try_end),     
      # missing try end for try_for_agents
  ])
 
The_dragon said:
walka_dzida = (
  1, 0, 0, [],
    [
    (store_trigger_param_1, ":enemy_agent"), # the trigger is regular, so it has no parameters
    (try_for_agents, ":agent"),
    (agent_is_active, ":agent"),
      (agent_is_human, ":agent"),
    (neq, ":agent", "trp_player"), # agents and troops are completely different things. Troops are templates for agents. You should use get_player_agent_no and compare with that
    (agent_get_item_slot, ":item", ":agent", 0),
    (item_get_type, ":type", ":item"), # you should check that the item is not -1. -1 means bare hands
    (eq, ":type", itp_type_polearm),#dzida/wlocznia/pika/kostur
      (try_begin),
      (item_get_weapon_length, ":zasieg", ":item"),
    (agent_is_active, ":enemy_agent"),
      (agent_is_human, ":enemy_agent"),
    (neq, ":enemy_agent", "trp_player"),
      (neg|agent_is_ally, ":enemy_agent"),  # invalid stuffs since enemy_agent is unknown

    (agent_get_position, pos1, ":agent"),
    (agent_get_position, pos2, ":enemy_agent"),
      (get_distance_between_positions, ":dystans", pos1, pos2),
    (agent_get_item_slot, ":item_2", ":agent", 1),
    (try_end),
    (try_begin),
      (ge, ":dystans", ":zasieg"),
      (agent_equip_item, ":agent", ":item"), # if the agent has the item, but it is not wielded, use agent_set_wielded_item; same below
    #(display_message, "@Debug: Infantry should use spears now."),
      (try_end),
      (try_begin),
      (lt, ":dystans", ":zasieg"),
      (agent_equip_item, ":agent", ":item_2"),
    #(display_message, "@Debug: Infantry should use non-spear weapons now."),
      (try_end),     
      # missing try end for try_for_agents
  ])

After fixes my code is working. Thank you!
 
Hi,
I added this code :
http://forums.taleworlds.com/index.php/topic,128749.msg3106195.html#msg3106195
and I added to a troop look like:
["nord_trained_footman","Nord Trained Footman","Nord Trained Footmen",tf_guarantee_boots|tf_large|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_helmet,0,0,fac_kingdom_4,[itm_one_handed_war_axe_a,itm_one_handed_war_axe_b,itm_one_handed_battle_axe_a,itm_tab_shield_round_b,itm_skullcap,itm_nasal_helmet,itm_nordic_footman_helmet,itm_byrnie,itm_studded_leather_coat,itm_leather_boots],def_attrib|level(14),wp(100),knows_ironflesh_3|knows_power_strike_3|knows_power_throw_2|knows_riding_2|knows_athletics_3|knows_shield_2,nord_face_young_1,nord_face_old_2],
and when I killed this troop his arms grow longer.look like:
mb9.jpg

 
Status
Not open for further replies.
Back
Top Bottom