Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
I'm trying to make a simple_trigger that will only fire when the player is close to villages owned by a certain faction:

Code:
#Volantis Map Events
  (1,
	[
#FACTION
(try_for_range, ":event_village", villages_begin, villages_end),
(store_faction_of_party, ":faction_no", ":event_village"),
(eq, ":faction_no", "fac_kingdom_1"),
(store_distance_to_party_from_party, ":distance", "p_main_party", ":event_village"),
(lt, ":distance", 13),	

(neq,"$g_camp_mode", 1),
(neq, "$g_town_visit_after_rest", 1),
(neq, "$g_player_is_captive", 1),
(party_get_current_terrain, ":terrain", "p_main_party"),
(this_or_next|eq, ":terrain", 2), #Steppe
(this_or_next|eq, ":terrain", 3), #Plain
(this_or_next|eq, ":terrain", 4), #Snow
(this_or_next|eq, ":terrain", 10), #Steppe Forest
(this_or_next|eq, ":terrain", 11), #Plain Forest
(eq, ":terrain", 12), #Snow Forest



(neg|troop_slot_ge, "trp_player", slot_troop_prisoner_of_party, 0),
          (store_random_in_range, ":rand", 0, 7),
                                          (try_begin),
                                            (eq, ":rand", 0), 
			(jump_to_menu,"mnu_volantis_map_event_1"),
                                          (else_try),
                                            (eq, ":rand", 1),
			(jump_to_menu,"mnu_volantis_map_event_2"),
                                          (else_try),
                                            (eq, ":rand", 2),
			(jump_to_menu,"mnu_volantis_map_event_3"),
                                          (else_try),
                                            (eq, ":rand", 3),
			(jump_to_menu,"mnu_volantis_map_event_4"),
                                          (else_try),
        (display_message,"@ "),
          (try_end),
	]),

But it's not firing at all since I added this:

Code:
(try_for_range, ":event_village", villages_begin, villages_end),
(store_faction_of_party, ":faction_no", ":event_village"),
(eq, ":faction_no", "fac_kingdom_1"),
(store_distance_to_party_from_party, ":distance", "p_main_party", ":event_village"),
(lt, ":distance", 13),
 
Lokameister said:
I use swyters cartographer to edit the map, I want to do a completely new map that is much larger and prefferably in a wide rectangle. But so far I only figured out how to change the camera restriction, also when I flattend the map the game crashes when I try to start a new game and I get this message Unable to position party Main Party (17:00, 52:50).

see module.ini for the map dimensions
Code:
#map
map_min_x   = -257.903931 #frisia
map_max_x   = 281.758255 #dinamarca
map_min_y   = -281.854553
map_max_y   = 290.571899

