Big problem adding new item to the game

Users who are viewing this thread

Lunatics

Recruit
NEW POST

Sorry to bump this thread. I ran into a big problem  . This have I done:

- added "load_mod_resource" in module.ini with the 3 files named (tensa_tex, tensa_mat, tensa_mesh)
- added damage and more things to the "module items.py" and got no error when compiling
- The 3 files are in their folders where they belong to (tex,mat,mesh are in "Resource", Texture.dds in "Textures"
- I became an error when I gave the item to trp_player, more specified in "module troops.py"
the error told me about a "Illegal operation" error.

Do I miss any steps in weapon creating? Maybe it would make me more intelligent, if you write the correct order to do these kind of things right.

Thanks 

ORIGINAL POST

Hy everybody!

I used the search engine, but I didn´t find what I were searching for. I have a minor problem, but it is annoying.
I want to check whether my new item is appearing in the game or not. Is there a easy way to spawn this item or can I maybe
specify the location where it should appear? Have you other suggestions?

It is a nuisance that I don´t have the opportunity to see whether the mod is working or not.

It would help a lot, because I created a new model and I want to see it ingame.
Thanks for the hopefully upcoming help and I wish you a good day.  :grin:

(sorry for my bad english)

 
A lot of ways. 
If you have a few items probably the easiest solution is to give them to trp_player. 
If you have several items you can put them in bonus chests.
If you have a heap of new item, you can create several special “cheat” menus in e.g. camp menu each of them gives to trp_player part of new items.


 
Sorry to bump this thread. I ran into a big problem  :sad: . This have I done:

- added "load_mod_resource" in module.ini with the 3 files named (tensa_tex, tensa_mat, tensa_mesh)
- added damage and more things to the "module items.py" and got no error when compiling
- The 3 files are in their folders where they belong to (tex,mat,mesh are in "Resource", Texture.dds in "Textures"
- I became an error when I gave the item to trp_player, more specified in "module troops.py"
the error told me about a "Illegal operation" error.

Do I miss any steps in weapon creating? Maybe it would make me more intelligent, if you write the correct order to do these kind of things right.

Thanks  :grin:
 
Yes, I would do that. Unfortunately, I´m in school right now. But when I come home, I will post the code.
It is indeed weird, that the model mesh is working in the module_items.py. So I come to the conclusion that the filepathes and the meshes are in the correct places. There must be a problem in the "module_troops.py". One question: Have I done all steps to getting it ingame or am I missing something?

Thank you, for your answer!

 
Hmmm... Basicly I didn´t write something in module_troop.py, my fault.
I wrote it in module_game_menues.py.

Code:
from header_game_menus import *
from header_parties import *
from header_items import *
from header_mission_templates import *
from header_music import *
from header_terrain_types import *

from module_constants import *

####################################################################################################################
#  (menu-id, menu-flags, menu_text, mesh-name, [<operations>], [<options>]),
#
#   Each game menu is a tuple that contains the following fields:
#  
#  1) Game-menu id (string): used for referencing game-menus in other files.
#     The prefix menu_ is automatically added before each game-menu-id
#
#  2) Game-menu flags (int). See header_game_menus.py for a list of available flags.
#     You can also specify menu text color here, with the menu_text_color macro
#  3) Game-menu text (string).
#  4) mesh-name (string). Not currently used. Must be the string "none"
#  5) Operations block (list). A list of operations. See header_operations.py for reference.
#     The operations block is executed when the game menu is activated.
#  6) List of Menu options (List).
#     Each menu-option record is a tuple containing the following fields:
#   6.1) Menu-option-id (string) used for referencing game-menus in other files.
#        The prefix mno_ is automatically added before each menu-option.
#   6.2) Conditions block (list). This must be a valid operation block. See header_operations.py for reference. 
#        The conditions are executed for each menu option to decide whether the option will be shown to the player or not.
#   6.3) Menu-option text (string).
#   6.4) Consequences block (list). This must be a valid operation block. See header_operations.py for reference. 
#        The consequences are executed for the menu option that has been selected by the player.
#
#
# Note: The first Menu is the initial character creation menu.
####################################################################################################################

game_menus = [
#This needs to be the first window!!!
  (
    "start_game_1",menu_text_color(0xFF000000)|mnf_disable_all_keys,
    "Welcome, adventurer, to Mount&Blade. Before you can start playing the game you must create a character. To begin, select your character's gender.",
    "none",
    [],
    [
      ("start_male",[],"Male",
       [
           (troop_set_type,"trp_player",0),
           (assign,"$character_gender",tf_male),
           (jump_to_menu,"mnu_start_character_1"),
        ]
       ),
      ("start_female",[],"Female",
       [
           (troop_set_type,"trp_player",1),
           (assign,"$character_gender",tf_female),
           (jump_to_menu,"mnu_start_character_1")
        ]
       ),
      ("go_back",[],"Go back",
       [(change_screen_quit),
        ]
       ),
      ]
  ),
#This needs to be the second window!!!
  (
    "start_phase_2",mnf_disable_all_keys,
#    "During your travels, you come accross a group of wandering men looking for a leader. You...",
#
    "You arrive at Calradia, a land torn between rival kingdoms battling each other for supremacy,\
 a haven for knights and mercenaries, cutthroats and adventurers, all willing to risk their lives in pursuit of fortune, power, or glory...\
 In this land which holds great dangers and even greater opportunities, you will leave your past behind and start a new life.\
 Now, on a rise above a distant training field, you feel that you hold the key of your destiny in your hands, free to choose as you will,\
 and that whatever course you take, great adventures await you.",
    "none",
    [],
    [
      ("continue",[],"Continue...",
       [
         (call_script, "script_get_player_party_morale_values"),
         (party_set_morale, "p_main_party", reg0),
         (change_screen_return),
        ]
       ),
##      ("lead_them",[],"...convince them to follow you, promising riches and glory.",
##       [
##           (party_add_members, "p_main_party", "trp_farmer", 5),
##           (change_screen_return),
##        ]
##       ),
##      ("let_them_go",[],"...wish them good luck and go the other way.",
##       [
##           (change_screen_return),
##        ]
##       ),
      ("tutorial_cheat",[(eq,1,0)],"CHEAT!",
       [
         (change_screen_return),
         (assign, "$cheat_mode", 1),
         (set_show_messages, 0),
         (add_xp_to_troop, 15000, "trp_player"),
         (troop_raise_skill, "trp_player", skl_leadership, 7),
         (troop_raise_skill, "trp_player", skl_prisoner_management, 5),
         (party_add_members, "p_main_party", "trp_swadian_knight", 10),
         (party_add_members, "p_main_party", "trp_vaegir_knight", 10),
         (party_add_members, "p_main_party", "trp_vaegir_archer", 10),
         (party_add_members, "p_main_party", "trp_swadian_sharpshooter", 10),


         (troop_add_item, "trp_player","itm_pike",0),
         (troop_add_item, "trp_player","itm_light_crossbow",0),
         (troop_add_item, "trp_player","itm_tab_shield_pavise_a",0),
         (troop_add_item, "trp_player","itm_heavy_crossbow",0),
         (troop_add_item, "trp_player","itm_tribal_warrior_outfit",0),
(troop_add_item, 
"trp_player","tensa_mesh",0),
         
         (troop_add_item, "trp_player","itm_sword_two_handed_a",0),
         (troop_add_item, "trp_player","itm_sword_two_handed_a",0),
     

AND SO ON... Cutted it, because I couldn´t post it completely. Other things were not changed.

 
Lunatics said:
Hmmm... Basicly I didn´t write something in module_troop.py, my fault.
I wrote it in module_game_menues.py.

        (troop_add_item, "trp_player","itm_pike",0),
        (troop_add_item, "trp_player","itm_light_crossbow",0),
        (troop_add_item, "trp_player","itm_tab_shield_pavise_a",0),
        (troop_add_item, "trp_player","itm_heavy_crossbow",0),
        (troop_add_item, "trp_player","itm_tribal_warrior_outfit",0),
(troop_add_item,
"trp_player","tensa_mesh",0),

       
        (troop_add_item, "trp_player","itm_sword_two_handed_a",0),
        (troop_add_item, "trp_player","itm_sword_two_handed_a",0),

the red part above should read:

(troop_add_item, "trp_player","itm_item_name",0),

where item_name is what ever you named your item in the module_items.py file
 
Many thanks, it worked  :grin:

I were a idiot when I think about it. Stating several times the model mesh, but not the item name I specified in the module items.

Anyway, many thanks.
 
I cant find anything on adding items which include your own meshes and textures so posting here its most likily something simple but anyway.

I have a hat I am looking to add to the game for one the races I am creating the item is a witches hat.

I have done the following.

Placed witch.dds in textures
Placed witch.obj in resources

Added to the module.ini
load_mod_resource = witch

With the game wont start up without works fine. loading mod textures is on
scan_module_textures = 1


Added the following to module_items
["witches_hat", "Witches Hat", [("witch",0)], itp_merchandise| itp_type_head_armor|itp_civilian ,0, 6 , weight(1)|abundance(100)|head_armor(:cool:|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ]

The following is my troop which is suppose to be on. The troops work fine without hat added to module_troops
["trainee_witch","Trainee Witch","Trainee Witches",tf_female|tf_guarantee_boots|tf_guarantee_armor,0,0,fac_neutral,
  [itm_arrows, itm_trainee_wand_of_fire, itm_witches_hat, itm_trainee_wand_of_ice, itm_trainee_wand_of_thunder, itm_blue_dress, itm_nomad_boots,itm_wrapping_boots],

Any ideas
 
Fixed issue, put .obj in resources not .brf or whatever it is though now all my people are bold... arhh hats
 
Back
Top Bottom