Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Ramaraunt said:
Question: how would I make it so the player receives better prices for being in a merchant's guild? Through an item that increases trade skill perhaps? How would I make it so the player can't sell this item, and that it can't be looted when taken prisoner?

that is more than one question  :mrgreen:

you can use the script that handle prices to give a discount/penalty when buying stuff, or the skill buff (which is less useful if you have high skill).
you can control the loot with the after battle menus chain
 
HyperCharge said:
Adorno said:
0 = besiegers/attackers, incl. player if he's besieging.
3 = defenders sally out
10 = defending point (where defenders sally. To be placed by ladders/siege tower)
11 = majority of defenders spawn, incl. the player if he's defending.
40-46 = defenders

Archers and infantry both spawn on 40-46. But these are the ones you want to place where archers are supposed to be. In towers and such.
Infantry will go to entry point 10, but the archers should stay put.

(Entry point 50-56 is for the siege tower)

Is it possible to make defending points more than one ? For enemy reinforcement's to find a new front, new places to be defended until lords hall. :smile:

If anyone interest, I found that it is possible. Find this in mission_templates;

Code:
common_siege_ai_trigger_init_2 = (
  0, 0, ti_once,
  [
    (set_show_messages, 0),
    (entry_point_get_position, pos10, 10),
    (try_for_range, ":cur_group", 0, grc_everyone),
      (neq, ":cur_group", grc_archers),
      (team_give_order, "$defender_team", ":cur_group", mordr_hold),
      (team_give_order, "$defender_team", ":cur_group", mordr_stand_closer),
      (team_give_order, "$defender_team", ":cur_group", mordr_stand_closer),
      (team_give_order, "$defender_team_2", ":cur_group", mordr_hold),
      (team_give_order, "$defender_team_2", ":cur_group", mordr_stand_closer),
      (team_give_order, "$defender_team_2", ":cur_group", mordr_stand_closer),
    (try_end),
    (team_give_order, "$defender_team", grc_archers, mordr_stand_ground),
    (team_set_order_position, "$defender_team", grc_everyone, pos10),
    (team_give_order, "$defender_team_2", grc_archers, mordr_stand_ground),
    (team_set_order_position, "$defender_team_2", grc_everyone, pos10),
    (set_show_messages, 1),
    ], [])

add new script;

Code:
("new_defence_point",
  [
(set_show_messages, 0),

    (try_for_range, ":cur_group", 0, grc_everyone),
      (neq, ":cur_group", grc_archers),
      (team_give_order, "$defender_team", ":cur_group", mordr_hold),
      (team_give_order, "$defender_team", ":cur_group", mordr_stand_closer),
      (team_give_order, "$defender_team", ":cur_group", mordr_stand_closer),
      (team_give_order, "$defender_team_2", ":cur_group", mordr_hold),
      (team_give_order, "$defender_team_2", ":cur_group", mordr_stand_closer),
      (team_give_order, "$defender_team_2", ":cur_group", mordr_stand_closer),
    (try_end),
    
(try_begin), #there are 3 defend points in this code. You may increase it.
   (eq, "$defence_point_down", 0), # if first one is not down ADD THIS TO START OF MISSION!!!
    (entry_point_get_position, pos11, 50),#new entry point!
(team_give_order, "$defender_team", grc_archers, mordr_stand_ground),
(team_set_order_position, "$defender_team", grc_everyone, pos11),
(team_give_order, "$defender_team_2", grc_archers, mordr_stand_ground),
    (team_set_order_position, "$defender_team_2", grc_everyone, pos11),
(else_try),
(eq, "$defence_point_down", 1), 
    (entry_point_get_position, pos12, 51),#new entry point!
(team_give_order, "$defender_team", grc_archers, mordr_stand_ground),
(team_set_order_position, "$defender_team", grc_everyone, pos12),
(team_give_order, "$defender_team_2", grc_archers, mordr_stand_ground),
    (team_set_order_position, "$defender_team_2", grc_everyone, pos12),
(else_try),
(eq, "$defence_point_down", 2), 
    (entry_point_get_position, pos13, 52),#new entry point!
(team_give_order, "$defender_team", grc_archers, mordr_stand_ground),
(team_set_order_position, "$defender_team", grc_everyone, pos13),
(team_give_order, "$defender_team_2", grc_archers, mordr_stand_ground),
    (team_set_order_position, "$defender_team_2", grc_everyone, pos13),
(try_end),
    (set_show_messages, 1),
  ]),

