Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
HelrothHyrmir said:
How to add new mercenary troops? (Troops that can only be recruited from taverns)

kalarhan said:
KnightV said:
How to add new mercenaries?What may i do?

create new troops and put them on the same range as the original

Code:
mercenary_troops_begin = "trp_watchman"
mercenary_troops_end = "trp_mercenaries_end"

so between "watchman" and "mercenaries_end"

remember to start a fresh new game
 
kalarhan said:
HelrothHyrmir said:
How to add new mercenary troops? (Troops that can only be recruited from taverns)

kalarhan said:
KnightV said:
How to add new mercenaries?What may i do?

create new troops and put them on the same range as the original

Code:
mercenary_troops_begin = "trp_watchman"
mercenary_troops_end = "trp_mercenaries_end"

so between "watchman" and "mercenaries_end"

remember to start a fresh new game

Yeah, but how to modify the price of that mercenary unit?
 
I have downloaded diplomacy module files, I'm running the compile.bat thing, but no files being created whatsoever. Any suggestions?

Here is the error.


Ads-z.png
 
HelrothHyrmir said:
Yeah, but how to modify the price of that mercenary unit?

troops dont have price. They have a hiring cost and a wage. Which one are you talking about?

see module_dialog.py

Code:
#Tavern Talk (with troops)

  [anyone, "start", [
and follow the code for the logic around mercenaries hiring cost.
 
Sweet Smile Of Pain said:
How can i enlarge army sizes in whole game? Like every noble army has 2500 to 5000 soldiers at least?

thats not a singular change. You will need to tweak the spawn of lords, the recruiting of new troops (both AI and player), mercenaries, how towns/castle garrison works, economy (if the player will be using that 2000 army), combat balance, battles (how to handle small battles if you have 10k soldiers waiting in line), prisoners, loot table after battles, food reserves for the player, etc. Also what happens with caravans, bandits and other parties (speed, quantity of troops, etc).

so in short: first you need to plan how much you gonna change to have a game that makes sense. Then worry about the how and where.
 
kalarhan said:
Sweet Smile Of Pain said:
How can i enlarge army sizes in whole game? Like every noble army has 2500 to 5000 soldiers at least?

thats not a singular change. You will need to tweak the spawn of lords, the recruiting of new troops (both AI and player), mercenaries, how towns/castle garrison works, economy (if the player will be using that 2000 army), combat balance, battles (how to handle small battles if you have 10k soldiers waiting in line), prisoners, loot table after battles, food reserves for the player, etc. Also what happens with caravans, bandits and other parties (speed, quantity of troops, etc).

so in short: first you need to plan how much you gonna change to have a game that makes sense. Then worry about the how and where.
And how can i tweak spawns, recruiting, merceranies, garrisons, economy, combat balance, battles, prisoners, caravans and bandits?
 
Sweet Smile Of Pain said:
kalarhan said:
Sweet Smile Of Pain said:
How can i enlarge army sizes in whole game? Like every noble army has 2500 to 5000 soldiers at least?

thats not a singular change. You will need to tweak the spawn of lords, the recruiting of new troops (both AI and player), mercenaries, how towns/castle garrison works, economy (if the player will be using that 2000 army), combat balance, battles (how to handle small battles if you have 10k soldiers waiting in line), prisoners, loot table after battles, food reserves for the player, etc. Also what happens with caravans, bandits and other parties (speed, quantity of troops, etc).

so in short: first you need to plan how much you gonna change to have a game that makes sense. Then worry about the how and where.
And how can i tweak spawns, recruiting, merceranies, garrisons, economy, combat balance, battles, prisoners, caravans and bandits?
For tweaking this thread here is your best friend:
https://forums.taleworlds.com/index.php/topic,46290.0.html
Other stuff can only be done with the module system iirc.
 
Ruan said:
I have downloaded diplomacy module files, I'm running the compile.bat thing, but no files being created whatsoever. Any suggestions?

Here is the error.


Ads-z.png
Forgot to post the line 392

Here is what it is:

Code:
	try:
		for entity_name, filename in export.iteritems():
			contents = getattr(WRECK, entity_name)
			if contents is None:
				#print 'Module %s has no changes, skipping export.' % entity_name
				continue
			#print 'Exporting module %s...' % entity_name
			filename = path_split(filename.replace('\\', '/'))
			folder = ('%s/%s' % (WRECK.destination, filename[0])) if filename[0] else WRECK.destination
			if filename[0] and not(path_exists(folder)): makedirs(folder)
			with open('%s/%s' % (folder, filename[1]), 'w+b') as f: f.write(contents)
	except Exception, e:
		print '{1}FAILED.\nCOMPILER INTERNAL ERROR WHILE WRECKING {module!s}:\n{error!s}{0}'.format(*COLORAMA, module = entity_name, error = formatted_exception())
		WRECK.time_export = gettime()
		raise MSException()

What is wrong in here? The compile bat says something wrong is in compile.py in line 392 but I can't figure out.

In picture it says I don't have tablaeu_materials.txt but I already have it. What might be wrong? Please help.
 
KratosMKII said:
dariel said:
Hi all! I'm getting a weird bug in my mod, lords that have defected are getting their names changed to "Greetings my lord, you may have heard of my ill treatment etc etc". What could be causing this? Could anyone point me to the module system files entry I should fix? Thanks!
Search for "Auto-indictment or defection" in module_simple_triggers.py

Thanks! I'm trying to trace  back what could have gone wrong, since I've not altered this trigger at all. Does the bug have to do with faction titles?
 
I'm trying to randomize a lord's face every time they are created. So far i got:
Code:
   (eq, ":cur_lord_culture", fac_culture_mongol), 
   (call_script, "script_rand", "str_ee_face_key_asian_1", "str_ee_face_key_end"),   ### asian
   (str_store_string, s45, reg0),  
   
   (troop_set_slot, ":cur_lord", slot_troop_face_key, reg0),  
   (troop_set_face_keys, ":cur_lord", s45, 0),  
   (troop_set_face_keys, ":cur_lord", s45, 1), 

Code:
   ("ee_face_key_asian_1", "0x0000000e74000a44b50d46327b08cb85600000000001fa0f50000000000000000"),
   ("ee_face_key_asian_2", "0x0000000447000b28550d46327b08cb85600000000001fa0f50000000000000000"),
   ("ee_face_key_asian_3", "0x00000005f4000b50150d46327b08cb85600000000001fa0f50000000000000000"),
   ("ee_face_key_asian_4", "0x0000000133000a40050d46327b08cb85600000000001fa0f50000000000000000"),
   ("ee_face_key_asian_5", "0x00000009a6000914e50d46327b08cb85600000000001fa0f50000000000000000"),
   ("ee_face_key_asian_6", "0x000000057b000928a50d46327b08cb85600000000001fa0f50000000000000000"),
   ("ee_face_key_asian_7", "0x0000000d94000b38750d46327b08cb85600000000001fa0f50000000000000000"),
   ("ee_face_key_asian_8", "0x0000000227000b38b50d46327b08cb85600000000001fa0f50000000000000000"),
   ("ee_face_key_asian_end", "0x0000000e22000928250d46327b08cb85600000000001fa0f50000000000000000"),
But every time they spawn they have the same bald wrinkled face. Why is this happening?
 
dariel said:
Does the bug have to do with faction titles?

check where you are using the "troop_set_name" operation

Code:
troop_set_name                           = 1501  # (troop_set_name, <troop_id>, <string_no>),
                                                 # Renames the troop, setting a new singular name for it.
troop_set_plural_name                    = 1502  # (troop_set_plural_name, <troop_id>, <string_no>),
                                                 # Renames the troop, setting a new plural name for it.
 
[Bcw]Btm_Earendil said:
Sweet Smile Of Pain said:
kalarhan said:
Sweet Smile Of Pain said:
How can i enlarge army sizes in whole game? Like every noble army has 2500 to 5000 soldiers at least?

thats not a singular change. You will need to tweak the spawn of lords, the recruiting of new troops (both AI and player), mercenaries, how towns/castle garrison works, economy (if the player will be using that 2000 army), combat balance, battles (how to handle small battles if you have 10k soldiers waiting in line), prisoners, loot table after battles, food reserves for the player, etc. Also what happens with caravans, bandits and other parties (speed, quantity of troops, etc).

so in short: first you need to plan how much you gonna change to have a game that makes sense. Then worry about the how and where.
And how can i tweak spawns, recruiting, merceranies, garrisons, economy, combat balance, battles, prisoners, caravans and bandits?
For tweaking this thread here is your best friend:
https://forums.taleworlds.com/index.php/topic,46290.0.html
Other stuff can only be done with the module system iirc.
Thanks dude you are great!
 
Is it possible to mass edit items?

I want to increase prices for all armors in a mod, and I could do that by editing about 2000 items in morghs editor... but is there a way to let python increase the prices of a few flags by a given percentage?

I have found this thread:
https://forums.taleworlds.com/index.php?topic=134847.0

but that did not help me at all.

I know my text editing, but I am completely new to python.
I mean, I got it installed and working, but that's about it. I found nothing like this in the forums.

Thank you in advance!
 
Hiking-Viking said:
Is it possible to mass edit items?

I want to increase prices for all armors in a mod, and I could do that by editing about 2000 items in morghs editor... but is there a way to let python increase the prices of a few flags by a given percentage?

I have found this thread:
https://forums.taleworlds.com/index.php?topic=134847.0

but that did not help me at all.

I know my text editing, but I am completely new to python.
I mean, I got it installed and working, but that's about it. I found nothing like this in the forums.

Thank you in advance!
The thread which you have found is showing a solution for which you need the module system. If you want to stay with Morgh, I don't see another way than to do it manually (there might exist one though).
 
[Bcw]Btm_Earendil said:
Hiking-Viking said:
Is it possible to mass edit items?

I want to increase prices for all armors in a mod, and I could do that by editing about 2000 items in morghs editor... but is there a way to let python increase the prices of a few flags by a given percentage?

I have found this thread:
https://forums.taleworlds.com/index.php?topic=134847.0

but that did not help me at all.

I know my text editing, but I am completely new to python.
I mean, I got it installed and working, but that's about it. I found nothing like this in the forums.

Thank you in advance!
The thread which you have found is showing a solution for which you need the module system. If you want to stay with Morgh, I don't see another way than to do it manually (there might exist one though).

I'd like to use that solution, I just don't understand it ^^
Can you guide me?

Python and the module system are ready.

Where do I put the code he listed?
Somebody said:
For single player -
Code:
  ("game_get_item_buy_price_factor",
    [
      (store_script_param_1, ":item_kind_id"),
      (assign, ":price_factor", 100),
Parse the item via item_get_type - if armor, set it to 60, if arms, set to 50 or something. Also, don't forget to change game_get_item_sell_price_factor - otherwise you can rip of merchants easily.
 
Hiking-Viking said:
Python and the module system are ready.

Where do I put the code he listed?

what you are talking here is about coding, so you will need to check the tutorial on that and learn the basics. It is not like change a few numbers on the .txt files.

:arrow: https://forums.taleworlds.com/index.php/board,171.0.html

you can also do a manual change on module_items.py, which lists the items in the game. No coding here, just change the prices (numbers) for each item...

that snippet you showed above goes on module_scripts.py.

also keep in mind that coding your mod with modsys uses MBScript (Mount Blade Scripting Language), and not Python. Important to know this before you try to google how to do stuff. Python is everywhere (its a top programming language in the world), MBScript is only for this game and basically this community/forum.
 
Status
Not open for further replies.
Back
Top Bottom