Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
kalarhan said:
only stupid question is the one you never ask
:smile:

kalarhan said:
no. It is part of a list (array), so the format is just to make it easier for us to read it. It doesn't matter

a = [ [  ], [    ], ]

a = [
[  ],
[  ],
]
thanks now i can work without minding those spaces any more!

Edit: where can i find the females(wifes daughters ladies) in header files since i'm working on the families of the vassels(lords) and i want to give them wifes and daughters but how can i do that ?
i checked the native ones and i know now how to create the wifes just add for example something like this(the code)
Code:
["knight_1_1_wife", "Lady Yuki", "Lady Yuki", tf_female|tf_hero|tf_unmoveable_in_party_window, no_scene, reserved, fac_commoners, [itm_lady_dress_ruby,itm_turret_hat_ruby,itm_leather_boots], def_attrib|level(2), wp(50), knows_common|knows_riding_2, 0x000000055910200107632d675a92b92d00000000001e45620000000000000000 ],
["kingdom_1_lady_2", "Lady Anna", "Anna", tf_female|tf_hero|tf_unmoveable_in_party_window, no_scene, reserved, fac_kingdom_1, [itm_leather_boots], def_attrib|level(2), wp(50), knows_common|knows_riding_2, 0x000000055910200107632d675a92b92d00000000001e45620000000000000000 ],
and an image for the full thing
BBJJtm9.jpg
 
Hey everyone!
Is it possible to make items slowly disappear like bodies on the battlefield? It seems like they stay indefinitely, unlike people. Would it have a significant impact on performances if they vanish?

It's very possible that it's hardcoded though, like bodies.
 
snouz said:
Is it possible to make items slowly disappear like bodies on the battlefield?

sure, you can as a example use a timed trigger that removes any item after xxx seconds

VC has two examples. First is for items you added (in this case heads used on decapitation)

Code:
  (10, 0, 0, [],#VC-3296
    [
      (try_for_prop_instances, ":instance", "spr_head"),
        (scene_prop_get_slot, ":timer", ":instance", scene_prop_timer),
        (val_max, ":timer", 0),
        (try_begin),
          (lt, ":timer", 3),
          (val_add, ":timer", 1),
          (scene_prop_set_slot, ":instance", scene_prop_timer, ":timer"),
        (else_try),
          (eq, ":timer", 3),
          (scene_prop_fade_out, ":instance", 2000),
          (val_add, ":timer", 1),
          (scene_prop_set_slot, ":instance", scene_prop_timer, ":timer"),
        (end_try),
      (end_try),
  ]),

Second is for dropped items (weapons, shields) used on sea battles:

Code:
  (2.7, 0, 0, [],	
    [
      (try_for_prop_instances, ":item_instance", -1, somt_spawned_unsheathed_item),
        (scene_prop_slot_eq, ":item_instance", scene_prop_timer, 0),
        (scene_prop_set_slot, ":item_instance", scene_prop_timer, 1),
       
        (prop_instance_get_position, pos1, ":item_instance"),
     
        (position_set_z, pos1, -3500),
       
        (prop_instance_animate_to_position, ":item_instance", pos1, 500),
        (scene_prop_fade_out, ":item_instance", 500),
      (end_try),
  ]),

note that the first is done for instances of a know item. The second uses a filter option "somt_spawned_unsheathed_item"
 
kalarhan said:
snouz said:
Is it possible to make items slowly disappear like bodies on the battlefield?

sure, you can as a example use a timed trigger that removes any item after xxx seconds

VC has two examples. First is for items you added (in this case heads used on decapitation)

Code:
  (10, 0, 0, [],#VC-3296
    [
      (try_for_prop_instances, ":instance", "spr_head"),
        (scene_prop_get_slot, ":timer", ":instance", scene_prop_timer),
        (val_max, ":timer", 0),
        (try_begin),
          (lt, ":timer", 3),
          (val_add, ":timer", 1),
          (scene_prop_set_slot, ":instance", scene_prop_timer, ":timer"),
        (else_try),
          (eq, ":timer", 3),
          (scene_prop_fade_out, ":instance", 2000),
          (val_add, ":timer", 1),
          (scene_prop_set_slot, ":instance", scene_prop_timer, ":timer"),
        (end_try),
      (end_try),
  ]),