add new entry points;

Code:
(50,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,0,[]),
(51,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,0,[]),
(52,mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,0,[]),

then find this and change it like this in mission templates;

common_siege_defender_reinforcement_check = (
  3, 0, 5, [],
  [(lt, "$defender_reinforcement_stage", 7),
    (store_mission_timer_a,":mission_time"),
    (ge,":mission_time",10),
    (store_normalized_team_count,":num_defenders",0),
    (lt,":num_defenders",:cool:,
    (add_reinforcements_to_entry,4, 7),
  (call_script, "script_new_defence_point"), #fired this before adding value to "$defend_point_down"
    (val_add,"$defender_reinforcement_stage",1),
    (val_add, "$defence_point_down", 1),#Defend point is down!
    (try_begin),
      (gt, ":mission_time", 300), #5 minutes, don't let small armies charge
      (get_player_agent_no, ":player_agent"),
      (agent_get_team, ":player_team", ":player_agent"),
      (neq, ":player_team", "$defender_team"), #player should be the attacker
      (neq, ":player_team", "$defender_team_2"), #player should be the attacker
      (ge, "$defender_reinforcement_stage", 2),
      (set_show_messages, 0),
      (team_give_order, "$defender_team", grc_infantry, mordr_charge), #AI desperate charge:infantry!!!
      (team_give_order, "$defender_team_2", grc_infantry, mordr_charge), #AI desperate charge:infantry!!!
      (team_give_order, "$defender_team", grc_cavalry, mordr_charge), #AI desperate charge:cavalry!!!
      (team_give_order, "$defender_team_2", grc_cavalry, mordr_charge), #AI desperate charge:cavalry!!!
      (set_show_messages, 1),
      (ge, "$defender_reinforcement_stage", 4),
      (set_show_messages, 0),
      (team_give_order, "$defender_team", grc_everyone, mordr_charge), #AI desperate charge: everyone!!!
      (team_give_order, "$defender_team_2", grc_everyone, mordr_charge), #AI desperate charge: everyone!!!
      (set_show_messages, 1),
    (try_end),
])

add this to common_siege_init in mission_templates;

Code:
(assign, "$defence_point_down" ,0),

There should be no error afaik.

This is useful for bigger scenes. You can change this if you make a modern mod so people can make guerilla :smile: I will open a new thread for this. :razz:
 
(0.1, 0, 0, [(try_for_parties, ":party", active_npcs_begin, active_npcs_end),
            (party_get_current_terrain, ":terrain", ":party"),
            (eq, ":terrain", rt_desert),
            (store_faction_of_party, ":fac", ":party"),
            (eq, ":fac", "fac_kingdom_2"),
            (party_get_slot, ":slot", slot_lord_is_on_desert, ":party"),
            (neq, ":slot", 1),
            (try_end),
            ], [
            (try_for_parties, ":parti", active_npcs_begin, active_npcs_end),
            (party_set_slot, ":parti", slot_lord_is_on_desert, 1),
            (store_current_hours, ":hours"),
            (val_add, ":hours", 4:cool:,
            (party_set_slot, ":parti", slot_time_of_run_lord, ":hours"),
            (try_end),
            ]),

            (0.1, 0, 0, [(try_for_parties, ":party", active_npcs_begin, active_npcs_end),
                        (party_get_current_terrain, ":terrain", ":party"),
                        (store_current_hours, ":hours"),
                        (party_slot_ge, ":party", slot_time_of_run_lord, ":hours"),
                        (party_get_slot, ":slot_no", slot_lord_traveling_to_town_desert, ":party"),
                        (neq, ":slot_no", 1),
                        (try_end),
                        ], [
                        (try_for_parties, ":party3", active_npcs_begin, active_npcs_end),
                        (store_random_in_range, ":town", "p_town_1", "p_castle_1"),
                        (store_faction_of_party, ":fac", ":town"),
                        (store_faction_of_party, ":fac2", ":party3"),
                        (eq, ":fac", ":fac2"),
                        (party_set_ai_behavior, ":party3", ai_bhvr_travel_to_party),
                        (party_set_ai_object, ":party3", ":town"),
                        (party_set_slot, ":party3", slot_lord_traveling_to_town_desert, 1),
                        (try_end),
                        ]),
Ms is giving invalid party id error. Where is the problem?
 

use the code tag

Code:
[(try_for_parties, ":party", active_npcs_begin, active_npcs_end),

npcs are not a party, they are a troop

get Lav's module version to see better documentation. For that operation, as a example
Code:
try_for_parties         =   11  # (try_for_parties, <destination>),
                                # Runs a cycle, iterating all parties on the map.
you can see how you are not using it properly
 
Are there some preconditions required for using agent_start_running_away?

I tried to use this on an agent, and instead of running away, he dismounted then attacked.  Bizarre.
 
Some weird stuff going on in my mod. I seemed to have missed something in game_start that sets up family relationships, because none of the females in my new kingdoms have any family.

This is my initialize aristocracy script:
Code:
	("initialize_aristocracy",
	[
	  #LORD OCCUPATIONS, BLOOD RELATIONSHIPS, RENOWN AND REPUTATIONS

	  #King ages
	  (try_for_range, ":cur_troop", kings_begin, kings_end),
		(troop_set_slot, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
		(store_random_in_range, ":age", 50, 60),
		(troop_set_slot, ":cur_troop", slot_troop_age, ":age"),
		##diplomacy start+
		#(eq, ":cur_troop", "trp_kingdom_5_lord"),#<-- There was no reason for this to be in the loop, so moved it out.
		#(troop_set_slot, ":cur_troop", slot_troop_age, 47),
	  (try_end),
	  (troop_set_slot, "trp_kingdom_5_lord", slot_troop_age, 47),#<-- Moved from above
	  ##diplomacy end+

	  #The first thing - family structure
	  #lords 1 to 8 are patriarchs with one live-at-home son and one daughter. They come from one of six possible ancestors, thus making it likely that there will be two sets of siblings
	  #lords 9 to 12 are unmarried landowners with sisters
	  #lords 13 to 20 are sons who still live in their fathers' houses
	  #For the sake of simplicity, we can assume that all male aristocrats in prior generations either married commoners or procured their brides from the Old Country, thus discounting intermarriage

	  (try_for_range, ":cur_troop", kingdom_ladies_begin, kingdom_ladies_end),
		(troop_set_slot, ":cur_troop", slot_troop_occupation, slto_kingdom_lady),
	  (try_end),

	  (assign, ":cur_lady", "trp_kingdom_1_lady_1"),

	  (try_for_range, ":cur_troop", lords_begin, lords_end),
		(troop_set_slot, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),

		(store_random_in_range, ":father_age_at_birth", 23, 26),
#		(store_random_in_range, ":mother_age_at_birth", 19, 22),

		(try_begin),
			(is_between, ":cur_troop", "trp_knight_1_1", "trp_knight_2_1"),
			(store_sub, ":npc_seed", ":cur_troop", "trp_knight_1_1"),
			(assign, ":ancestor_seed", 1),

		(else_try),
			(is_between, ":cur_troop", "trp_knight_2_1", "trp_knight_3_1"),
			(store_sub, ":npc_seed", ":cur_troop", "trp_knight_2_1"),
			(assign, ":ancestor_seed", 7),

		(else_try),
			(is_between, ":cur_troop", "trp_knight_3_1", "trp_knight_4_1"),
			(store_sub, ":npc_seed", ":cur_troop", "trp_knight_3_1"),
			(assign, ":ancestor_seed", 13),

		(else_try),
			(is_between, ":cur_troop", "trp_knight_4_1", "trp_knight_5_1"),
			(store_sub, ":npc_seed", ":cur_troop", "trp_knight_4_1"),
			(assign, ":ancestor_seed", 19),

		(else_try),
			(is_between, ":cur_troop", "trp_knight_5_1", "trp_knight_6_1"),
			(store_sub, ":npc_seed", ":cur_troop", "trp_knight_5_1"),
			(assign, ":ancestor_seed", 25),

		(else_try),
			(is_between, ":cur_troop", "trp_knight_6_1", "trp_kingdom_1_pretender"),
			(store_sub, ":npc_seed", ":cur_troop", "trp_knight_6_1"),
			(assign, ":ancestor_seed", 31),

		(else_try),
			(is_between, ":cur_troop", "trp_knight_7_1", "trp_knight_8_1"),
			(store_sub, ":npc_seed", ":cur_troop", "trp_knight_7_1"),
			(assign, ":ancestor_seed", 37),
			
		(else_try),
			(is_between, ":cur_troop", "trp_knight_8_1", "trp_knight_9_1"),
			(store_sub, ":npc_seed", ":cur_troop", "trp_knight_8_1"),
			(assign, ":ancestor_seed", 43),
			
		(else_try),
			(is_between, ":cur_troop", "trp_knight_9_1", "trp_knight_10_1"),
			(store_sub, ":npc_seed", ":cur_troop", "trp_knight_9_1"),
			(assign, ":ancestor_seed", 49),
			
	    (else_try),
			(is_between, ":cur_troop", "trp_knight_10_1", "trp_knight_11_1"),
			(store_sub, ":npc_seed", ":cur_troop", "trp_knight_10_1"),
			(assign, ":ancestor_seed", 55),
			
	    (else_try),
			(is_between, ":cur_troop", "trp_knight_11_1", "trp_kingdom_1_pretender"),
			(store_sub, ":npc_seed", ":cur_troop", "trp_knight_11_1"),
			(assign, ":ancestor_seed", 61),
		(try_end),


		(try_begin),
			(lt, ":npc_seed", 8), #NPC seed is the order in the faction
			##diplomacy start+ do not overwrite reputation if it was already set explicitly
			(troop_get_slot, ":reputation", ":cur_troop", slot_lord_reputation_type),
			(try_begin),
				(lt, ":reputation", 1),
				#Original behavior:
				(assign, ":reputation", ":npc_seed"),
			(try_end),
			##diplomacy end+
			(store_random_in_range, ":age", 45, 64),

			##diplomacy start+ only set father if not already set
			(try_begin),#<- dplmc+ added
				(troop_slot_eq, ":cur_troop", slot_troop_father, -1),#<- dplmc+ added
				(store_random_in_range, ":father", 0, 6), #six possible fathers
				(val_add, ":father", ":ancestor_seed"),
				(troop_set_slot, ":cur_troop", slot_troop_father, ":father"),
			(try_end),#<- dplmc+ added
			##diplomacy end+

			#wife
			##diplomacy start+ do not rebind an already-set wife
			(try_begin),
				(troop_slot_eq, ":cur_troop", slot_troop_spouse, -1),
				#There may be a better solution, but to avoid oddities disable automatic spouses if there is a gender mismatch.
				#Mods that add additional races may want to tweak this (for example if some races shouldn't intermarry).
				(call_script, "script_dplmc_store_is_female_troop_1_troop_2", ":cur_troop", ":cur_lady"),
				#Types are stored to reg0 and reg1.
				(neq, reg0, reg1),#lord and lady aren't both female or both non-female
				(val_mul, reg0, reg1),
				(eq, reg0, 0),#at least one of lord or lady is non-female
			##diplomacy end+
				(troop_set_slot, ":cur_troop", slot_troop_spouse, ":cur_lady"),
				(troop_set_slot, ":cur_lady", slot_troop_spouse, ":cur_troop"),
				(store_random_in_range, ":wife_reputation", 20, 26),
				(try_begin),
					(eq, ":wife_reputation", 20),
					(assign, ":wife_reputation", lrep_conventional),
				(try_end),
				(troop_set_slot, ":cur_lady", slot_lord_reputation_type, ":wife_reputation"),


				(call_script, "script_init_troop_age", ":cur_lady", 49),
				(call_script, "script_add_lady_items", ":cur_lady"),

				(val_add, ":cur_lady", 1),
			##diplomacy start+
			(try_end),
			##diplomacy end+

			#daughter
			##diplomacy start+
			(try_begin),
			##diplomacy end+
				(troop_set_slot, ":cur_lady", slot_troop_father, ":cur_troop"),
				(store_sub, ":mother", ":cur_lady", 1),
				(call_script, "script_init_troop_age", ":cur_lady", 19),
			##diplomacy start+
				#fix native bug (daughters are their own mothers)
				#(troop_set_slot, ":cur_lady", slot_troop_mother, ":cur_lady"),
				(troop_set_slot, ":cur_lady", slot_troop_mother, ":mother"),
				(try_begin),
					#swap father and mother slots if the lord was female (do nothing if both were female)
					(call_script, "script_dplmc_store_is_female_troop_1_troop_2", ":cur_troop", ":mother"),
					(neq, reg0, 0),#:cur_troop is female
					(eq, reg1, 0),#:mother is not female
					(troop_set_slot, ":cur_lady", slot_troop_mother, ":cur_troop"),
					(troop_set_slot, ":cur_lady", slot_troop_father, ":mother"),
				(try_end),
			##diplomacy end+
				(store_random_in_range, ":lady_reputation", lrep_conventional, 34), #33% chance of father-derived
				(try_begin),
					(le, ":lady_reputation", 25),
					(troop_set_slot, ":cur_lady", slot_lord_reputation_type, ":lady_reputation"),
				(else_try),
					(eq, ":lady_reputation", 26),
					(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_conventional),
				(else_try),
					(eq, ":lady_reputation", 27),
					(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_moralist),
				(else_try),
					(assign, ":guardian_reputation", ":reputation"),
					(try_begin),
						(this_or_next|eq, ":guardian_reputation", lrep_martial),
							(eq, ":guardian_reputation", 0),
						(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_conventional),
					(else_try),
						(eq, ":guardian_reputation", lrep_quarrelsome),
						(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_otherworldly),
					(else_try),
						(eq, ":guardian_reputation", lrep_selfrighteous),
						(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_ambitious),
					(else_try),
						(eq, ":guardian_reputation", lrep_cunning),
						(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_adventurous),
					(else_try),
						(eq, ":guardian_reputation", lrep_goodnatured),
						(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_adventurous),
					(else_try),
						(eq, ":guardian_reputation", lrep_debauched),
						(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_ambitious),
					(else_try),
						(eq, ":guardian_reputation", lrep_upstanding),
						(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_moralist),
					(try_end),
				(try_end),

				(call_script, "script_add_lady_items", ":cur_lady"),
				(val_add, ":cur_lady", 1),
			##diplomacy start+
			(try_end),
			##diplomacy end+
			#high renown

		(else_try),	#Older unmarried lords
			(is_between, ":npc_seed", 8, 12),

			(store_random_in_range, ":age", 25, 36),
			##diplomacy start+ do not overwrite reputation if it was already set explicitly
			(troop_get_slot, ":reputation", ":cur_troop", slot_lord_reputation_type),
			(try_begin),
				(lt, ":reputation", 1),
				#Original behavior:
				(store_random_in_range, ":reputation", 0, 8),
			(try_end),
			##diplomacy end+

			(store_random_in_range, ":sister_reputation", 20, 26),
			(try_begin),
				(eq, ":sister_reputation", 20),
				(assign, ":sister_reputation", lrep_conventional),
			(try_end),
			(troop_set_slot, ":cur_lady", slot_lord_reputation_type, ":sister_reputation"),

			(troop_set_slot, ":cur_lady", slot_troop_guardian, ":cur_troop"),
			##diplomacy start+
			#Initialize parents
			(try_begin),
				(troop_slot_eq, ":cur_troop", slot_troop_father, -1),
				(store_mul, ":new_index", ":cur_troop", DPLMC_VIRTUAL_RELATIVE_MULTIPLIER),#defined in module_constants.py
				(val_add, ":new_index", DPLMC_VIRTUAL_RELATIVE_FATHER_OFFSET),#defined in module_constants.py
				(troop_set_slot, ":cur_troop", slot_troop_father, ":new_index"),
				(troop_slot_eq, ":cur_lady", slot_troop_father, -1),
				(troop_set_slot, ":cur_lady", slot_troop_father, ":new_index"),
			(try_end),
			(try_begin),
				(troop_slot_eq, ":cur_troop", slot_troop_mother, -1),
				(store_mul, ":new_index", ":cur_troop", DPLMC_VIRTUAL_RELATIVE_MULTIPLIER),#defined in module_constants.py
				(val_add, ":new_index", DPLMC_VIRTUAL_RELATIVE_MOTHER_OFFSET),#defined in module_constants.py
				(troop_set_slot, ":cur_troop", slot_troop_mother, ":new_index"),
				(troop_slot_eq, ":cur_lady", slot_troop_mother, -1),
				(troop_set_slot, ":cur_lady", slot_troop_mother, ":new_index"),
			(try_end),
			##diplomacy end+

			(call_script, "script_init_troop_age", ":cur_lady", 21),
			(call_script, "script_add_lady_items", ":cur_lady"),

			(val_add, ":cur_lady", 1),

		(else_try),	#Younger unmarried lords
			#age is father's minus 20 to 25
			(store_sub, ":father", ":cur_troop", 12),
			##diplomacy start+
			#Some submods don't pay attention to this aspect of the troop list, and
			#so initialization produces absurd or impossible results.  Prevent such
			#things from appearing in the game.
			(try_begin),
				#"father" can be father or mother
				#(troop_get_type, ":parent_type", ":father"),
				(try_begin),
					#(eq, ":parent_type", tf_female),
					(call_script, "script_cf_dplmc_troop_is_female", ":father"),
					(assign, ":parent_slot", slot_troop_mother),
					(assign, ":other_parent_slot", slot_troop_father),
				(else_try),
					(assign, ":parent_slot", slot_troop_father),
					(assign, ":other_parent_slot", slot_troop_mother),
				(try_end),

				(troop_slot_eq, ":cur_troop", ":parent_slot", -1),
				(store_add, ":logical_minimum_age", ":father_age_at_birth", 16),
				(troop_slot_ge, ":father", slot_troop_age, ":logical_minimum_age"),
				#Passed test
				(troop_set_slot, ":cur_troop", ":parent_slot", ":father"),
				#Set mother if not already specified
				(try_begin),
					(troop_slot_eq, ":cur_troop", ":other_parent_slot", -1),
					(troop_get_slot, ":mother", ":father", slot_troop_spouse),
					(troop_set_slot, ":cur_troop", ":other_parent_slot", ":mother"),
				(try_end),

				(troop_get_slot, ":father_age", ":father", slot_troop_age),
				(store_sub, ":age", ":father_age", ":father_age_at_birth"),

				(troop_get_slot, ":reputation", ":cur_troop", slot_lord_reputation_type),
				(try_begin),
					#Don't change reputation if it already has been set
					(lt, ":reputation", 1),
					#50% chance of having father's rep
					(store_random_in_range, ":reputation", 0, 16),

					(gt, ":reputation", 7),
					(troop_get_slot, ":reputation", ":father", slot_lord_reputation_type),
				(try_end),
			(else_try),
				#Average age is [45,63] minus [23,25], so [22, 38]
				(store_random_in_range, ":age", 22, 39),
				(troop_get_slot, ":reputation", ":cur_troop", slot_lord_reputation_type),
				#Don't change reputation if it already has been set
				(lt, ":reputation", 1),
				(store_random_in_range, ":reputation", 0, 8),
			(try_end),
			#diplomacy end+
		(try_end),

		(try_begin),
			(eq, ":reputation", 0),
			(assign, ":reputation", 1),
		(try_end),

        (troop_set_slot, ":cur_troop", slot_lord_reputation_type, ":reputation"),

		(call_script, "script_init_troop_age", ":cur_troop", ":age"),
	  (try_end),

	  (try_begin),
	    (eq, "$cheat_mode", 1),
	    (assign, reg3, "$cheat_mode"),
	    (display_message, "@{!}DEBUG -- Assigned lord reputation and relations"),

#	    (display_message, "str_assigned_lord_reputation_and_relations_cheat_mode_reg3"), #This string can be removed
	  (try_end),

	  (try_for_range, ":cur_troop", pretenders_begin, pretenders_end),
		(troop_set_slot, ":cur_troop", slot_troop_occupation, slto_inactive_pretender),
		(store_random_in_range, ":age", 25, 30),
		(troop_set_slot, ":cur_troop", slot_troop_age, ":age"),
		(eq, ":cur_troop", "trp_kingdom_5_pretender"),
		(troop_set_slot, ":cur_troop", slot_troop_age, 45),
	  (try_end),
	]),
 
Did you set up the number of lords/ladies correctly? It's offset based, so if you have different numbers you'll have to manually set it up.
Vershner said:
I tried to use this on an agent, and instead of running away, he dismounted then attacked.  Bizarre.
If you use agent_start_running_away on the horse agent it rears and the mounted agent falls off (intended behaviour), but it should work properly with mounted agents since cavalry in Native routs properly.
 
Somebody said:

Turns out it was this:

(else_try),
(is_between, ":cur_troop", "trp_knight_6_1", "trp_kingdom_1_pretender"),
(store_sub, ":npc_seed", ":cur_troop", "trp_knight_6_1"),
(assign, ":ancestor_seed", 31),

Thanks somebody!
 
hi guys,

(agent_set_division, <agent_id>, <value>),
What does this code do? Can I use this command for, regiment formations of my own 'battle tactic' scripts?

by the way, I want to appoint trp_blabla, in battle group; "grc_archers".
Can I use "assign" command for this?
(assign, "trp_BLABLA", grc_archers),
 
-MaveRick- said:
(agent_set_division, <agent_id>, <value>),
What does this code do?

get Lav's modsys for better documentation. A good OSP to see this at work is Formations, or check VC modsys.
Code:
agent_set_division                       = 1783  # (agent_set_division, <agent_id>, <value>),
                                                 # Puts the agent into the specified division. This does not affect agent's troop class. Note that there's a bug in Warband: if an order is issued to agent's original division, the agent will immediately switch back to it's original division number. Therefore, if you want to manipulate agent divisions dynamically during the battle, you need to implement some workarounds for this bug.



-MaveRick- said:
Can I use "assign" command for this?
(assign, "trp_BLABLA", grc_archers),
nope, as stated by the documentation that operations is used to change values of variables. A "trp_XXX" is not a variable.
 
I'm getting a weird RGL error "too many vertices (<insert huge number here>) in mesh "" (material: grass)".
 
Hello!

I just started modding and I have been trying to figure out how to find out the correct <slot_no> of multiplayer players' equipement.

E.g. we all have 4 inventory slots for melee/ranged items. How do I know what is the <slot_no> of a particular item (for example, the most top slot)?

Thanks in advance,
Carpra

Edit: I'm trying to change a particular slot's contents with a script. If it is even possible...
 
alkaiq said:
Hello!

I just started modding and I have been trying to figure out how to find out the correct <slot_no> of multiplayer players' equipement.

E.g. we all have 4 inventory slots for melee/ranged items. How do I know what is the <slot_no> of a particular item (for example, the most top slot)?

Thanks in advance,
Carpra

Edit: I'm trying to change a particular slot's contents with a script. If it is even possible...
Could just try using this(obviously before the players agent is spawned):

Code:
player_add_spawn_item                        =  410  # (player_add_spawn_item, <player_id>, <item_slot_no>, <item_id>),
                                                     #
with item_slot_no being one of these:
Code:
ek_item_0 = 0
ek_item_1 = 1
ek_item_2 = 2
ek_item_3 = 3
ek_head   = 4
ek_body   = 5
ek_foot   = 6
ek_gloves = 7
ek_horse  = 8
ek_food   = 9
 
Namakan said:
Code:
player_add_spawn_item                        =  410  # (player_add_spawn_item, <player_id>, <item_slot_no>, <item_id>),
                                                     #

Yeah, tried that but it doesn't change automatically, but does it during respawn cycle. :/
 
Somebody said:
Vershner said:
I tried to use this on an agent, and instead of running away, he dismounted then attacked.  Bizarre.
If you use agent_start_running_away on the horse agent it rears and the mounted agent falls off (intended behaviour), but it should work properly with mounted agents since cavalry in Native routs properly.
The horse doesn't rear. I'm iterating through the agents until I find one with the matching trp name, so I don't think it could be the horse.
I think this may be something specific to villages. If I raid a village then order my men to retreat, they show the same behaviour. Attacking instead of fleeing. Retreating only seems to work properly in the random battles.
This seems like a bug...
 
When Lords, Ladies, and the player character are inside a castle, their helmets/hats/etc. are unequipped; how do I disable this behavior so everyone keeps their helmets like the guards?
 
SatoriLotus said:
When Lords, Ladies, and the player character are inside a castle, their helmets/hats/etc. are unequipped; how do I disable this behavior so everyone keeps their helmets like the guards?

Any helmets or armour flagged as itp_civilian in module_items.py can be worn inside. A lot of mods flag all armours as itp_civilian to stop Lords without a secondary set of civilian clothes appearing naked indoors.
 
Status
Not open for further replies.
Back
Top Bottom