Modding Q&A [For Quick Questions and Answers]

正在查看此主题的用户

状态
不接受进一步回复。
Why was it removed, that's just stupid. I want to tinker with ma particle systems without having to restart every single time I change something...

And how do you mean you can load it from the menus?

Oh! Allright, I got it! You go to View - Restore module data!
 
Lucke189 说:
Why was it removed, that's just stupid. I want to tinker with ma particle systems without having to restart every single time I change something...
They believed accidental presses of CTRL-M messed up peoples games...particularly the devs thought it was tied to the bug where food morale was reset to +0 for all items.

Lucke189 说:
And how do you mean you can load it from the menus?
In Windowed mode, there are menus across the top of the screen. I forget which one, but one has the option to reload the mod system.
 
resetmodule.png


New module system released btw - Warband 1.142 Module System
 
hey guys, I'm having a problem with simple triggers:

插入代码块:
  (24,#native 1.142 code
   []),#native 1.142 code
#my code starts here
	(1,[
		(try_for_parties, ":party"),
			(store_current_hours, ":time"),
			(party_slot_eq, ":party", slot_party_tg_time, ":time"),
			(party_get_slot, ":action", ":party", slot_party_tg_action),
			(try_begin),
				(eq, ":action", tg_poison),
				(try_begin),
					(party_slot_eq,":party",slot_party_type, spt_town),
					(store_random_in_range, ":decrease", 5, 15),
					(str_store_party_name, s1, ":party"),
					(assign, reg1, ":decrease"),
					(val_mul, ":decrease", -1),
					(call_script, "script_change_center_prosperity", ":party", ":decrease"),
					(party_get_num_companions,":members",":party"),
					(store_random_in_range, ":wounded", 2, ":members"),
					(val_div, ":wounded", 2),
					(assign, reg2, ":wounded"),
					(party_get_num_companion_stacks,":num_stacks",":party"),
					(try_for_range, ":x", 0, ":wounded"),
						(store_random_in_range, ":stack", 0, ":num_stacks"),
						(party_stack_get_troop_id,":troop",":party",":stack"),
						(party_stack_get_size,":num_troops",":party",":stack"),
						(party_stack_get_num_wounded,":num_wounded",":party",":stack"),
						(gt, ":num_troops", ":num_wounded"),
						(party_wound_members,":party",":troop",1),
					(else_try),
						(party_remove_members_wounded_first,":party",":troop",1),
						(val_sub, reg2, 1),
						(val_add, reg3, 1),
					(try_end),
					(display_message, "@{s1} have lost {reg1} prosperity. {reg2?A man:{reg2} men} got wounded and {reg3?a man:{reg3} men} died. All this due to poisoned water."
				(else_try),
					(party_slot_eq,":party",slot_party_type, spt_castle),
					(store_random_in_range, ":decrease", 5, 15),
					(val_mul, ":decrease", -1),
					(call_script, "script_change_center_prosperity", ":party", ":decrease"),
					(party_get_num_companions,":members",":party"),
					(store_random_in_range, ":wounded", 2, ":members"),
					(val_div, ":wounded", 3),
					(val_mul, ":wounded", 2),
					(party_get_num_companion_stacks,":num_stacks",":party"),
					(try_for_range, ":x", 0, ":wounded"),
						(store_random_in_range, ":stack", 0, ":num_stacks"),
						(party_stack_get_troop_id,":troop",":party",":stack"),
						(party_stack_get_size,":num_troops",":party",":stack"),
						(party_stack_get_num_wounded,":num_wounded",":party",":stack"),
						(gt, ":num_troops", ":num_wounded"),
						(party_wound_members,":party",":troop",1),
					(else_try),
						(party_remove_members_wounded_first,":party",":troop",1),
					(try_end),
					(display_message, "@{s1} have lost {reg1} prosperity. {reg2?A man:{reg2} men} got wounded and {reg3?a man:{reg3} men} died. All this due to poisoned water."
				(else_try),
					(party_slot_eq,":party",slot_party_type, spt_village),
					(store_random_in_range, ":decrease", 5, 15),
					(val_mul, ":decrease", -1),
					(call_script, "script_change_center_prosperity", ":party", ":decrease"),
					(display_message, "@{s1} have lost {reg1} prosperity due to poisoned water."
				(else_try),
					(party_slot_eq,":party",slot_party_type, spt_kingdom_hero_party),
					(party_get_num_companions,":members",":party"),
					(store_random_in_range, ":wounded", 2, ":members"),
					(val_div, ":wounded", 5),
					(val_mul, ":wounded", 4),
					(party_get_num_companion_stacks,":num_stacks",":party"),
					(try_for_range, ":x", 0, ":wounded"),
						(store_random_in_range, ":stack", 0, ":num_stacks"),
						(party_stack_get_troop_id,":troop",":party",":stack"),
						(party_stack_get_size,":num_troops",":party",":stack"),
						(party_stack_get_num_wounded,":num_wounded",":party",":stack"),
						(gt, ":num_troops", ":num_wounded"),
						(party_wound_members,":party",":troop",1),
					(else_try),
						(party_remove_members_wounded_first,":party",":troop",1),
					(try_end),
					(display_message, "@{s1}: {reg2?A man:{reg2} men} got wounded and {reg3?a man:{reg3} men} died. All this due to poisoned water."
				(else_try),
					(party_slot_eq,":party",slot_party_type, spt_kingdom_caravan),
					(party_get_num_companions,":members",":party"),
					(store_random_in_range, ":wounded", 2, ":members"),
					(val_div, ":wounded", 3),
					(val_mul, ":wounded", 2),
					(party_get_num_companion_stacks,":num_stacks",":party"),
					(try_for_range, ":x", 0, ":wounded"),
						(store_random_in_range, ":stack", 0, ":num_stacks"),
						(party_stack_get_troop_id,":troop",":party",":stack"),
						(party_stack_get_size,":num_troops",":party",":stack"),
						(party_stack_get_num_wounded,":num_wounded",":party",":stack"),
						(gt, ":num_troops", ":num_wounded"),
						(party_wound_members,":party",":troop",1),
					(else_try),
						(party_remove_members_wounded_first,":party",":troop",1),
					(try_end),
					(display_message, "@{s1}: {reg2?A man:{reg2} men} got wounded and {reg3?a man:{reg3} men} died. All this due to poisoned water."
				(try_end),
			(else_try),
				(eq, ":action", tg_burn),
				(party_slot_eq,":party",slot_party_type, spt_village),
				(call_script, "script_calculate_amount_of_cattle_can_be_stolen", ":party"),
				(assign, ":max_cattle", reg0),
				(val_mul, ":max_cattle", 3),
				(val_div, ":max_cattle", 2),
				(party_get_slot, ":num_cattle", ":party", slot_village_number_of_cattle),
				(val_min, ":max_cattle", ":num_cattle"),
				(val_add, ":max_cattle", 1),
				(store_random_in_range, ":random_value", 0, ":max_cattle"),
				(try_begin),
					(gt, ":random_value", 0),
					(call_script, "script_create_cattle_herd", ":party", ":random_value"),
					(val_sub, ":num_cattle", ":random_value"),
					(party_set_slot, ":party", slot_village_number_of_cattle, ":num_cattle"),
				(try_end),
				(call_script, "script_village_set_state",  ":party", svs_looted),
				(party_set_slot, ":party", slot_center_accumulated_rents, 0),
				(party_set_slot, ":party", slot_center_accumulated_tariffs, 0),
				(party_set_slot, ":party", slot_village_raid_progress, 0),
				(party_set_slot, ":party", slot_village_recover_progress, 0),
			(else_try),
				(eq, ":action", tg_loot),
				(party_slot_eq,":party",slot_party_type, spt_village),
				(troop_clear_inventory, "trp_temp_troop"),
				(reset_item_probabilities),
				(troop_add_merchandise,"trp_temp_troop",itp_type_goods,15),
				(troop_sort_inventory, "trp_temp_troop"),
				(change_screen_loot, "trp_temp_troop"),
				(call_script, "script_village_set_state", ":party", svs_looted),
				(party_set_slot, ":party", slot_center_accumulated_rents, 0),
				(party_set_slot, ":party", slot_center_accumulated_tariffs, 0),
				(party_set_slot, ":party", slot_village_raid_progress, 0),
				(party_set_slot, ":party", slot_village_recover_progress, 0),
			(try_end),
		(try_end),
	]),#line 4139
]#last line of the file

I get this error:
插入代码块:
Initializing...
Traceback (most recent call last):
  File "process_global_variables.py", line 7, in <module>
    from module_simple_triggers import *
  File "C:\Users\Cristiano\Desktop\Moun&Blade\WB_1.142_Retrospect\Module_system
1.142\module_simple_triggers.py", line 4144
    ]),
    ^
SyntaxError: invalid syntax
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...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
Exporting mission_template data...
Exporting game menus data...
Traceback (most recent call last):
  File "process_simple_triggers.py", line 2, in <module>
    from module_simple_triggers import *
  File "C:\Users\Cristiano\Desktop\Moun&Blade\WB_1.142_Retrospect\Module_system
1.142\module_simple_triggers.py", line 4144
    ]),
    ^
