Custom items doesn't show up

Users who are viewing this thread

Methhead123

Recruit
I am trying to add some ww2 items to my mod but somehow the items doesn't show up in my game. (PLAYER)
(I just only altered the module_items and the module_troops)
image.png

image.png
 
Solution
If you write that the code is not working, do you mean that you get error messages at compiling (if yes, post the error message) or do you mean that there is no effect in-game afterwards (you need to reload the game)?

I am not sure why you try to attempt a new script. Look at the script game_quick_start, it's the first script. It's all organised in a similar way like Native. Look there for the comment #for multiplayer mode, search then for the first item_set_slot and then apply the same method to your new items as given there.

The same goes for your lines with script_multiplayer_set_item_available_for_troop: Check where they are appearing already and then add your new ones at that place in the same way.

The...
NW is an MP DLC, therefore it heavily relies on server-client communication/ events (some servers take it even further and handle item selection alone, as in Caesim's OSP/ LSP scripts of Minisiege; Tropical Paradise also has its own unique item selection menu). That being said, servers may override your client's properties. Check first if your items work offline, client-side.
 
Upvote 0
NW is an MP DLC, therefore it heavily relies on server-client communication/ events (some servers take it even further and handle item selection alone, as in Caesim's OSP/ LSP scripts of Minisiege; Tropical Paradise also has its own unique item selection menu). That being said, servers may override your client's properties. Check first if your items work offline, client-side.
Don't be resentful if i didn't fully get your judgement (sentence).
But i am just willing to create a mod like "Iron Europe" (I am not willing to create a server thing)
But the custom items somehow wont show up in the game (Only the Multiplayer troops [player troops])
For example :

image.png


image.png

image.png

Like what did i do wrong?

Python:
  ["American","3rd Infantry Division","Rifleman",tf_guarantee_all,0,0,fac_britain,
   [itm_rifle_test,itm_bullets,itm_british_baker_bayonet,itm_helmet_a1,itm_american_boots1,itm_america_assault,itm_america_assault,itm_america_mg,itm_wrapping_boots],
   def_attrib|level(20),wpex(30,5,90,5,170,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],
  ["American_nco","American soldier","Machinegunner",tf_guarantee_all,0,0,fac_british_ranks,
   [itm_machine_gun_test,itm_bullets,itm_british_baker_bayonet,itm_helmet_a1,itm_american_boots1,itm_america_assault,itm_america_assault,itm_america_mg,itm_wrapping_boots],
   def_attrib|level(20),wpex(30,5,90,5,170,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2], 
  ["American_sniper","American soldier","Sniper",tf_guarantee_all,0,0,fac_british_ranks,
   [itm_sniper_rifle,itm_bullets,itm_british_baker_bayonet,itm_helmet_a1,itm_american_boots1,itm_america_assault,itm_america_assault,itm_america_mg,itm_wrapping_boots],
   def_attrib|level(20),wpex(30,5,90,5,170,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],   
  ["American_medic","American soldier","Medic",tf_guarantee_all,0,0,fac_british_ranks,
   [itm_bandages,itm_america_medic,itm_american_boots2,itm_helmet_a2,itm_wrapping_boots,itm_british_pistol,itm_pistol_ammo,itm_russian_peasant_knife],
   def_attrib|level(20),wpex(30,5,90,5,170,5),knows_common|knows_ironflesh_2|knows_power_strike_1|knows_athletics_3,rhodok_face_younger_2, swadian_face_old_2],
Python:
 # American
["america_mg", "American Machine Gunner Uniform", [("america_mg",0)], itp_merchandise| itp_type_body_armor  |itp_covers_legs |itp_civilian,0,
 100 , weight(3)|abundance(100)|head_armor(0)|body_armor(15)|leg_armor(6)|difficulty(0) ,imodbits_cloth ],
["america_assault", "American Infantry Uniform", [("america_assault",0)], itp_merchandise| itp_type_body_armor  |itp_covers_legs |itp_civilian,0,
 100 , weight(3)|abundance(100)|head_armor(0)|body_armor(20)|leg_armor(6)|difficulty(0) ,imodbits_cloth ],
["america_medic", "American Medic Uniform", [("america_medic",0)], itp_merchandise| itp_type_body_armor  |itp_covers_legs |itp_civilian,0,
 100 , weight(3)|abundance(100)|head_armor(0)|body_armor(13)|leg_armor(6)|difficulty(0) ,imodbits_cloth ],
["american_boots1", "Pair of Boots", [("boots_america",0)], itp_merchandise| itp_type_foot_armor  |itp_civilian | itp_attach_armature,0,
10 , weight(1.25)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(30)|difficulty(0) ,imodbits_cloth ],
["american_boots2", "Pair of Boots", [("boots_america2",0)], itp_merchandise| itp_type_foot_armor  |itp_civilian | itp_attach_armature,0,
10 , weight(1.25)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(30)|difficulty(0) ,imodbits_cloth ],
["wrapping_boots", "Wrapping Boots", [("wrapping_boots_a",0)], itp_merchandise| itp_type_foot_armor  |itp_civilian | itp_attach_armature,0,
10 , weight(1.25)|abundance(100)|head_armor(0)|body_armor(0)|leg_armor(30)|difficulty(0) ,imodbits_cloth ],
["helmet_a1", "American Helmet", [("helmet_a",0)], itp_merchandise| itp_type_head_armor |itp_civilian|itp_doesnt_cover_hair  ,0, 4 , weight(1.0)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["helmet_a2", "American Medic Helmet", [("helmet_am",0)], itp_merchandise| itp_type_head_armor |itp_civilian|itp_doesnt_cover_hair  ,0, 4 , weight(1.0)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0)|difficulty(0) ,imodbits_cloth ],
["machine_gun_test", "Machine gun", [("Russian_rifle_1805",0)], itp_type_crossbow|itp_merchandise|itp_cant_reload_on_horseback|itp_two_handed|itp_primary|
 itp_next_item_as_melee|itp_cant_reload_while_moving, itcf_shoot_musket|itcf_carry_crossbow_back, 683, weight(5.0)|difficulty(0)|spd_rtng(18)|shoot_speed(250)|thrust_damage(100,pierce)|max_ammo(150)|accuracy(50), imodbits_none ],
["rifle_test", "Assault rifle", [("baker_rifle",0)], itp_type_crossbow|itp_merchandise|itp_cant_reload_on_horseback|itp_two_handed|itp_primary|
 itp_next_item_as_melee|itp_cant_reload_while_moving, itcf_shoot_musket|itcf_carry_crossbow_back, 683, weight(3.0)|difficulty(0)|spd_rtng(18)|shoot_speed(300)|
 thrust_damage(100,pierce)|max_ammo(45)|accuracy(87), imodbits_none ],
Don't be mad at me for me not adding the melee versions of the custom firearms
 
Upvote 0
Iirc you need to add all the items for the players at the game_start script similar to how it is done at Native:
Make a check for where the items appear which are working fine so that you know where to add your new ones.
 
Upvote 0
Iirc you need to add all the items for the players at the game_start script similar to how it is done at Native:
Make a check for where the items appear which are working fine so that you know where to add your new ones.
Idk if this coding tutorial is fully for NW but i started to write a code from the tut. as far as i could get:
Python:
  #america(scripts)
  ("mp_america",
   [
  (item_set_slot, "itm_america_mg", slot_item_multiplayer_item_class, multi_item_class_type_uniform),
  (item_set_slot, "itm_america_assault", slot_item_multiplayer_item_class, multi_item_class_type_uniform),
  (item_set_slot, "itm_america_medic", slot_item_multiplayer_item_class, multi_item_class_type_uniform),
  (item_set_slot, "itm_american_boots1", slot_item_multiplayer_item_class, multi_item_class_type_boot),
  (item_set_slot, "itm_american_boots2", slot_item_multiplayer_item_class, multi_item_class_type_boot),
  (item_set_slot, "itm_wrapping_boots", slot_item_multiplayer_item_class, multi_item_class_type_boot),
  (item_set_slot, "itm_helmet_a1", slot_item_multiplayer_item_class, multi_item_class_type_hat),
  (item_set_slot, "itm_helmet_a2", slot_item_multiplayer_item_class, multi_item_class_type_hat),
  (item_set_slot, "itm_machine_gun_test", slot_item_multiplayer_item_class, multi_item_class_type_gun),
  (item_set_slot, "itm_rifle_test", slot_item_multiplayer_item_class, multi_item_class_type_gun),

  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_america_mg", "trp_american"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_america_mg", "trp_american_nco"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_america_mg", "trp_american_sniper"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_america_assault", "trp_american"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_america_assault", "trp_american_nco"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_america_assault", "trp_american_sniper"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_america_medic", "trp_american_medic"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_american_boots1", "trp_american"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_american_boots1", "trp_american_nco"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_american_boots1", "trp_american_sniper"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_american_boots2", "trp_american_medic"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_wrapping_boots", "trp_american"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_wrapping_boots", "trp_american_sniper"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_wrapping_boots", "trp_american_nco"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_wrapping_boots", "trp_american_medic"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_helmet_a1", "trp_american"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_helmet_a1", "trp_american_nco"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_helmet_a1", "trp_american_sniper"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_helmet_a2", "trp_american_medic"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_machine_gun_test", "trp_american_nco"),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_rifle_test", "trp_american"),

     ]),
and found out that it didn't worked as i intented.So i rewrote it again.
Code:
  #america(scripts)
   [
  (try_begin),
  (item_set_slot, "itm_america_mg", slot_item_multiplayer_item_class, multi_item_class_type_uniform),
  (else_try),
  (item_set_slot, "itm_america_assault", slot_item_multiplayer_item_class, multi_item_class_type_uniform),
  (else_try),
  (item_set_slot, "itm_america_medic", slot_item_multiplayer_item_class, multi_item_class_type_uniform),
  (else_try),
  (item_set_slot, "itm_american_boots1", slot_item_multiplayer_item_class, multi_item_class_type_boot),
  (else_try),
  (item_set_slot, "itm_american_boots2", slot_item_multiplayer_item_class, multi_item_class_type_boot),
  (else_try),
  (item_set_slot, "itm_wrapping_boots", slot_item_multiplayer_item_class, multi_item_class_type_boot),
  (else_try),
  (item_set_slot, "itm_helmet_a1", slot_item_multiplayer_item_class, multi_item_class_type_hat),
  (else_try),
  (item_set_slot, "itm_helmet_a2", slot_item_multiplayer_item_class, multi_item_class_type_hat),
  (else_try),
  (item_set_slot, "itm_machine_gun_test", slot_item_multiplayer_item_class, multi_item_class_type_gun),
  (else_try),
  (item_set_slot, "itm_rifle_test", slot_item_multiplayer_item_class, multi_item_class_type_gun),
  (try_end),

  (try_begin),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_america_mg", "trp_american"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_america_mg", "trp_american_nco"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_america_mg", "trp_american_sniper"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_america_assault", "trp_american"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_america_assault", "trp_american_nco"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_america_assault", "trp_american_sniper"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_america_medic", "trp_american_medic"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_american_boots1", "trp_american"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_american_boots1", "trp_american_nco"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_american_boots1", "trp_american_sniper"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_american_boots2", "trp_american_medic"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_wrapping_boots", "trp_american"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_wrapping_boots", "trp_american_sniper"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_wrapping_boots", "trp_american_nco"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_wrapping_boots", "trp_american_medic"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_helmet_a1", "trp_american"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_helmet_a1", "trp_american_nco"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_helmet_a1", "trp_american_sniper"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_helmet_a2", "trp_american_medic"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_machine_gun_test", "trp_american_nco"),
  (else_try),
  (call_script, "script_multiplayer_set_item_available_for_troop", "itm_rifle_test", "trp_american"),
  (try_end),

     ]),
and the code still didn't work again. Like what was i lacking?
 
Last edited:
Upvote 0
If you write that the code is not working, do you mean that you get error messages at compiling (if yes, post the error message) or do you mean that there is no effect in-game afterwards (you need to reload the game)?

I am not sure why you try to attempt a new script. Look at the script game_quick_start, it's the first script. It's all organised in a similar way like Native. Look there for the comment #for multiplayer mode, search then for the first item_set_slot and then apply the same method to your new items as given there.

The same goes for your lines with script_multiplayer_set_item_available_for_troop: Check where they are appearing already and then add your new ones at that place in the same way.

The tutorial I linked should be covering most of the necessary topics. Perhaps it is a better start if don't start to create a whole new faction but start with adding new troops to an already existing faction. Here are some good tutorials to start off there:

Useful thread in general:
 
Last edited:
Upvote 0
Solution
Back
Top Bottom