Second is for dropped items (weapons, shields) used on sea battles:

Code:
  (2.7, 0, 0, [],	
    [
      (try_for_prop_instances, ":item_instance", -1, somt_spawned_unsheathed_item),
        (scene_prop_slot_eq, ":item_instance", scene_prop_timer, 0),
        (scene_prop_set_slot, ":item_instance", scene_prop_timer, 1),
       
        (prop_instance_get_position, pos1, ":item_instance"),
     
        (position_set_z, pos1, -3500),
       
        (prop_instance_animate_to_position, ":item_instance", pos1, 500),
        (scene_prop_fade_out, ":item_instance", 500),
      (end_try),
  ]),

note that the first is done for instances of a know item. The second uses a filter option "somt_spawned_unsheathed_item"

If the visual "fade out" isn't necessarily needed, then you can just use the quick way;
Code:
mission_object_prune_time = 180
That's the default value, so items disappear after 180 seconds.

In case you spawn items via the MS, just make sure to set up the prune-time parameter;
Code:
spawn_item                                  = 1971  # (spawn_item, <item_kind_id>, <item_modifier>, [seconds_before_pruning]),
                                                    # Spawns a new item, possibly with modifier, on the scene in the position specified by previous call to (set_spawn_position). Optional parameter determines time period (in second) after which the item will disappear. Using 0 will prevent the item from disappearing.
 
I thought the engine would spawn a second row of helmets on its own here, or am I doing something wrong?

FpHqPm2.jpg
 
BNS Marko said:
I thought the engine would spawn a second row of helmets on its own here, or am I doing something wrong?

FpHqPm2.jpg
The default presentation is not supposed to display more than 7 items per item-class/row.
So you would need to check for the number of items and draw additional rows accordingly.
It's not about the engine at all.
 
BNS Marko said:
I thought the engine would spawn a second row of helmets on its own here, or am I doing something wrong?

FpHqPm2.jpg

In script_game_quick_start when assigning the item categories for multiplayer you can use multi_item_class_type_heavy_helm and multi_item_class_type_light_helm for the helmets and they will go in separate rows. Ex:

Code:
	  (item_set_slot, "itm_greek_pylos", slot_item_multiplayer_item_class, multi_item_class_type_light_helm),	  
	  (item_set_slot, "itm_greek_pylos_2", slot_item_multiplayer_item_class, multi_item_class_type_light_helm),	  
	  (item_set_slot, "itm_greek_pylos_3", slot_item_multiplayer_item_class, multi_item_class_type_light_helm),	  
	  (item_set_slot, "itm_greek_pylos_4", slot_item_multiplayer_item_class, multi_item_class_type_light_helm),	  
	  (item_set_slot, "itm_greek_pylos_5", slot_item_multiplayer_item_class, multi_item_class_type_light_helm),	  
	  (item_set_slot, "itm_greek_pylos_6", slot_item_multiplayer_item_class, multi_item_class_type_light_helm),	  
	  (item_set_slot, "itm_greek_pylos_7", slot_item_multiplayer_item_class, multi_item_class_type_light_helm),	  

	  (item_set_slot, "itm_greek_pylos_crest", slot_item_multiplayer_item_class, multi_item_class_type_heavy_helm),	
	  (item_set_slot, "itm_greek_pylos_crest_2", slot_item_multiplayer_item_class, multi_item_class_type_heavy_helm),	
	  (item_set_slot, "itm_greek_pylos_crest_3", slot_item_multiplayer_item_class, multi_item_class_type_heavy_helm),	
	  (item_set_slot, "itm_greek_pylos_crest_4", slot_item_multiplayer_item_class, multi_item_class_type_heavy_helm),	
	  (item_set_slot, "itm_greek_pylos_crest_5", slot_item_multiplayer_item_class, multi_item_class_type_heavy_helm),	
	  (item_set_slot, "itm_greek_pylos_crest_6", slot_item_multiplayer_item_class, multi_item_class_type_heavy_helm),	
	  (item_set_slot, "itm_greek_pylos_crest_7", slot_item_multiplayer_item_class, multi_item_class_type_heavy_helm),

