Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Is there a recommended method of removing old items and adding lots of new ones? I want to replace or change the model for most of the items in Native but manually changing the item mesh for all 600+ items doesn't seem like the most efficient way of doing it. When modders add many of their own items do they simply starts with an empty module_items?
 
I'm trying to add a throwing spear, but I want it to have less range than the other throwing weapons? how can I do that? I tried weight, length and even speed rating but none of these worked..
 
Quick question:
What does the highlighted number stand for in troops.txt? It got changed on a wide number of troops and I haven't touched them lol
Untitled.jpg

thx
 
Rarilmar said:
Quick question:
What does the highlighted number stand for in troops.txt?

open process_troops.py and see how it is converted to .txt
Code:
    file.write("\ntrp_%s %s %s %s %d %d %d %d %d %d\n  "%(convert_to_identifier(troop[0]),replace_spaces(troop[1]),replace_spaces(troop[2]), replace_spaces(str(troop[13])), troop[3],troop[4],troop[5], troop[6], troop[14], troop[15]))

and you have your answer for any .txt value generated. You can either use a Python console to load values into memory (and do a troops check), include a print there (so when you run build_modules it will show you the value) or check module_xxxx.py for that position (remember to count from 0)
 
I have assigned certain props to each team in a single player mission.  I was wondering how to get the bots to target enemy scene props.  Any help is much appreciated!
 
elcapo29 said:
I was wondering how to get the bots to target enemy scene props.

Download Lav's modules
Search section for agents on header_operations.py to find the operations used for AI (like forcing a agent to target something)
 
kalarhan said:
elcapo29 said:
I was wondering how to get the bots to target enemy scene props.

Download Lav's modules
Search section for agents on header_operations.py to find the operations used for AI (like forcing a agent to target something)

Thank you for your quick response.  I have Lavs module system downloaded and I looked through all of the agent and prop operations in header_operations.py.  It looks like most of the AI stuff is for targeting agents and I don't see how to get them to target props.  I know 1257 AD gets their bots to attack props, and so does Full Invasion.  It would be perfect for my mod if I could get this to work.
 
elcapo29 said:
It would be perfect for my mod if I could get this to work.

you can do like some mods and use a invisible agent as the target, while you use the hits to decrease the prop HP; or use a custom AI as you have operations to disable it and force your own behaviour (go there, use this animation, do this, do that, now go back to normal AI); etc
 
Slavos said:
Moonsteel said:
What is the txt code for Guaranteeing that a troop has a polearm? Also where would I put said code?

I don't think that it is possible to do this with .txt files, only with .py files.

I already gave him the answer on another topic. And yes, it is possible as long you are using a newer version of Warband (like 1.16:cool:.

If @Moonsteel still needs help: you need to apply the "|" operation on the guarantee flag with the current value on your troops.txt to add the new flag.

Code:
 ["watchman","Watchman","Watchmen",tf_guarantee_polearm|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield
this is a example from VC. See that this troop has multiple flags (polearms, boots, armor and shield). What you do is take each individual value and apply the "|" operator to generate a unique flag. So in your case, you start with whatever number is there, add the "|tf_guarantee_polearm" to it and replace on .txt

Code:
trp_watchman Watchman Watchmen 0 170917888 0 0 1 32 0
Code:
tf_guarantee_boots            = 0x00100000
tf_guarantee_armor            = 0x00200000
tf_guarantee_helmet           = 0x00400000
tf_guarantee_gloves           = 0x00800000
tf_guarantee_horse            = 0x01000000
tf_guarantee_shield           = 0x02000000
tf_guarantee_ranged           = 0x04000000
tf_guarantee_polearm          = 0x08000000

Code:
0x08000000|0x00100000|0x00200000|0x02000000 = 170917888

its not magic, just math
 
TheCaitularity said:
Can someone please help me understand a couple things about lords and convincing them join your faction/cause?

1. This code:
Code:
		(try_begin),
			(neq, ":liege", "trp_player"),
			(neq, ":liege", "$supported_pretender"), #player is advocate for pretender
			(val_div, ":argument_strength", 2),
			(val_div, ":argument_appeal", 2),
			(val_div, ":result_for_argument", 2),
		(try_end),
I suspect it halves your chances of convincing a lord to join your cause if you're part of a rebellion for a claimant. Is this correct? Is this all it does? I want to know how drastic modifying or removing it would be.

2. This code:
Code:
		(store_skill_level, ":player_persuasion_skill", "skl_persuasion", "trp_player"),
		(try_begin),
			(gt, ":result_for_argument", 0),
			#make sure player is the one making the overture

			#if player has 0 persuasion, ":result_for_argument" will be multiplied by 3/10.
			(store_add, ":player_persuasion_skill_plus_5_mul_066", ":player_persuasion_skill", 5),
			(val_mul, ":player_persuasion_skill_plus_5_mul_066", 2),
			(val_div, ":player_persuasion_skill_plus_5_mul_066", 3),

			(val_mul, ":result_for_argument", ":player_persuasion_skill_plus_5_mul_066"),
			(val_div, ":result_for_argument", 10),
		(else_try),
			(lt, ":result_for_argument", 0),
			(store_sub, ":ten_minus_player_persuasion_skill", 10, ":player_persuasion_skill"),
			(val_mul, ":result_for_argument", ":ten_minus_player_persuasion_skill"),
			(val_div, ":result_for_argument", 10),
		(try_end),
I'm trying to wrap my head around how it works. I want to make higher Persuasion more effective in the whole 'convincing lords to join you' equation, so what would be the most straight-foward way to do this?

3. I want to make your relation with the lord you're trying to convince matter a lot more (at least, a lot more than it apparently seems to). I presume "troop_get_relation_with_troop" has something to do with this, but I'm not seeing how in the actual 'convincing lord' calculation? Is there a way I could crowbar it in (such as, make it check if lord relation is +25 or more, then multiply your chances by 33%)?

Thanks!

Still looking for help on this.
 
Status
Not open for further replies.
Back
Top Bottom