see module_parties.py for the default position of player party ("main_party"). Make sure it is inside your map area and in a valid terrain.
see module_scripts.py, script "game_start", as it is usual to have code moving the player party to a new position. For Native
Code:
  ("game_start",
   [
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_state, sfs_inactive),
      (assign, "$g_player_luck", 200),
      (assign, "$g_player_luck", 200),
      (troop_set_slot, "trp_player", slot_troop_occupation, slto_kingdom_hero),
      (store_random_in_range, ":starting_training_ground", training_grounds_begin, training_grounds_end),
      (party_relocate_near_party, "p_main_party", ":starting_training_ground", 3),
the last line tries to move your party near a training ground. If you dont have any... that wont work, right?
 
Thank you for the info. I haven't modified the parties and I have flattened the map and made it all into snow forest for now which I assume is a passable terrain. So why can it not locate the party? Its a completely flat map that's all passable and all the parties are in their original relative positions. I'm not sure what I am supposed to do.
 
Cozur said:
I'm trying to make a simple_trigger that will only fire when the player is close to villages owned by a certain faction:

Code:
#Volantis Map Events
  (1,
	[
#FACTION
(try_for_range, ":event_village", villages_begin, villages_end),
(store_faction_of_party, ":faction_no", ":event_village"),
(eq, ":faction_no", "fac_kingdom_1"),
(store_distance_to_party_from_party, ":distance", "p_main_party", ":event_village"),
(lt, ":distance", 13),	

(neq,"$g_camp_mode", 1),
(neq, "$g_town_visit_after_rest", 1),
(neq, "$g_player_is_captive", 1),
(party_get_current_terrain, ":terrain", "p_main_party"),
(this_or_next|eq, ":terrain", 2), #Steppe
(this_or_next|eq, ":terrain", 3), #Plain
(this_or_next|eq, ":terrain", 4), #Snow
(this_or_next|eq, ":terrain", 10), #Steppe Forest
(this_or_next|eq, ":terrain", 11), #Plain Forest
(eq, ":terrain", 12), #Snow Forest



(neg|troop_slot_ge, "trp_player", slot_troop_prisoner_of_party, 0),
          (store_random_in_range, ":rand", 0, 7),
                                          (try_begin),
                                            (eq, ":rand", 0), 
			(jump_to_menu,"mnu_volantis_map_event_1"),
                                          (else_try),
                                            (eq, ":rand", 1),
			(jump_to_menu,"mnu_volantis_map_event_2"),
                                          (else_try),
                                            (eq, ":rand", 2),
			(jump_to_menu,"mnu_volantis_map_event_3"),
                                          (else_try),
                                            (eq, ":rand", 3),
			(jump_to_menu,"mnu_volantis_map_event_4"),
                                          (else_try),
        (display_message,"@ "),
          (try_end),
	]),

But it's not firing at all since I added this:

Code:
(try_for_range, ":event_village", villages_begin, villages_end),
(store_faction_of_party, ":faction_no", ":event_village"),
(eq, ":faction_no", "fac_kingdom_1"),
(store_distance_to_party_from_party, ":distance", "p_main_party", ":event_village"),
(lt, ":distance", 13),

Missing second (try_end)
 
Aight, that did the trick - but it's firing irregardless of the faction being within a distance of 13 or not - so basically all over the map?
 
Cozur said:
Aight, that did the trick - but it's firing irregardless of the faction being within a distance of 13 or not - so basically all over the map?

It seems you might have made mistake somewhere else (or you have similar triggers that fire on same conditions?). I tested your script (with addition of missing try_end) and it seems to work completely fine, fires only when player party is near kingdom_1 villages.

I would however decrease the distance needed for it to fire because it seems too high and may be confusing.
 
Im not 100% sure if that operation uses fixed point multipliers, but I suggest adding (set_fixed_point_multiplier, X) somewhere so that you are sure that the numbers being given to you by the operation is what you want. Fixed point multipliers get set in a lot of other scripts / triggers, so it is always good to make sure to reset it to the value you want for your trigger / script
 
Cozur,

you also need to optimize your trigger, currently it will fire every second as long as you're close to faction1 villages. That means your menu will continue opening potentially once every second as well, regardless of the fact it's already been opened.
 
Hello I have 2 questions.

added to mission_templates
(
    "istanbul_baskin",0,-1,
    "Default town visit",
    [
    (0,mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
(1,mtef_team_0,af_override_horse,aif_start_alarmed,9,[]),
(2,mtef_team_0,af_override_horse,aif_start_alarmed,9,[]),
(3,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(4,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(5,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(6,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(7,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(8,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(9,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(10,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(11,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(12,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
(13,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),

    ],
    [
(0, 0, ti_once,
      [
        (set_show_messages, 0),
        (team_give_order, 0, grc_everyone, mordr_hold),
        (team_give_order, 1, grc_everyone, mordr_hold),
        (set_show_messages, 1),   (scene_prop_set_visibility, "spr_ramp_small_a", 0),(scene_prop_set_visibility, "spr_siege_ladder_6m", 0),

        ], []),

(37, 0, ti_once,
      [
        (set_show_messages, 0),
        (team_give_order, 0, grc_everyone, mordr_charge),
        (team_give_order, 1, grc_everyone, mordr_charge),
        (set_show_messages, 1),   (scene_prop_set_visibility, "spr_ramp_small_a", 1),(scene_prop_set_visibility, "spr_siege_ladder_6m", 1),

        ], []),


First: I give order to player and player's enemy for holding in ships. When ships moving some troops drop from ships, I want to troops dont move.
mordr_hold working but troops moving to end of ship.
26Rkjj.jpg

2- I added some scene props to scene, ramp and ladder, I want to invisible theese scene props, after 37 seconds again visible.
ships moving.
EmBq38.jpg
 
JuJu70 said:
Cozur,

you also need to optimize your trigger, currently it will fire every second as long as you're close to faction1 villages. That means your menu will continue opening potentially once every second as well, regardless of the fact it's already been opened.

Ahh yeah, I know that - I'm just using it as a way to test it.
 
I'm modifying module _troops and _items, on a steam installation of game version 1.174, with module system 1.171.
I'm using Morgh's editor to speed things up, and I'm running into errors.

It seems like the game is looking for a bunch of the new items or troops from the godawful new MP mode they introduced.

Code:
Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Traceback (most recent call last):
  File "process_items.py", line 72, in <module>
    write_items(variables,variable_uses,tag_uses,quick_strings)
  File "process_items.py", line 30, in write_items
    ofile.write(" %d %d %d %d %f %d %d %d %d %d %d %d %d %d %d %d %d\n"%(item[3], item[4], item[5], item[7],
IndexError: list index out of range
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Error: Unable to find object:itm_ccoop_new_items_end
ERROR: Illegal Identifier:itm_ccoop_new_items_end
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Error: Unable to find object:itm_ccoop_new_items_end
ERROR: Illegal Identifier:itm_ccoop_new_items_end
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Error: Unable to find object:itm_ccoop_new_items_end
ERROR: Illegal Identifier:itm_ccoop_new_items_end
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Error: Unable to find object:itm_ccoop_new_items_end
ERROR: Illegal Identifier:itm_ccoop_new_items_end
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Error: Unable to find object:itm_ccoop_new_items_end
ERROR: Illegal Identifier:itm_ccoop_new_items_end
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Error: Unable to find object:itm_javelin_bow_ammo
ERROR: Illegal Identifier:itm_javelin_bow_ammo
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Error: Unable to find object:itm_javelin_bow_ammo
ERROR: Illegal Identifier:itm_javelin_bow_ammo
Error: Unable to find object:itm_running_boots
ERROR: Illegal Identifier:itm_running_boots
Error: Unable to find object:itm_power_gloves
ERROR: Illegal Identifier:itm_power_gloves
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Error: Unable to find object:itm_javelin_bow_ammo
ERROR: Illegal Identifier:itm_javelin_bow_ammo
Error: Unable to find object:itm_javelin_bow_ammo
ERROR: Illegal Identifier:itm_javelin_bow_ammo
Error: Unable to find object:itm_running_boots
ERROR: Illegal Identifier:itm_running_boots
Error: Unable to find object:itm_power_gloves
ERROR: Illegal Identifier:itm_power_gloves
Error: Unable to find object:itm_kicking_boots
ERROR: Illegal Identifier:itm_kicking_boots
Exporting mission_template data...
Error: Unable to find object:itm_knockdown_mace
ERROR: Illegal Identifier:itm_knockdown_mace
Error: Unable to find object:itm_blood_drain_throwing_knives
ERROR: Illegal Identifier:itm_blood_drain_throwing_knives
Error: Unable to find object:itm_instakill_knife
ERROR: Illegal Identifier:itm_instakill_knife
Error: Unable to find object:itm_backstabber
ERROR: Illegal Identifier:itm_backstabber
Error: Unable to find object:itm_disarming_throwing_axe
ERROR: Illegal Identifier:itm_disarming_throwing_axe
Error: Unable to find object:itm_kicking_boots
ERROR: Illegal Identifier:itm_kicking_boots
Error: Unable to find object:itm_doom_javelins
ERROR: Illegal Identifier:itm_doom_javelins
Error: Unable to find object:itm_team_change_dart
ERROR: Illegal Identifier:itm_team_change_dart
Error: Unable to find object:itm_weak_beserker_dart
ERROR: Illegal Identifier:itm_weak_beserker_dart
Error: Unable to find object:itm_restore_health_armour
ERROR: Illegal Identifier:itm_restore_health_armour
Exporting game menus data...
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .

Is there a different modsys version I need to use? Do I need to start from scratch without morgh's? What did I **** up? Is the item order messed up?
 
Rallix said:
I'm modifying module _troops and _items, on a steam installation of game version 1.174, with module system 1.171.
I'm using Morgh's editor to speed things up, and I'm running into errors.

It seems like the game is looking for a bunch of the new items or troops from the godawful new MP mode they introduced.

Code:
Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Traceback (most recent call last):
  File "process_items.py", line 72, in <module>
    write_items(variables,variable_uses,tag_uses,quick_strings)
  File "process_items.py", line 30, in write_items
    ofile.write(" %d %d %d %d %f %d %d %d %d %d %d %d %d %d %d %d %d\n"%(item[3], item[4], item[5], item[7],
IndexError: list index out of range
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Error: Unable to find object:itm_ccoop_new_items_end
ERROR: Illegal Identifier:itm_ccoop_new_items_end
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Error: Unable to find object:itm_ccoop_new_items_end
ERROR: Illegal Identifier:itm_ccoop_new_items_end
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Error: Unable to find object:itm_ccoop_new_items_end
ERROR: Illegal Identifier:itm_ccoop_new_items_end
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Error: Unable to find object:itm_ccoop_new_items_end
ERROR: Illegal Identifier:itm_ccoop_new_items_end
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Error: Unable to find object:itm_ccoop_new_items_end
ERROR: Illegal Identifier:itm_ccoop_new_items_end
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Error: Unable to find object:itm_javelin_bow_ammo
ERROR: Illegal Identifier:itm_javelin_bow_ammo
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Error: Unable to find object:itm_javelin_bow_ammo
ERROR: Illegal Identifier:itm_javelin_bow_ammo
Error: Unable to find object:itm_running_boots
ERROR: Illegal Identifier:itm_running_boots
Error: Unable to find object:itm_power_gloves
ERROR: Illegal Identifier:itm_power_gloves
Error: Unable to find object:itm_javelin_bow
ERROR: Illegal Identifier:itm_javelin_bow
Error: Unable to find object:itm_javelin_bow_ammo
ERROR: Illegal Identifier:itm_javelin_bow_ammo
Error: Unable to find object:itm_javelin_bow_ammo
ERROR: Illegal Identifier:itm_javelin_bow_ammo
Error: Unable to find object:itm_running_boots
ERROR: Illegal Identifier:itm_running_boots
Error: Unable to find object:itm_power_gloves
ERROR: Illegal Identifier:itm_power_gloves
Error: Unable to find object:itm_kicking_boots
ERROR: Illegal Identifier:itm_kicking_boots
Exporting mission_template data...
Error: Unable to find object:itm_knockdown_mace
ERROR: Illegal Identifier:itm_knockdown_mace
Error: Unable to find object:itm_blood_drain_throwing_knives
ERROR: Illegal Identifier:itm_blood_drain_throwing_knives
Error: Unable to find object:itm_instakill_knife
ERROR: Illegal Identifier:itm_instakill_knife
Error: Unable to find object:itm_backstabber
ERROR: Illegal Identifier:itm_backstabber
Error: Unable to find object:itm_disarming_throwing_axe
ERROR: Illegal Identifier:itm_disarming_throwing_axe
Error: Unable to find object:itm_kicking_boots
ERROR: Illegal Identifier:itm_kicking_boots
Error: Unable to find object:itm_doom_javelins
ERROR: Illegal Identifier:itm_doom_javelins
Error: Unable to find object:itm_team_change_dart
ERROR: Illegal Identifier:itm_team_change_dart
Error: Unable to find object:itm_weak_beserker_dart
ERROR: Illegal Identifier:itm_weak_beserker_dart
Error: Unable to find object:itm_restore_health_armour
ERROR: Illegal Identifier:itm_restore_health_armour
Exporting game menus data...
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .

Is there a different modsys version I need to use? Do I need to start from scratch without morgh's? What did I **** up? Is the item order messed up?

The modsys version is fine. The new game mode (Invasion) was added to the last version (maybe the ones before) and some items are commented out which are in Native inside the boxes (Team change dart for example). But they are not necessary to have, I still have them commented out without any problems. It seems more like you have added an item and made a misstake while implementing them. Look up if you have forgotten something like adding a modifier (modbit_shield or similar).

And like PitchPL already wrote, use one of them and not both, you will get used to the modsys quicker if you only use that one^^
 
Rallix said:
Traceback (most recent call last):
  File "process_items.py", line 72, in <module>
    write_items(variables,variable_uses,tag_uses,quick_strings)
  File "process_items.py", line 30, in write_items
    ofile.write(" %d %d %d %d %f %d %d %d %d %d %d %d %d %d %d %d %d\n"%(item[3], item[4], item[5], item[7],
IndexError: list index out of range

you have a item with invalid syntax, which is breaking the entire item compilation, and thus later it cant find the others
 
Hello fellow modders!

I'm not exactly sure this is the right place to ask, but the Diplomacy 4.3 forum is dead and I'm trying to change one thing about that mod. You see, there are these inventory chests in the towns that the player owns and they have random contents (like, in one town there are flax and velvet in the chest, and in another there's horses etc). This would be fine, but the contents seem to respawn periodically, so you get an infinite source of free income, and that's basically cheating. Does anyone have any idea how to change this? Surely there's some sort of script responsible?

The chest model is called 'spr_player_chest'. I tried searching for it in the Diplomacy 4.3 module system, and all I got was one line in the scene_props file.
 
This is probably an easy one, but the question would be too long to run through the search...

So I added some new items to the game, and but when I started playing it a while, I noticed the ambient lighting did not apply to that item. Basically, I had created a new glove (renamed mesh and altered texture), but when I was doing a battle at night, the glove was brightly lit as though it was daytime.

I'm guessing this is probably something really easy, but I figured I'd ask so I don't waste a ton of time trying to find it. Is this a line in a shader file somewhere? Or is it just something simple I missed in the file with the meshes itself?
 
Ty294 said:
This is probably an easy one, but the question would be too long to run through the search...

So I added some new items to the game, and but when I started playing it a while, I noticed the ambient lighting did not apply to that item. Basically, I had created a new glove (renamed mesh and altered texture), but when I was doing a battle at night, the glove was brightly lit as though it was daytime.

I'm guessing this is probably something really easy, but I figured I'd ask so I don't waste a ton of time trying to find it. Is this a line in a shader file somewhere? Or is it just something simple I missed in the file with the meshes itself?

You are probably using a material that has the No Lighting, or Uniform Lighting tags checked.

aleeque said:
Hello fellow modders!

I'm not exactly sure this is the right place to ask, but the Diplomacy 4.3 forum is dead and I'm trying to change one thing about that mod. You see, there are these inventory chests in the towns that the player owns and they have random contents (like, in one town there are flax and velvet in the chest, and in another there's horses etc). This would be fine, but the contents seem to respawn periodically, so you get an infinite source of free income, and that's basically cheating. Does anyone have any idea how to change this? Surely there's some sort of script responsible?

The chest model is called 'spr_player_chest'. I tried searching for it in the Diplomacy 4.3 module system, and all I got was one line in the scene_props file.

Chests are actually just troops and accessing them accesses the troops inventory, so one way to fix this would be to look for the troop the chest is tied to, then search for that troop inside a script like refresh_center_inventories or similar and comment it out.
 
SupaNinjaMan said:
Chests are actually just troops and accessing them accesses the troops inventory, so one way to fix this would be to look for the troop the chest is tied to, then search for that troop inside a script like refresh_center_inventories or similar and comment it out.

Thank you for your help!

Unfortunately, I can't find any references to chests in that script:
Code:
("refresh_center_inventories",
  [
  (set_merchandise_modifier_quality,150),
  (reset_item_probabilities,100),

  # Add trade goods to merchant inventories
  (try_for_range,":cur_center",towns_begin,towns_end),
    (party_get_slot,":cur_merchant",":cur_center",slot_town_merchant),
    (reset_item_probabilities,100),
      (assign, ":total_production", 0),
    (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
        (call_script, "script_center_get_production", ":cur_center", ":cur_goods"),
		(assign, ":cur_production", reg0),

        (try_for_range, ":cur_village", villages_begin, villages_end),
		  (party_slot_eq, ":cur_village", slot_village_bound_center, ":cur_center"),
          (call_script, "script_center_get_production", ":cur_village", ":cur_goods"),
		  (val_div, reg0, 3),
		  (val_add, ":cur_production", reg0),
		(try_end),

		(val_max, ":cur_production", 1),
		(val_mul, ":cur_production", 4),

		(val_add, ":total_production", ":cur_production"),
      (try_end),

	  (party_get_slot, ":town_prosperity", ":cur_center", slot_town_prosperity),
	  (assign, ":number_of_items_in_town", 25),

	  (try_begin), #1.0x - 2.0x (50 - 100 prosperity)
	    (ge, ":town_prosperity", 50),
		(store_sub, ":ratio", ":town_prosperity", 50),
		(val_mul, ":ratio", 2),
		(val_add, ":ratio", 100),
		(val_mul, ":number_of_items_in_town", ":ratio"),
		(val_div, ":number_of_items_in_town", 100),
	  (else_try), #0.5x - 1.0x (0 - 50 prosperity)
		(store_sub, ":ratio", ":town_prosperity", 50),
		(val_add, ":ratio", 100),
		(val_mul, ":number_of_items_in_town", ":ratio"),
		(val_div, ":number_of_items_in_town", 100),
	  (try_end),

	  (val_clamp, ":number_of_items_in_town", 10, 40),

	  (try_begin),
	    (is_between, ":cur_center", castles_begin, castles_end),
	    (val_div, ":number_of_items_in_town", 2),
      (try_end),

      (try_for_range, ":cur_goods", trade_goods_begin, trade_goods_end),
	  (call_script, "script_center_get_production", ":cur_center", ":cur_goods"),
		(assign, ":cur_production", reg0),

        (try_for_range, ":cur_village", villages_begin, villages_end),
		  (party_slot_eq, ":cur_village", slot_village_bound_center, ":cur_center"),
          (call_script, "script_center_get_production", ":cur_village", ":cur_goods"),
		  (val_div, reg0, 3),
		  (val_add, ":cur_production", reg0),
		(try_end),

		(val_max, ":cur_production", 1),
		(val_mul, ":cur_production", 4),

        (val_mul, ":cur_production", ":number_of_items_in_town"),
		(val_mul, ":cur_production", 100),
		(val_div, ":cur_production", ":total_production"),
        (set_item_probability_in_merchandise, ":cur_goods", ":cur_production"),
    (try_end),

	  (troop_clear_inventory, ":cur_merchant"),
      (troop_add_merchandise, ":cur_merchant", itp_type_goods, ":number_of_items_in_town"),

      (troop_ensure_inventory_space, ":cur_merchant", 20),
    (troop_sort_inventory, ":cur_merchant"),
    (store_troop_gold, ":cur_gold",":cur_merchant"),
    ##diplomacy start+
	#Option: scaling gold additions by the prosperity of the town.
	(try_begin),
		(ge, "$g_dplmc_gold_changes", DPLMC_GOLD_CHANGES_LOW),#this must be explicitly enabled
	    (party_get_slot, ":prosperity_75", ":cur_center", slot_town_prosperity),
		(val_add, ":prosperity_75", 75),
		(store_mul, ":target_gold", ":prosperity_75", 1500),
		(val_add, ":target_gold", 62),
		(val_div, ":target_gold", 125),#average 1500
		(lt, ":cur_gold", ":target_gold"),
		(store_random_in_range,":new_gold",500,1000),
		(val_mul, ":new_gold", ":prosperity_75"),
		(val_add, ":new_gold", 62),
		(val_div, ":new_gold", 125),
		(call_script, "script_troop_add_gold", ":cur_merchant", ":new_gold"),
	(else_try),
		(lt, "$g_dplmc_gold_changes", DPLMC_GOLD_CHANGES_LOW),
	    #fall through to default behavior
	    ##diplomacy end+
    (lt,":cur_gold",1500),
    (store_random_in_range,":new_gold",500,1000),
    (call_script, "script_troop_add_gold", ":cur_merchant", ":new_gold"),
    ##diplomacy start+
    (try_end),
	##diplomacy end+
  (try_end),
  ]),

I also only found four or five troops with "chest" in their names, and none of them look like they are what I'm looking for:

Code:
# Chests
  ["zendar_chest","{!}Zendar Chest","{!}Zendar Chest",tf_hero|tf_inactive, 0,reserved,  fac_neutral,
   [],def_attrib|level(18),wp(60),knows_common, 0],
  ["tutorial_chest_1","{!}Melee Weapons Chest","{!}Melee Weapons Chest",tf_hero|tf_inactive, 0,reserved,  fac_neutral,[itm_tutorial_sword, itm_tutorial_axe, itm_tutorial_spear, itm_tutorial_club, itm_tutorial_battle_axe],def_attrib|level(18),wp(60),knows_common, 0],
  ["tutorial_chest_2","{!}Ranged Weapons Chest","{!}Ranged Weapons Chest",tf_hero|tf_inactive, 0,reserved,  fac_neutral,[itm_tutorial_short_bow, itm_tutorial_arrows, itm_tutorial_crossbow, itm_tutorial_bolts, itm_tutorial_throwing_daggers],def_attrib|level(18),wp(60),knows_common, 0],
  ["bonus_chest_1","{!}Bonus Chest","{!}Bonus Chest",tf_hero|tf_inactive, 0,reserved,  fac_neutral,[itm_strange_armor,itm_strange_short_sword],def_attrib|level(18),wp(60),knows_common, 0],
  ["bonus_chest_2","{!}Bonus Chest","{!}Bonus Chest",tf_hero|tf_inactive, 0,reserved,  fac_neutral,[itm_strange_boots,itm_strange_sword],def_attrib|level(18),wp(60),knows_common, 0],
  ["bonus_chest_3","{!}Bonus Chest","{!}Bonus Chest",tf_hero|tf_inactive, 0,reserved,  fac_neutral,[itm_strange_helmet,itm_strange_great_sword],def_attrib|level(18),wp(60),knows_common, 0],

  ["household_possessions","{!}household_possessions","{!}household_possessions",tf_hero|tf_inactive|tf_is_merchant, 0,reserved,  fac_neutral,[],def_attrib|level(18),wp(60),knows_inventory_management_10, 0], 

Though that last one has an attribute "tf_is_merchant" so theoretically it's probably included in the refresh_center_inventories script because that script I think goes through an array of merchants. But judging by the modsys files, this "household_possessions" chest is actually what you access through the dialogue in the Diplomacy chamberlain NPC menu and not that other chest that you just freely access by physically walking up to it.
 
Status
Not open for further replies.
Back
Top Bottom