The item classes are defined in header_common:

Code:
multi_item_class_type_sword = 1
multi_item_class_type_axe = 2
multi_item_class_type_blunt = 3
multi_item_class_type_war_picks = 4
multi_item_class_type_cleavers = 5
multi_item_class_type_two_handed_sword = 6
multi_item_class_type_two_handed_axe = 7
multi_item_class_type_spear = 8
multi_item_class_type_lance = 9
multi_item_class_type_small_shield = 10
multi_item_class_type_large_shield = 11
multi_item_class_type_bow = 12
multi_item_class_type_crossbow = 13
multi_item_class_type_arrow = 14
multi_item_class_type_bolt = 15
multi_item_class_type_throwing = 16
multi_item_class_type_throwing_axe = 17
multi_item_class_type_horse = 18
multi_item_class_type_light_armor = 19
multi_item_class_type_medium_armor = 20
multi_item_class_type_heavy_armor = 21
multi_item_class_type_light_helm = 22
multi_item_class_type_heavy_helm = 23
multi_item_class_type_light_foot = 24
multi_item_class_type_heavy_foot = 25
multi_item_class_type_glove = 26

Which can be modified if you ever need another row of helmets:

Code:
multi_item_class_type_sword = 1
multi_item_class_type_axe = 2
multi_item_class_type_blunt = 3
multi_item_class_type_war_picks = 4
multi_item_class_type_cleavers = 5
multi_item_class_type_two_handed_sword = 6
multi_item_class_type_two_handed_axe = 7
multi_item_class_type_spear = 8
multi_item_class_type_lance = 9
multi_item_class_type_small_shield = 10
multi_item_class_type_large_shield = 11
multi_item_class_type_bow = 12
multi_item_class_type_crossbow = 13
multi_item_class_type_arrow = 14
multi_item_class_type_bolt = 15
multi_item_class_type_throwing = 16
multi_item_class_type_throwing_axe = 17
multi_item_class_type_horse = 18
multi_item_class_type_light_armor = 19
multi_item_class_type_medium_armor = 20
multi_item_class_type_heavy_armor = 21
multi_item_class_type_light_helm = 22
##### New
multi_item_class_type_medium_helm = 23
#####
multi_item_class_type_heavy_helm = 24
multi_item_class_type_light_foot = 25
multi_item_class_type_heavy_foot = 26
multi_item_class_type_glove = 27

Just make sure it's in the correct category range:

Code:
multi_item_class_type_weapons_begin = multi_item_class_type_sword
multi_item_class_type_weapons_end = multi_item_class_type_horse
multi_item_class_type_horses_begin = multi_item_class_type_weapons_end
multi_item_class_type_horses_end = multi_item_class_type_light_armor
multi_item_class_type_bodies_begin = multi_item_class_type_horses_end
multi_item_class_type_bodies_end = multi_item_class_type_light_helm
multi_item_class_type_heads_begin = multi_item_class_type_bodies_end
multi_item_class_type_heads_end = multi_item_class_type_light_foot
multi_item_class_type_feet_begin = multi_item_class_type_heads_end
multi_item_class_type_feet_end = multi_item_class_type_glove
multi_item_class_type_gloves_begin = multi_item_class_type_feet_end
multi_item_class_type_gloves_end = multi_item_class_type_glove + 1
 
Sorry to keep dragging up my item adding issues, but it seems there is one more obstacle in my path.

The items are added to the game, but they simply do not show up in shops anywhere I look. They will show up on troops if I give them the items but they won't appear in markets.

I have used morgh's editor and I have the merchandise option checked. I also set the abundance of the items to 100 just like all of the others to make sure it was just as common to find. I also have the code for the items in itemkinds1, with the correct number at the top of that text, it cannot be a major issue because the items are still showing up in game on soldiers... is there anything I have forgotten?  :ohdear:

