Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
TheVideoGameInn said:
The_dragon said:
@TheVideoGameInn strange... I can't reproduce that error...
1. make sure that there is an item in module_items with id 'siege_supply'
2. if there is, then open generate_ids0.py with notepad and add there two lines at the bottom of the file
Code:
with open("ID_items.py", "a") as myfile:
  myfile.write("itm_siege_supply = 0\nitm_spice = 0")
Then delete all ID_* files. Then run generate_ids0.bat. Then run generate_ids1.bat. Then you should be able to compile(compile twice).


factions
info_pages
animations
quests
sounds
meshes
music
skills
strings
items
Traceback (most recent call last):
  File "generate_ids0.py", line 70, in <module>
    gen_ids(items, "items", "itm")
  File "generate_ids0.py", line 22, in gen_ids
    file.write("%s_%s = 0\n"%(tag, convert_to_identifier(obj_vec[0])))
  File "generate_ids0.py", line 6, in convert_to_identifier
    s1 = string.replace(s0," ","_")
  File "C:\Python27\lib\string.py", line 519, in replace
    return s.replace(old, new, maxreplace)
AttributeError: 'list' object has no attribute 'replace'
Done!


The rest fails as before.


as said before: your file is corrupted (you have a syntax error somewhere).
If you still can't see your mistake:
1) Make a backup of module_items.py
2) Remove all items from it
3) Run "python process_items.py
4) Add items back into your file in blocks and see where it fails (breaks). Then find the line that causes the issue and fix it
 
What causes Warband to crash at "loading map file"? I tested my modified map.txt on the native module and it works fine, so that isn't the problem.
No parties are off of the map, and there are less forest tiles than in Native.


Badly formatted faction colors was the problem- now fixed.
 
I added this a mission
(ti_on_leave_area, 0, 0,
      [
        (try_begin),
          (eq, "$g_defending_against_siege", 0),
          (assign,"$g_leave_town",1),
(party_relocate_near_party, "p_main_party", "p_town_19"),(change_screen_return),
        (try_end),
        ], []),
but when I leave a scene, it jump to previous menu.
 
This: (change_screen_return),

causes you to return to the previous screen.

Try this instead: (change_screen_map),


Bumping this:
Cozur said:
Been trying to add lords who, when the game starts, are captured by other lords.

I've added this to a random dialogue, just to test:

Code:
(assign, "$g_wyman_manderly_troop", "trp_knight_2_24"),
(troop_set_slot, "$g_wyman_manderly_troop", slot_troop_prisoner_of_party, "$g_renfred_rykker_lord"),
(party_force_add_prisoners, "$g_renfred_rykker_lord", "$g_wyman_manderly_troop", 1),]],

The parties are properly defined, but the trp_knight_2_24 is duplicated, with one holding a center, and another having been captured by the assigned party.

My question is: Is there an operation that defines a troop, and prevents this duplication issue?

Basically looking for any way to add lords who are captured at the start of the game.
 
Thorgrim's Map Editor allows you to edit the map texture.
http://forums.taleworlds.com/index.php?topic=5646.0

Just hop into Terrain Mode. You can select different terrains by using the numbers 1-9.
Overwrite a current terrain texture with a new asphalt one.
 
Is it possible to dynamically assign prefixes to the same troop-type?

For example, I have this base troop: "swadian_peasant"
But I want to change the name to something like this: "village_levy_swadian_peasant" and "town_militia_swadian_peasant"

I want to keep the "base" troop the same, just have different in-game names for them depending on the recruitment origin.

I do suppose I could duplicate all the troop types, but that seems inefficient and cumbersome to my programming brain.

Thanks!
 
You'd have to duplicate all the troop types.
There's only (troop_set_name, <troop_id>, <string_no>), to work with, which could be fine if you want the player to have ONLY Town Militia or ONLY Village levies, but you probably want the player to be able to have a mix of both. In which case you need separate (duplicate) troops.
 
Arch3r said:
You'd have to duplicate all the troop types.
There's only (troop_set_name, <troop_id>, <string_no>), to work with, which could be fine if you want the player to have ONLY Town Militia or ONLY Village levies, but you probably want the player to be able to have a mix of both. In which case you need separate (duplicate) troops.

Spot on, I do want the player (and AI lords too later) to be able to have both types.

Thanks for the help!

EDIT: Follow-up question, can I spawn dynamically sized (troop composition) parties? Or do I need to spawn a base party and then modify the size (troop composition) after spawning?
 
This may be a simple thing to do, but I'm working on trying to add/change a section of text in the Game Concepts area. The idea I have is to add a storyline and some explanation as to why events in the mod's time period have occured, etc.

I have a feeling it's simple already, but I came here because I remembered that there were buttons and margins associated with the text (after looking at the module system, I found some slashes that I presume were to stop the text from running off the borders). Is it a simple matter of duplicating an existing dialog from that page and editing it, or do I need to do something more in other files?
 
Druidic said:
This may be a simple thing to do, but I'm working on trying to add/change a section of text in the Game Concepts area. The idea I have is to add a storyline and some explanation as to why events in the mod's time period have occured, etc.

I have a feeling it's simple already, but I came here because I remembered that there were buttons and margins associated with the text (after looking at the module system, I found some slashes that I presume were to stop the text from running off the borders). Is it a simple matter of duplicating an existing dialog from that page and editing it, or do I need to do something more in other files?

if you mean this
Code:
  ("retirement_text_4", "The silver you've saved doesn't last long,\
 but you manage to put together enough to buy some land near the village of {s7}.\
 There you become a free farmer, and you soon begin to attract potential {wives/husbands}.\
that is just a Python trick to break the text into multiple lines (easier for us humans to read it). You can't add any extra spaces on the start of lines tho, or it will give a syntax error.

To break the line ingame you can use a ^

Code:
TaleWorlds.com Forum Administrators and Moderators:^\
Janus^\
Archonsod^\
Narcissus^\
Nairagorn^\
Lost Lamb^\
Deus Ex^\
Merentha^\
Volkier^\
Instag0^\
Ativan^\
ego^\
Guspav^\


anyway you should check module_info_pages.py
 
Hello guys,
I added this code end of a dialog and working but When I added a menu doesn't work why?
(mission_disable_talk),
("enter",[],"Enter.",[(mission_disable_talk),(set_jump_mission,"mt_town_center"),(jump_to_scene,"scn_village_3"),
  (modify_visitors_at_site,"scn_village_3"),
(reset_visitors),
(set_visitors,49,"trp_dead1",6),
(set_visitors,50,"trp_dead2",6),
(set_visitors,51,"trp_dead2",6),

(change_screen_mission),]),
 
kalarhan said:
To break the line ingame you can use a ^

True, but in Notepad it's not even showing any dashes now. Figures.

Anyways, how will I know if it exceeds the page? Repeated testing?
 
Druidic said:
kalarhan said:
To break the line ingame you can use a ^

True, but in Notepad it's not even showing any dashes now. Figures.

Anyways, how will I know if it exceeds the page? Repeated testing?

for some texts it won't matter (like concept pages), some like dialogs you will need to test it hehe. Or just create a reference string for the max size it looks good on the screen, and use it as a rule.
Remember you can use Window Mode + restore module data to quickly change the game, no need to restart it!
And use the ^ to create proper paragraphs so us poor humans can read it (wall of text is bad!)
 
Status
Not open for further replies.
Back
Top Bottom