Changes via Modding System simply not showing up!

正在查看此主题的用户

TraDukTer

Recruit
Hi all! I hate to be that guy, but I tried to search for this and didn't come up with anything halfway decent. I'm sure this is some elementary noob mistake and I'm sorry in advance.

So, I referred to the official documentation and poked around items.py. I rearranged all the stuff after the warning that says not to do so, and changed the properties of the flintlock pistol. I got some errors, because I'd accidentally removed both of the Sarranid two-handed axes. I got rid of the references to them (one was in troops, the other in scripts), and got no errors.

Then I went ingame, loads up fine and all, but when I access the cheatmenu to find my item, it's not there. Also, all the items are in the vanilla order, not just the ones that I wasn't supposed to touch according to the .py file comment.

I'm certain the Module System target file in info.py is the correct one. And I reiterate, the system gives no errors. But still, NOTHING happens to items_types.txt. What gives?

Here's the end of my items.py if someone has a theory they want to check out. If we ever get it to actually work, it's up for grabs for anyone who wants an ordered vanilla items.py (with the sarranid two-h axes missing and an Obrez with the flintlock pistol mesh for a flintlock pistol).

插入代码块:
# Crossbows

["hunting_crossbow", "Hunting Crossbow", [("crossbow_a",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 
22 , weight(2.25)|difficulty(0)|spd_rtng(47) | shoot_speed(50) | thrust_damage(37 ,  pierce)|max_ammo(1),imodbits_crossbow ],
["light_crossbow", "Light Crossbow", [("crossbow_b",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 
67 , weight(2.5)|difficulty(8)|spd_rtng(45) | shoot_speed(59) | thrust_damage(44 ,  pierce)|max_ammo(1),imodbits_crossbow ],
["crossbow",         "Crossbow",         [("crossbow_a",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_reload_on_horseback ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 
182 , weight(3)|difficulty(8)|spd_rtng(43) | shoot_speed(66) | thrust_damage(49,pierce)|max_ammo(1),imodbits_crossbow ],
["heavy_crossbow", "Heavy Crossbow", [("crossbow_c",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_reload_on_horseback ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 
349 , weight(3.5)|difficulty(9)|spd_rtng(41) | shoot_speed(68) | thrust_damage(58 ,pierce)|max_ammo(1),imodbits_crossbow ],
["sniper_crossbow", "Siege Crossbow", [("crossbow_c",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_reload_on_horseback ,itcf_shoot_crossbow|itcf_carry_crossbow_back, 
683 , weight(3.75)|difficulty(10)|spd_rtng(37) | shoot_speed(70) | thrust_damage(63 ,pierce)|max_ammo(1),imodbits_crossbow ],

# Pistols

["Obrez", "Obrez", [("flintlock_pistol",0)], itp_type_pistol |itp_merchandise|itp_primary|itp_next_item_as_melee ,itcf_shoot_pistol|itcf_reload_pistol, 230 , weight(2)|difficulty(7)|spd_rtng(65) | shoot_speed(160) | thrust_damage(45 ,pierce)|max_ammo(1)|accuracy(65),imodbits_none,
 [(ti_on_weapon_attack, [(play_sound,"snd_pistol_shot"),(position_move_x, pos1,27),(position_move_y, pos1,36),(particle_system_burst, "psys_pistol_smoke", pos1, 15)])]],
["Obrez melee", "Obrez", [("flintlock_pistol",0)], itp_type_one_handed_wpn|itp_can_knock_down, itc_scimitar, 350, weight(2)|difficulty(7)|spd_rtng(80) | swing_damage(20,blunt)|weapon_length(62),imodbits_none ],

# Rifles

########
# AMMO #
########

 ["arrows","Arrows", [("arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver", ixmesh_carry)], itp_type_arrows|itp_merchandise|itp_default_ammo, itcf_carry_quiver_back, 72,weight(3)|abundance(160)|weapon_length(95)|thrust_damage(1,pierce)|max_ammo(30),imodbits_missile],
 ["khergit_arrows","Khergit Arrows", [("arrow_b",0),("flying_missile",ixmesh_flying_ammo),("quiver_b", ixmesh_carry)], itp_type_arrows|itp_merchandise, itcf_carry_quiver_back_right, 410,weight(3.5)|abundance(30)|weapon_length(95)|thrust_damage(3,pierce)|max_ammo(30),imodbits_missile],
 ["barbed_arrows","Barbed Arrows", [("barbed_arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver_d", ixmesh_carry)], itp_type_arrows|itp_merchandise, itcf_carry_quiver_back_right, 124,weight(3)|abundance(70)|weapon_length(95)|thrust_damage(2,pierce)|max_ammo(30),imodbits_missile],
 ["bodkin_arrows","Bodkin Arrows", [("piercing_arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver_c", ixmesh_carry)], itp_type_arrows|itp_merchandise, itcf_carry_quiver_back_right, 350,weight(3)|abundance(50)|weapon_length(91)|thrust_damage(3,pierce)|max_ammo(28),imodbits_missile],
 ["bolts","Bolts", [("bolt",0),("flying_missile",ixmesh_flying_ammo),("bolt_bag", ixmesh_carry),("bolt_bag_b", ixmesh_carry|imodbit_large_bag)], itp_type_bolts|itp_merchandise|itp_default_ammo|itp_can_penetrate_shield, itcf_carry_quiver_right_vertical, 64,weight(2.25)|abundance(90)|weapon_length(63)|thrust_damage(1,pierce)|max_ammo(29),imodbits_missile],
 ["steel_bolts","Steel Bolts", [("bolt",0),("flying_missile",ixmesh_flying_ammo),("bolt_bag_c", ixmesh_carry)], itp_type_bolts|itp_merchandise|itp_can_penetrate_shield, itcf_carry_quiver_right_vertical, 210,weight(2.5)|abundance(20)|weapon_length(63)|thrust_damage(2,pierce)|max_ammo(29),imodbits_missile],

 ["cartridges","Cartridges", [("cartridge_a",0)], itp_type_bullets|itp_merchandise|itp_can_penetrate_shield|itp_default_ammo, 0, 41,weight(2.25)|abundance(90)|weapon_length(3)|thrust_damage(1,pierce)|max_ammo(50),imodbits_missile],

#non-hardcoded practice
 ["practice_arrows_2","Practice Arrows", [("arena_arrow",0),("flying_missile",ixmesh_flying_ammo),("quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 0,weight(1.5)|weapon_length(95)|max_ammo(80),imodbits_missile],
 

################
# Prop weapons #
################

["torch",         "Torch", [("club",0)], itp_type_one_handed_wpn|itp_primary, itc_scimitar, 11 , weight(2.5)|difficulty(0)|spd_rtng(95) | weapon_length(95)|swing_damage(11 , blunt) | thrust_damage(0 ,  pierce),imodbits_none,
 [(ti_on_init_item, [(set_position_delta,0,60,0),(particle_system_add_new, "psys_torch_fire"),(particle_system_add_new, "psys_torch_smoke"),(set_current_color,150, 130, 70),(add_point_light, 10, 30),
])]],
["lyre",         "Lyre", [("lyre",0)], itp_type_shield|itp_wooden_parry|itp_civilian, itcf_carry_bow_back,  118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),0 ],
["lute",         "Lute", [("lute",0)], itp_type_shield|itp_wooden_parry|itp_civilian, itcf_carry_bow_back,  118 , weight(2.5)|hit_points(480)|body_armor(1)|spd_rtng(82)|weapon_length(90),0 ],

["keys", "Ring of Keys", [("throwing_axe_a",0)], itp_type_one_handed_wpn |itp_primary|itp_bonus_against_shield,itc_scimitar,
240, weight(5)|spd_rtng(98) | swing_damage(29,cut)|max_ammo(5)|weapon_length(53),imodbits_thrown ], 

#######################
#                     #
#     END OF ITEMS    #
#                     #
#######################

["items_end", "Items End", [("shield_round_a",0)], 0, 0, 1, 0, 0],

["Obrez", "Obrez", [("flintlock_pistol",0)], itp_type_pistol |itp_merchandise|itp_primary|itp_next_item_as_melee ,itcf_shoot_pistol|itcf_reload_pistol, 230 , weight(2)|difficulty(7)|spd_rtng(65) | shoot_speed(160) | thrust_damage(45 ,pierce)|max_ammo(1)|accuracy(65),imodbits_none,
 [(ti_on_weapon_attack, [(play_sound,"snd_pistol_shot"),(position_move_x, pos1,27),(position_move_y, pos1,36),(particle_system_burst, "psys_pistol_smoke", pos1, 15)])]],
["Obrez melee", "Obrez", [("flintlock_pistol",0)], itp_type_one_handed_wpn|itp_can_knock_down, itc_scimitar, 350, weight(2)|difficulty(7)|spd_rtng(80) | swing_damage(20,blunt)|weapon_length(62),imodbits_none ],

 
]

Also, if anyone would like to clear some things up for me, that'd be super. For one, where does the modding system get the initial files? Even if I change the target directory, the .py files (or at least items.py) don't update to what they currently are in the mod. I don't know if they should, since there's no overt mention of how that's supposed to work in the documentation, but how else are you supposed to be able to work on several mods? You can't be expected to hand-craft the .py from the .txt?

Also, I'd like to know how to access the 100% vanilla items.py, scripts.py and troops.py to fix that Sarra axe cock-up I mentioned up there. Hopefully this mod will be more of a total conversion in time, but for the time being, I want to test the balance and stuff out on top of Vanilla.
 
You should post your module_info.py - if you compile successfully but the changes cannot be seen in the game, most likely the path is not correct (even if you think it is).

Cheat menu shows all items up to "items_end", any items after "items_end" item will not be shown.

You can download the pristine module system from www.taleworlds.com

And module system does not initialize it's contents from anywhere - it is the source of a module.
 
Lav 说:
You should post your module_info.py - if you compile successfully but the changes cannot be seen in the game, most likely the path is not correct (even if you think it is).

Cheat menu shows all items up to "items_end", any items after "items_end" item will not be shown.

You can download the pristine module system from www.taleworlds.com

And module system does not initialize it's contents from anywhere - it is the source of a module.

Thank you so much for the speedy reply. I've seen you around other posts too, you seem to be one of the few very active people around this board.

What's your educated guess on whether or not I screwed everything up by putting all the vanilla items (after the warning about not to change the order of hardcoded items) in a human-readable order? Is there some word-of-mouth tradition on where you're actually allowed to make changes?

I also know items after the items_end won't be shown, I just tried it as a last ditch trying to maybe emulate something someone on some suspicious thread said worked for them via items_types1.txt.

Here's my info.py

插入代码块:
# Point export_dir to the folder you will be keeping your module
# Make sure you use forward slashes (/) and NOT backward slashes (\)

#export_dir = "C:/Program Files/Mount&Blade/Modules/Native/"
export_dir = "D:/Games/Steam/steamapps/common/mountblade warband/Modules/Planet Oz"

please don't tell me that steam is the trouble...

Also thanks for clearing up that part about the module system (not) initializing. How do people generally go about this in practice? Keep a "proof copy" of all their mods and native in separate files?
 
export_dir = "D:/Games/Steam/steamapps/common/mountblade warband/Modules/Planet Oz

^This.

Change it to

export_dir = "D:/Games/Steam/steamapps/common/mountblade warband/Modules/Planet Oz/

You need that last slash at the end, or it will just compile all the files in your modules folder, and not your actual module. Now go out there and mod :grin:!
 
Kelthin 说:
export_dir = "D:/Games/Steam/steamapps/common/mountblade warband/Modules/Planet Oz

^This.

Change it to

export_dir = "D:/Games/Steam/steamapps/common/mountblade warband/Modules/Planet Oz/

You need that last slash at the end, or it will just compile all the files in your modules folder, and not your actual module. Now go out there and mod :grin:!

I'm not sure if I cried a bit or laughed when I read that, but it was pretty loud. Thanks! I KNEW it was a stupid noob mistake. Thank you so much, really!

To anyone who may be able to answer, I gather it's commonplace and OK to contact more experienced modders directly via PM so they might "mentor" you. How would I go about this?

Finally, and completely off-topic: how exactly iffy, do you think, would the modding community be if I, theoretically, got a mod to a rather advanced stage with all-placeholder resources? I have a concept-level idea for a science fiction-themed mod, but ZERO modeling and texturing skills. Do you think it would just look like "please make my mod for me", or could a good enough core gameplay-wise really get some talent interested?

EDIT: Just for anyone wondering, it worked. Of course it did. But it worked. Thanks both of you, once again! Now I've apparently botched something with the flags for my obrez, but that I can work out myself by cross-referencing to thrown weapons.
 
You can PM quite anyone on this forum, they might not get to you instantly but they most likely will respond and help. Placeholders would only work for a little bit, once you start on the mod and have enough for previews, you can make a post on the 3D art board, and then if someone is interested, theres your member!

You can PM me whenever, i check this forum quite a bit, and can usually answer you, and if i can't ill talk to some one better than me who can :wink:
 
TraDukTer 说:
What's your educated guess on whether or not I screwed everything up by putting all the vanilla items (after the warning about not to change the order of hardcoded items) in a human-readable order? Is there some word-of-mouth tradition on where you're actually allowed to make changes?
It is an extremely common trick in Warband scripting to work with entity ranges which can be easily iterated by (try_for_range) operation. For example, it is a requirement that all recruitable NPCs are listed in module_troops.py as a single block, you cannot add a new NPC anywhere else without making numerous scripting modifications in many different places of the module.

Most of these ranges are defined as constants in module_constants.py, like:

插入代码块:
trade_goods_begin = "itm_spice"
trade_goods_end = "itm_siege_supply"
food_begin = "itm_smoked_fish"
food_end = "itm_siege_supply"
reference_books_begin = "itm_book_wound_treatment_reference"
reference_books_end   = trade_goods_begin
readable_books_begin = "itm_book_tactics"
readable_books_end   = reference_books_begin
books_begin = readable_books_begin
books_end = reference_books_end
horses_begin = "itm_sumpter_horse"
horses_end = "itm_arrows"
weapons_begin = "itm_wooden_stick"
weapons_end = "itm_wooden_shield"
ranged_weapons_begin = "itm_darts"
ranged_weapons_end = "itm_torch"
armors_begin = "itm_leather_gloves"
armors_end = "itm_wooden_stick"
shields_begin = "itm_wooden_shield"
shields_end = ranged_weapons_begin

So generally you want to avoid re-ordering of anything unless you're pretty certain that it won't affect the module code, which requires either a thorough knowledge of the Module System or a very careful research to make sure your actions do not break the execution of some obscure script.
 
Most modders prefer to add their code to the top of the .py files, so that it wont mess up any constants or other ranges.

I personally put all custom items above

插入代码块:
"#NORMAL ITEMS
["tutorial_spear", "Spear", [("spear",0)], itp_type_polearm| itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_spear, 0 , weight(4.5)|difficulty(0)|spd_rtng(80) | weapon_length(158)|swing_damage(0 , cut) | thrust_damage(19 ,  pierce),imodbits_polearm ],
["tutorial_club", "Club", [("club",0)], itp_type_one_handed_wpn| itp_primary|itp_wooden_parry|itp_wooden_attack, itc_scimitar, 0 , weight(2.5)|difficulty(0)|spd_rtng(95) | weapon_length(95)|swing_damage(11 , blunt) | thrust_damage(0 ,  pierce),imodbits_none ],
["tutorial_battle_axe", "Battle Axe", [("battle_ax",0)], itp_type_two_handed_wpn| itp_two_handed|itp_primary|itp_bonus_against_shield|itp_wooden_parry, itc_nodachi|itcf_carry_axe_back, 0 , weight(5)|difficulty(0)|spd_rtng(88) | weapon_length(108)|swing_damage(27 , cut) | thrust_damage(0 ,  pierce),imodbits_axe ],"

so that its not in any ranges.
 
Kelthin 说:
You can PM quite anyone on this forum, they might not get to you instantly but they most likely will respond and help. Placeholders would only work for a little bit, once you start on the mod and have enough for previews, you can make a post on the 3D art board, and then if someone is interested, theres your member!

You can PM me whenever, i check this forum quite a bit, and can usually answer you, and if i can't ill talk to some one better than me who can :wink:

Thanks! Will do! I promise I won't harass you too much.

Lav 说:
TraDukTer 说:
What's your educated guess on whether or not I screwed everything up by putting all the vanilla items (after the warning about not to change the order of hardcoded items) in a human-readable order? Is there some word-of-mouth tradition on where you're actually allowed to make changes?
It is an extremely common trick in Warband scripting to work with entity ranges which can be easily iterated by (try_for_range) operation. For example, it is a requirement that all recruitable NPCs are listed in module_troops.py as a single block, you cannot add a new NPC anywhere else without making numerous scripting modifications in many different places of the module.

Most of these ranges are defined as constants in module_constants.py, like:

插入代码块:
trade_goods_begin = "itm_spice"
trade_goods_end = "itm_siege_supply"
food_begin = "itm_smoked_fish"
food_end = "itm_siege_supply"
reference_books_begin = "itm_book_wound_treatment_reference"
reference_books_end   = trade_goods_begin
readable_books_begin = "itm_book_tactics"
readable_books_end   = reference_books_begin
books_begin = readable_books_begin
books_end = reference_books_end
horses_begin = "itm_sumpter_horse"
horses_end = "itm_arrows"
weapons_begin = "itm_wooden_stick"
weapons_end = "itm_wooden_shield"
ranged_weapons_begin = "itm_darts"
ranged_weapons_end = "itm_torch"
armors_begin = "itm_leather_gloves"
armors_end = "itm_wooden_stick"
shields_begin = "itm_wooden_shield"
shields_end = ranged_weapons_begin

So generally you want to avoid re-ordering of anything unless you're pretty certain that it won't affect the module code, which requires either a thorough knowledge of the Module System or a very careful research to make sure your actions do not break the execution of some obscure script.

OK! I might or might not be screwed then. If anything, I put them in more comprehensive blocks (as it is, vanilla seems to have everything new, weapons, armors and all, at the bottom of items.py. I put all the armors together grouped by bodypart and all the weapons grouped by ranged/melee, damage type and so on)... I'll probably have to mess around with those some time anyways, so it shouldn't be too catastrophic. Although it did already turn an armor worn by a testing character in a pre-existing savegame into a dress.

Now I'm having trouble finding where proficiencies simply are in the modding system. I read somewhere I have to enable firearms, but I can't find where. At least I hope that's why the difficulty value I put on the Obrez is shown as "requires # one-handed" in-game.
 
Agh. Of course it can't be this easy. Now the skill that my Obrez requires to wield is "One-handed" and not Strength as any reasonable human being would expect. I can't even find a skill called One-handed anywhere, so I can't test the weapon out, without removing its difficulty. Is this something you can get at without ruining your life? I'd really want to keep crossbows and guns separate, as well as bows and crossbows.

In the meantime, I'll suck it up and remove the difficulty, moving on to similarly mock-up other weapons.

Thanks for the help so far, guys!
 
Crossbows use Strength as difficulty, whereas firearms are broken if you add difficulty to it. The firearm proficiencies are enabled by setting a flag in module.ini.
 
Somebody 说:
Crossbows use Strength as difficulty, whereas firearms are broken if you add difficulty to it. The firearm proficiencies are enabled by setting a flag in module.ini.

So it seems. Very unfortunate, this, as I was seriously planning on keeping crossbows and guns separate in terms of ammo and everything. Crap. Is there any, even a roundabout and difficult, way to circumvent this?

Edit: Oh and thanks for the info on enabling firearms! Kelthin already told me via PM and I forgot to update here, but thanks anyways. Slightly confusing that it's not done via the modding system at all.
 
Do a "softcoded" difficulty as a tooltip in script_game_get_extra_text for your specified firearms. Check occasionally when the player accesses the inventory (usually before a mission). Look up "race restriction", there's a ton of posts about modifying the player's inventory.
 
Somebody 说:
Do a "softcoded" difficulty as a tooltip in script_game_get_extra_text for your specified firearms. Check occasionally when the player accesses the inventory (usually before a mission). Look up "race restriction", there's a ton of posts about modifying the player's inventory.

That sounds like the kind of thing I'm looking for. I'll do some searching. Is it OK to PM you about this?

Edit: All I find on this board with a search on "race restriction" is a post from 2006 saying there's no way to restrict it (although that was talking about restricting a new race from wearing an armor). I do know it's possible (at least 1866 did it with stockpiling and ammo pouch sizes, even though it was in M&B and not Warband), but I can't find any info... I'll keep searching
 
后退
顶部 底部