PS: I would like to thank the people who answered my previous questions, I never formally thanked them and now I feel bad.  :cry:
 
Fredrick said:
Sorry to keep dragging up my item adding issues, but it seems there is one more obstacle in my path.

The items are added to the game, but they simply do not show up in shops anywhere I look. They will show up on troops if I give them the items but they won't appear in markets.

I have used morgh's editor and I have the merchandise option checked. I also set the abundance of the items to 100 just like all of the others to make sure it was just as common to find. I also have the code for the items in itemkinds1, with the correct number at the top of that text, it cannot be a major issue because the items are still showing up in game on soldiers... is there anything I have forgotten?  :ohdear:

PS: I would like to thank the people who answered my previous questions, I never formally thanked them and now I feel bad.  :cry:

Have you tried starting a new game? Either that or find a way to force reload the merchant inventories/wait a few days or week in game. I haven't added items in a while, but I think that could be the issue. Try starting a new game first.
 
It partially worked... Now the item will show up in the shop if I add the item via morgh's editor. Unfortunately, it uses the texture of the template item instead.

If I do not use Morgh's to add the item to the game, then the item still will not show up in the tavern. Format shouldn't be a problem because I copied the item's code directly from the other mod...



thanks for your help mercury!
 
Fredrick said:
It partially worked... Now the item will show up in the shop if I add the item via morgh's editor. Unfortunately, it uses the texture of the template item instead.

If I do not use Morgh's to add the item to the game, then the item still will not show up in the tavern. Format shouldn't be a problem because I copied the item's code directly from the other mod...



thanks for your help mercury!

What do you mean by template item?

As for text file editing, I'm way out of practice for that so I can't advise you there, sorry.
 
In regards to text editing, it doesn't really matter as long as I can just get Morgh's editor to work.

What I meant by the template was that when you add a new item, you have to select a previous item as a template, and then you rename it and change the stats and it creates the new item. All handy dandy right?...

The problem is that it takes the mesh of the old item, and uses that instead of the mesh for the new item I wanted.

For example, I am trying to add a decorated tabard to the game. In Morgh's I select the old tabard for the template, and create a new item off of that. I then add a mesh and change it to the name of the mesh used for the new item. However, it does not allow me to delete the old mesh, so when I open the game, the decorated tabard shows up, but it looks exactly like the regular tabard item.

Does that help?
 
Fredrick said:
In regards to text editing, it doesn't really matter as long as I can just get Morgh's editor to work.

What I meant by the template was that when you add a new item, you have to select a previous item as a template, and then you rename it and change the stats and it creates the new item. All handy dandy right?...

The problem is that it takes the mesh of the old item, and uses that instead of the mesh for the new item I wanted.

For example, I am trying to add a decorated tabard to the game. In Morgh's I select the old tabard for the template, and create a new item off of that. I then add a mesh and change it to the name of the mesh used for the new item. However, it does not allow me to delete the old mesh, so when I open the game, the decorated tabard shows up, but it looks exactly like the regular tabard item.

Does that help?

Ah, I see. Had to dig up my old copy of morgh's but I got it. Based on what you said, you added a new mesh to your item by pressing add. What that does is it gives the game two meshes to use, but the item only needs one. So the game chooses the first one, which is the template item. Instead of adding meshes, delete the one you added, then change the name of the native one to yours and hit update, then save your changes etc. As long as your mesh ahs a unique name that should do it.
 
@Fredrick, there is also another one simple way to change meshes, even if you use Morgh to edit items.
1. Create a copy from a template.
2. Open item_kinds1.txt, search and find item you've created and change its mesh.

for example:
Code:
itm_lvl_3_sorceress Sorceress_Hero_Armor Sorceress_Hero_Armor 1  rogue_armor1 0  553713677 0 14828 704643236 6.000000 70 6 72 36 8 0 0 0 0 0 0 0
 0
0

"rogue_armor1" is the mesh that should be changed.
 
Well, that small detail was all that stood in the way! It appears to be working now! My beautiful decorated tabard finally spawned. Thanks a million guys!!!
 
Status
Not open for further replies.
Back
Top Bottom