Item Issues

正在查看此主题的用户

bgfan

Grandmaster Knight
Well, I used to do this a lot, because I'm too lazy to actually go looking around shops for stuff, but I seem to have forgotten how to equip an item to the player at the beggining of the game. I could certainly remember it, if I could find the file and block of code, however, it seems to be nearly impossible to detect among the vast legion of code in the module system. ANy help would certainly be appreciated.
 
[quote author=1.125 Module System, module_game_menus.py]      ("begin_adventuring",[],"Become an adventurer and ride to your destiny.",[
          (set_show_messages, 0),
          (try_begin),
            (eq,"$character_gender",0),
            (troop_raise_attribute, "trp_player",ca_strength,1),
            (troop_raise_attribute, "trp_player",ca_charisma,1),
          (else_try),
            (troop_raise_attribute, "trp_player",ca_agility,1),
            (troop_raise_attribute, "trp_player",ca_intelligence,1),
          (try_end),

          (troop_raise_attribute, "trp_player",ca_strength,1),
          (troop_raise_attribute, "trp_player",ca_agility,1),
          (troop_raise_attribute, "trp_player",ca_charisma,1),
         
          (troop_raise_skill, "trp_player","skl_leadership",1),
          (troop_raise_skill, "trp_player","skl_riding",1), 

          (troop_add_item, "trp_player","itm_[item ID in module_items.py]",0),
          (Add this command separately for each item you want)
[/quote]
 
Thanks however, now i'm failing with code, I did that however, my armour isn't appearing, i believe it's a code error with the armour. Here's the code:

["Templar_Surcoat", "Templar Surcoat", [("Templar_Surcoat",0)], itp_merchandise| itp_type_body_armor| itp_covers_legs ,0,
1544 , weight(1:cool:|abundance(1000)|head_armor(0)|body_armor(4:cool:|leg_armor(1:cool:|difficulty(7) ,imodbits_armor ],

it didn't work before I messed with the abundance, so I doubt that's the problem.
 
["Templar_Surcoat", "Templar Surcoat", [("Templar_Surcoat",0)], itp_merchandise| itp_type_body_armor  |itp_covers_legs ,0,
1544 , weight(1:cool:|abundance(1000)|head_armor(0)|body_armor(4:cool:|leg_armor(1:cool:|difficulty(7) ,imodbits_armor ],
EDIT: I think the place of the vertical line between "itp_type_body_armor" and "itp_covers_legs" was supposed to be like this.
 
The position of the bolded |?
Anyways, your abundance rating should be a max of 255.
Make sure your item is in lowercase (M&B doesn't like uppercase, but numbers are fine) - and make sure your mesh is actually in uppercase.
Compare it to the spelling you used in troop_add_item.
 
It also seems I have a problem with ym mesh not being able to locate my material, so I have to include the material in the mesh file, any idea what the issue here is? I'm using OpenBRF

Module.ini in case it's needed/helpful

module_name = Crimson Cross Mod
compatible_with_warband = 1

num_hints = 12

auto_create_note_indices = 0 #Do not automatically search through all troops/factions/towns to check if they have note text.

map_min_x  = -180
map_max_x  =  180
map_min_y  = -145
map_max_y  =  145
map_sea_direction = -40 #wave foam direction
map_sea_wave_rotation = 300 #This is where the tear artefact is visible on the sea.
map_sea_speed_x = 0.02
map_sea_speed_y = -0.02
map_river_direction = 140
map_river_speed_x = 0.01
map_river_speed_y = -0.01


air_friction_arrow = 0.002
air_friction_bullet = 0.002

# use meshes map_tree_a through map_tree_r on for map trees
map_tree_types = 17
map_snow_tree_types  = 3
map_steppe_tree_types = 5
map_desert_tree_types  = 4


time_multiplier = 0.25
seeing_range    = 6.5
track_spotting_multiplier = 0.8

# heroes with health below this will not appear in battles and will not contribute to party skills.
player_wounded_treshold = 5
hero_wounded_treshold = 15

skill_prisoner_management_bonus = 5
skill_leadership_bonus = 3
base_companion_limit = 20

player_xp_multiplier  = 2.0;
hero_xp_multiplier    = 2.0;
regulars_xp_multiplier = 3.0;


display_wp_firearms = 0

# damage below this will not interrupt melee attacks
damage_interrupt_attack_threshold      = 3.0
# Same thing for multiplayer
damage_interrupt_attack_threshold_mp  = 1.0

# You can modify the damage system by editing the following values:
# The first three values determine the amount which will be directly subtracted from damage due to armor.
# The next three values determine the percentage reduction from the damage.

armor_soak_factor_against_cut      = 0.8
armor_soak_factor_against_pierce    = 0.65
armor_soak_factor_against_blunt    = 0.5

armor_reduction_factor_against_cut      = 1.0
armor_reduction_factor_against_pierce    = 0.5
armor_reduction_factor_against_blunt    = 0.75


horse_charge_damage_multiplier        = 1.0
couched_lance_damage_multiplier      = 0.65
fall_damage_multiplier                = 1.0

#missiles with damage > shield_penetration_offset + shield_penetration_factor * shield
#will penetrate.

shield_penetration_offset = 30.0
shield_penetration_factor = 3.0

#setting speed_power to 2.0 makes damage scale with the square of missile's speed.
# you can set it to 1.0 to make it scale linearly as it was before.
missile_damage_speed_power = 1.9;
melee_damage_speed_power = 2.0;


#change this to 0 if you want to keep the food slot in inventory window.
disable_food_slot      = 1

# Change this to 1 if you want to load
# textures from Modules/<Module_Dir>/Textures/

scan_module_textures = 1
scan_module_sounds = 0

#edit mode should be enabled
#give_performance_warnings = 1


#You can also use load_mod_resource instead of load_resource to make sure you are reading files from module directory.

load_resource = test
load_resource = textures_face_gen
load_resource = shaders

load_mod_resource = templar_surcoat_tex

load_resource = textures

load_mod_resource= templar_surcoat_mat

load_resource = materials
load_resource = materials_face_gen

load_mod_resource= templar_surcoat

load_resource = uimeshes
load_resource = meshes_face_gen
load_resource = helpers
load_resource = map_tree_meshes
load_resource = map_icon_meshes
load_resource = particle_meshes
load_resource = skeletons
load_resource = tree_meshes
load_resource = xtree_meshes
load_resource = grass_meshes
load_resource = plant_meshes
load_resource = body_meshes
load_resource = object_meshes
load_resource = object_bodies


load_resource = goods_meshes
load_resource = item_meshes1
load_resource = horse_a

load_resource = arabian_horses
load_resource = arabian_castle

load_resource = food
load_resource = beards
load_resource = armors_b
load_resource = armors_c
load_resource = armors_d
load_resource = armors_e
load_resource = armors_f
load_resource = armors_g
load_resource = armors_h

load_resource = armors_i

load_resource = boots_b
load_resource = boots_c
load_resource = helmets

load_resource = helmets_b
load_resource = village_houses
load_resource = village_houses_a
load_resource = village_houses_b
load_resource = hair
load_resource = deneme

load_resource = interiors_a
load_resource = interiors_b
load_resource = interiors_c
load_resource = arena
load_resource = map_icons_b
load_resource = castle_a
load_resource = dungeon
load_resource = stone_houses
load_resource = snowy_houses
load_resource = snowy_castle
load_resource = helmets_d
load_resource = helmets_e
load_resource = helmets_f

load_resource = castle_b
load_resource = square_keep
load_resource = anim_b
load_resource = shields
load_resource = shields_b
load_resource = weapon_meshes_c
load_resource = xtree_meshes_b
load_resource = map_icons_c
load_resource = pictures
load_resource = user_interface_b
load_resource = user_interface_c

load_resource = scene_encounter_spot
load_resource = interior_thirsty_lion
load_resource = scene_small_tavern

load_resource = weapon_meshes1
load_resource = weapon_meshes_b

load_resource = houses1
load_resource = wall_meshes1

load_resource = town_houses
load_resource = doors
load_resource = churches


load_resource = town_houses_b
load_resource = castle_c
load_resource = castle_d
load_resource = castle_e
load_resource = castle_f
load_resource = castle_g
load_resource = castle_h
load_resource = castle_i

load_resource = gatehouse
load_resource = viking_houses


load_resource = fake_houses
load_resource = town_houses_c
load_resource = banners
load_resource = map_flags
load_resource = map_flags_b
load_resource = map_flags_c
load_resource = map_flags_d

#load_resource = costumes_a
load_resource = particles_2
load_resource = prisons
load_resource = prisons_b
load_resource = interiors_d
load_resource = costumes_b
load_resource = costumes_c
load_resource = arena_costumes
load_resource = boots_a
load_resource = terrain_borders
load_resource = terrain_borders_b
load_resource = skyboxes
load_resource = object_b
load_resource = tree_e_meshes
load_resource = destroy
load_resource = xtree_meshes_c
load_resource = grass_meshes_b



load_resource = interiors_steppe

load_resource = grooming_horse
load_resource = town_houses_d


load_resource = horses_b
load_resource = ani_horse_mounted
load_resource = deneme2
load_resource = horse_skeleton

load_resource = steppe_fake_houses
load_resource = weapon_meshes_d

load_resource = tableau_shields
load_resource = heraldic_armors

load_resource = spear
load_resource = weapons_e
load_resource = weapons_f
load_resource = instruments
load_resource = sarranid_armors

load_resource = custom_banner

load_resource = simple_primitives

load_resource = ani_man_walk
load_resource = ani_twohanded
load_resource = ani_onehanded
load_resource = ani_death
load_resource = ani_stand_guardsman

load_resource = ani_human_mounted
load_resource = ani_lady_stand
load_resource = ani_poses
load_resource = ani_stand_shopkeeper
load_resource = ani_man_cheer
load_resource = ani_stand_onhorse
load_resource = ani_throw_stone
load_resource = ani_strikes
load_resource = ani_equip_arms
load_resource = ani_run_p
load_resource = ani_run_forward_left_right
load_resource = uni_strikes3
load_resource = ani_walk_sideways
load_resource = ani_run_sideways
load_resource = ani_stand

load_resource = ani_crouch_down
load_resource = ani_low_walk
load_resource = ani_turn_man
load_resource = ani_attacks_single
load_resource = ani_lancer
load_resource = ani_attacks
load_resource = ani_kicks
load_resource = ani_parry_attack
load_resource = ani_walk_backward
load_resource = ani_run_lookingsides
load_resource = ani_defends
load_resource = ani_walk_lookingsides
load_resource = ani_jump
load_resource = ani_wedding
load_resource = arabian_props


#animations
load_resource = uni_jump
load_resource = uni_stances
load_resource = uni_equip
load_resource = uni_strike
load_resource = uni_throws
load_resource = uni_fistswing
load_resource = uni_lord_stand
load_resource = uni_defence
load_resource = uni_sideways

load_resource = dart

load_resource = armors_new_a
load_resource = armors_new_b
load_resource = armors_new_heraldic
load_resource = armors_new_arena

load_resource = crossbows
load_resource = arabian_armors
load_resource = rock
load_resource = costumes_d
load_resource = nordic_helmets
load_resource = sarranid_helmets
load_resource = sarranid_armor
load_resource = raw_materials
load_resource = khergit_lady_dress
load_resource = vaegir_helmets
load_resource = gauntlets_new
load_resource = sarranid_lady_dress
load_resource = sarranid_boots
load_resource = bride_dress
load_resource = full_plate_armor
load_resource = weapon_meshes_e
load_resource = fur_armors_a
load_resource = ui_server_filter

load_resource = ship
load_resource = arabian_houses
load_resource = object_c
load_resource = tree_f
load_resource = interiors_arabian
load_resource = arabian_village
load_resource = valleyProps
load_resource = workshops

load_resource = barrier_primitives
load_resource = town_houses_e

works_with_version_min  = 1000
works_with_version_max  = 1011

limit_hair_colors = 1
show_faction_color = 1
show_quest_notes = 1

use_explicit_couch_flag = 1
dont_load_regular_troop_inventories = 1

#assign '1' for moveable physics on all scene props; no sokf_moveable flag will be needed
disable_moveable_flag_optimization = 0

#You can change the following to 1 for ease in module development
show_party_ids_instead_of_names = 0

crush_through_treshold = 2.4
 
Stick your textures, materials, and meshes in one brf so they reference eachother properly. Also, you might want to load your mod resource after all the Native ones.
 
I did it how Yoshi's tutorial instructed me too, i had at first put them in one file, and tried to load them after the other models, however, the game wouldn't even start because it couldn't find the files.
 
Make sure you don't save as Warband format. It's a trap.
I fail to see how the game can't load all three in one file. I have hundreds of each packed in one file + a collision mesh and it loads them fine.
 
What do you mean don't save in Warband format? I have them saved as BRF's whenever I put it into one file, and the have load_mod_resource= templar_surcoat at the end, I'm informed that it could not be found.
 
Capitalization matters.
And I mean this
obrf.png
 
You must be using a different version than me, I don't have anythign called Warband or M&B resource, it's just plain old resource.
 
It shows up only if you select Save As.  And if it doesn't, update OpenBRF.
插入代码块:
["templar_surcoat", "Templar Surcoat",[("templar_surcoat",0)],itp_merchandise|itp_type_body_armor|itp_covers_legs,0,1544 , weight(18)|abundance(100)|head_armor(0)|body_armor(48)|leg_armor(18)|difficulty(7) ,imodbits_armor],

As for the BRF, we can't help you if we can't see the files, frankly.  You could have messed up a number of things.
 
Somebody 说:
Make sure you don't save as Warband format. It's a trap.
Nah, it works. Warband Format simply needs every mesh to have the 30000 or 30001 flags-thingie on them.
 
I don't believe it's the BRF, I fixed it up a bit, so now everythign is in one file, and the game can load it. However, I it still isn't appearing in my inventory. If anybody wants to help me (which would be appreciated) I'm currently on the Modding IRC channel.
 
后退
顶部 底部