SyntaxError: invalid syntax
exporting triggers...
exporting dialogs...
Checking global variable usages...
Exporting postfx_params...

______________________________

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



what is the troop dna?
 
Slots are just readable index values - so just don't define slots with the same index as ones that are in use for the same type of objects.
 
Somebody 说:
Slots are just readable index values - so just don't define slots with the same index as ones that are in use for the same type of objects.

Thanks for this.

Second question:

Anyone know which "slot" is used to store the 'Total Cost' element within the multiplayer selection GUI?
 
There is none - script_multiplayer_calculate_cur_selected_items_cost gets called every time, and a text overlay is created in g_presentation_obj_item_select_12.
 
Somebody 说:
There is none - script_multiplayer_calculate_cur_selected_items_cost gets called every time, and a text overlay is created in g_presentation_obj_item_select_12.

I've rewritten the process and I am simply trying to insert into reg0 from a different location.  I've tried defining a new player slot but this doesn't seem to work.  Any suggestions?
 
Why can't you just write your own script and call that instead of script_multiplayer_calculate_cur_selected_items_cost?
 
Somebody 说:
Why can't you just write your own script and call that instead of script_multiplayer_calculate_cur_selected_items_cost?

That's what I have done and it seems to work :smile:  Thanks
 
What could be the problem with moving scene props and their collision staying at the normal place? sokf_moveable is added an it just does it server side (the moving), otherwise there would be crashes or not? At least that is what was told me.
 
is there a way to know how much time a party will take to get to another party?

what is the troop dna?
 
状态
不接受进一步回复。
后退
顶部 底部