Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Could you guys tell me what this means?
Code:
     (1,mtef_defenders|mtef_team_0,0,aif_start_alarmed,12,[]),
     (0,mtef_defenders|mtef_team_0,0,aif_start_alarmed,0,[]),
     (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,12,[]),
     (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,0,[]),
 
Pilgrim said:
More noob questions!

1. How do I make renown greater factor in increasing your character's party size?
- Same with leadership
2. How do I make it so fiefs / villages are siegable no matter what (Doesn't require negative faction relation)
1-in module scrips this and
(troop_get_slot, ":troop_renown", ":party_leader", slot_troop_renown),
        (store_div, ":renown_bonus", ":troop_renown", 10),
        (val_add, ":limit", ":renown_bonus"),

this
("game_get_party_companion_limit",
    [
      (assign, ":troop_no", "trp_player"),

      (assign, ":limit", 30),
      (store_skill_level, ":skill", "skl_leadership", ":troop_no"),
      (store_attribute_level, ":charisma", ":troop_no", ca_charisma),
      (val_mul, ":skill", 15),
      (val_add, ":limit", ":skill"),
      (val_add, ":limit", ":charisma"),

      (troop_get_slot, ":troop_renown", ":troop_no", slot_troop_renown),
      (store_div, ":renown_bonus", ":troop_renown", 10),
      (val_add, ":limit", ":renown_bonus"),
 
I'm spawning friendly troops, but although they're on my same team, they show up as allies on the backspace menu. Why?
Here's the script:
Code:
  ("cf_spawn_gondorians",
   [(try_begin),
      # get player agent
      (get_player_agent_no,":player_agent"),

      #get player team
      (agent_get_team, ":player_team", ":player_agent"),

      #get player division
      (agent_get_division, ":player_division", ":player_agent"),

      # get position of entry point 0, where player spawns
      (entry_point_get_position, pos1, 0),

      # set spawn position to that up there
      (set_spawn_position, pos1),         

      #display message on screen
      (display_message, "@Reinforcements have arrived!"),

      #spawn agents 
      (try_for_range,":iterator",0,4),
        (spawn_agent,"trp_gondorian_infantry"),
        (agent_set_team,reg0,":player_team"),
        (agent_set_group, reg0, ":player_agent"),
        (agent_set_division,reg0,":player_division"),
        (agent_set_is_alarmed, reg0, 1),
      (try_end),
    (try_end),
  ]),
 
jacobhinds said:
They have to be part of p_main_party to be considered "us" rather than "allies". Look at script_update_order_panel_statistics_and_map to see how it works, and you'll be able to add an exception for that missionr template.
How about adding them to p_main_party right before spawning them?
They are not following my oders either, even as allies and being on my same team, group and division
 
You need to do a bunch of overrides in a couple of places - script_update_order_panel_statistics_and_map, script_agent_reassign_team, script_update_agent_position_on_map, script_shield_item_set_banner, and finally script_count_mission_casualties_from_agents for them to show up as "your" troop.
 
I see.
Before that I'll try the following:
- Add those troops to my party
- Use add_reinforcements instead of spawn_agent

add_reinforcements doesn't allow me to choose which troop I want, say an archer or a knight for example.

How about just having these allies follow my orders? Even if they're not in the "Us" category?
Or better yet, how can I set the agent to belong to p_main_party?
 
Hi,
I added this script look like:
("player_arrived",
  [
      (assign, ":player_faction_culture", "fac_culture_1"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_culture, ":player_faction_culture"),
      (faction_set_slot, "fac_player_faction",  slot_faction_culture, ":player_faction_culture"),
]),
("vaegir",
  [
      (assign, ":player_faction_culture", "fac_culture_2"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_culture, ":player_faction_culture"),
      (faction_set_slot, "fac_player_faction",  slot_faction_culture, ":player_faction_culture"),
]),
("kergit",
  [
      (assign, ":player_faction_culture", "fac_culture_3"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_culture, ":player_faction_culture"),
      (faction_set_slot, "fac_player_faction",  slot_faction_culture, ":player_faction_culture"),
]),
("nord",
  [
      (assign, ":player_faction_culture", "fac_culture_4"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_culture, ":player_faction_culture"),
      (faction_set_slot, "fac_player_faction",  slot_faction_culture, ":player_faction_culture"),
]),
("rodok",
  [
      (assign, ":player_faction_culture", "fac_culture_5"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_culture, ":player_faction_culture"),
      (faction_set_slot, "fac_player_faction",  slot_faction_culture, ":player_faction_culture"),
]),
("sarranid",
  [
      (assign, ":player_faction_culture", "fac_culture_6"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_culture, ":player_faction_culture"),
      (faction_set_slot, "fac_player_faction",  slot_faction_culture, ":player_faction_culture"),
]),
and uncomment this
("continue",[], "Continue...",
      [       
        (assign, "$g_starting_town", "$current_town"),
        (call_script, "script_player_arrived"),
        (party_set_morale, "p_main_party", 100),
        (set_encountered_party, "$current_town"),
        (call_script, "script_prepare_alley_to_fight"),
then add this menus:
("kultur1",0,
  "Select a cheat:",
  "none",
  [
    ],
    [
      ("svadya",[], "Choose Swadia culture...",
      [(call_script,"script_player_arrived"),
       
  ]
      ),
  ("vaegir",[], "Choose Vaegir culture...",
      [(call_script,"script_vaegir"),
       
  ]
      ),
  ("kergit",[], "Choose Khergit culture...",
      [(call_script,"script_kergit"),
       
  ]
      ),
  ("nord",[], "Choose Nord culture...",
      [(call_script,"script_nord"),
       
  ]
      ),
  ("rodok",[], "Choose Rhodok culture...",
      [(call_script,"script_rodok"),
       
  ]
      ),
  ("sarranid",[], "Choose Sarranid culture...",
      [(call_script,"script_sarranid"),
       
  ]
      ),
  ("geri",[], "Go back...",
      [
        (jump_to_menu, "mnu_camp_action"),
  ]
      ),
  ]
  ),
then When I choose a culture dosn't work, anyone know why?
 
Hi guys, can I ask a question? I want to change the tournaments so that all parties involved keep their equipment. Much like in 1257 mod, but not only for the lords, anyone participating. I have searched for OSP scripts and such, but couldn't find anything. Can you please help, tell me which script I need to edit? Thank you!
 
Antonis said:
Hi guys, can I ask a question? I want to change the tournaments so that all parties involved keep their equipment. Much like in 1257 mod, but not only for the lords, anyone participating. I have searched for OSP scripts and such, but couldn't find anything. Can you please help, tell me which script I need to edit? Thank you!

Mst arena_melee_fight has the entry points and the based gear for each,

and the script set_items_for_tournament does the override of gear:
Code:
mission_tpl_entry_clear_override_items       = 1941  # (mission_entry_clear_override_items, <mission_template_id>, <entry_no>),
                                                     # Clears the list of override equipment provided by the entry point definition in module_mission_templates.py.
that script removes the bots gear and uses a random chance to select what they should have

Code:
(store_script_param, ":horse_chance", 1),
                  (store_script_param, ":lance_chance", 2),
                  (store_script_param, ":sword_chance", 3),
                  (store_script_param, ":axe_chance", 4),
                  (store_script_param, ":bow_chance", 5),
                  (store_script_param, ":javelin_chance", 6),
                  (store_script_param, ":mounted_bow_chance", 7),
                  (store_script_param, ":crossbow_sword_chance", 8),
                  (store_script_param, ":armor_item_begin", 9),
                  (store_script_param, ":helm_item_begin", 10),
 
I am trying to add tavern minstrels in the courts of towns and castles. Actually I want them to spawn in courts only while fiests. But I could not make them spawn even as simple way :sad: . Here the codes I added to ("enter_court",  script :
Code:
      (set_visitor, ":cur_pos", "$g_player_chancellor"),
      (val_add,":cur_pos", 1),
    (try_end),
    ##diplomacy end
                (try_begin), #tavern minstrel #######
                    (party_get_slot, ":tavern_minstrel", "$current_town", slot_center_tavern_minstrel),
                    (gt, ":tavern_minstrel", 0),
                    (set_visitor, 95, ":tavern_minstrel"),
                (try_end),  #tavern minstrel ###########
	  #Lords wishing to pledge allegiance - inactive, but part of player faction
	  (try_begin),
		(eq, "$g_player_court", ":center_no"),
	    (faction_slot_eq, ":center_faction", slot_faction_leader, "trp_player"),
		##diplomacy start+

But it doesn't work. I ve also tried entry 32, 33, 34... and the result is same. The minstrels are not spawned.  What should I do to handle this?
 
kalarhan said:
Antonis said:
Hi guys, can I ask a question? I want to change the tournaments so that all parties involved keep their equipment. Much like in 1257 mod, but not only for the lords, anyone participating. I have searched for OSP scripts and such, but couldn't find anything. Can you please help, tell me which script I need to edit? Thank you!

Mst arena_melee_fight has the entry points and the based gear for each,

and the script set_items_for_tournament does the override of gear:
Code:
mission_tpl_entry_clear_override_items       = 1941  # (mission_entry_clear_override_items, <mission_template_id>, <entry_no>),
                                                     # Clears the list of override equipment provided by the entry point definition in module_mission_templates.py.
that script removes the bots gear and uses a random chance to select what they should have

Code:
(store_script_param, ":horse_chance", 1),
                  (store_script_param, ":lance_chance", 2),
                  (store_script_param, ":sword_chance", 3),
                  (store_script_param, ":axe_chance", 4),
                  (store_script_param, ":bow_chance", 5),
                  (store_script_param, ":javelin_chance", 6),
                  (store_script_param, ":mounted_bow_chance", 7),
                  (store_script_param, ":crossbow_sword_chance", 8),
                  (store_script_param, ":armor_item_begin", 9),
                  (store_script_param, ":helm_item_begin", 10),

Oh, thank you very much, man!  :smile:
 
litdum said:
I am trying to add tavern minstrels in the courts of towns and castles. Actually I want them to spawn in courts only while fiests. But I could not make them spawn even as simple way :sad: . Here the codes I added to ("enter_court",  script :
You need to make use of the iterator :cur_pos as the entry point for adding visitors (don't forget to add one afterwards), otherwise it will be overwritten.
 
Somebody said:
litdum said:
I am trying to add tavern minstrels in the courts of towns and castles. Actually I want them to spawn in courts only while fiests. But I could not make them spawn even as simple way :sad: . Here the codes I added to ("enter_court",  script :
You need to make use of the iterator :cur_pos as the entry point for adding visitors (don't forget to add one afterwards), otherwise it will be overwritten.

Is this what you mean?
Code:
		 (is_between, ":lord_original_faction", npc_kingdoms_begin, npc_kingdoms_end),
		 (this_or_next|party_slot_eq, ":center_no", slot_center_original_faction, ":lord_original_faction"),
			(troop_slot_eq, ":town_lord", slot_troop_home, ":center_no"),
		 (faction_get_slot, ":guard_troop", ":lord_original_faction", slot_faction_guard_troop),
	  ##nested diplomacy end+
                (try_end),
      ##diplomacy end
##################################TAVERN MİNSTREL#######################################################
      (assign, ":cur_pos", 95),
      (try_begin), 
          (party_get_slot, ":tavern_minstrel", ":center_no", slot_center_tavern_minstrel),
          (gt, ":tavern_minstrel", 0),
          (set_visitor, ":cur_pos", ":tavern_minstrel"),
          (val_add,":cur_pos", 1), #I don't know what this line is. Just i copied from other ones.
      (try_end),
#################################TAVERN MİNSTREL########################################################
      (try_begin),
        (le, ":guard_troop", 0),
		#diplomacy start+
		#rubik changes this in Custom Commander, and I agree: the "generic" guard
		#should be non-faction-specific.
		##OLD:
        #(assign, ":guard_troop", "trp_swadian_sergeant"),
		##NEW:
		(assign, ":guard_troop", "trp_hired_blade"),
		##diplomacy end+
      (try_end),
      (set_visitor, 6, ":guard_troop"),

I added  the entry with ":cur_pos" and I replaced "$current_town" with ":center_no" . But it still does not work :sad: .
 
Somebody said:
By leaving (assign, ":cur_pos", 95), in there you're not really using the perfectly fine local variable.
I could make the minstrels spawn on the only entry i want by adding this line to "visit_town_castle" mission template :
Code:
     (30,mtef_visitor_source,af_castle_lord,0,1,[]),
     (31,mtef_visitor_source,af_castle_lord,0,1,[]),
     (32,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), ##the line I ve added
     ],
    [
      (ti_on_agent_spawn,1,0,[
      (try_for_agents, ":agent"),
and these lines to "enter_court" script :
Code:
      (try_end),
      (set_visitor, 6, ":guard_troop"),
      (set_visitor, 7, ":guard_troop"),
#################################################################################
      (store_random_in_range, ":troop", tavern_minstrels_begin, tavern_minstrels_end),
      (set_visitor, 32, ":troop"),
#################################################################################
      (assign, ":cur_pos", 16),

	  (try_begin),
		(troop_get_slot, ":player_spouse", "trp_player", slot_troop_spouse),
	    (gt, ":player_spouse", 0),

and now I want the minstrels to spawn in courts only while fiests. Is there any way to do this?
 
Bearomir said:
Could you guys tell me what this means?
Code:
     (1,mtef_defenders|mtef_team_0,0,aif_start_alarmed,12,[]),
     (0,mtef_defenders|mtef_team_0,0,aif_start_alarmed,0,[]),
     (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,12,[]),
     (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,0,[]),

It arranges what the troops spawned in that entry points do. For instance, the troop spawned in entry point 1 is defender and it is alarmed which means it will start attacking when you jump the scene.
 
Somebody said:
Check slot_faction_ai_state for sfai_feast, then fetch the town in slot_faction_ai_object to see if it matches the current town.

Sorry if it is silly question, but i am not very good at coding. I found this in "town_castle" menu that can be about what you said :
Code:
      ("town_castle",[
          (party_slot_eq,"$current_town",slot_party_type, spt_town),
          (eq,"$entry_to_town_forbidden",0),
          (str_clear, s1),
          (try_begin),
            (store_faction_of_party, ":center_faction", "$current_town"),
            (faction_slot_eq, ":center_faction", slot_faction_ai_state, sfai_feast),
            (faction_slot_eq, ":center_faction", slot_faction_ai_object, "$current_town"),
            (str_store_string, s1, "str__join_the_feast"),
          (try_end),
How can I add these codes to where  should be in "enter_court" script or maybe I should add this:
Code:
      (store_random_in_range, ":troop", tavern_minstrels_begin, tavern_minstrels_end),
      (set_visitor, 32, ":troop"),
  somewhere in "town_castle" menu. But where should I add?

I ve tried this:
Code:
      (set_visitor, 6, ":guard_troop"),
      (set_visitor, 7, ":guard_troop"),
  ########################################################    
      (store_random_in_range, ":troop", tavern_minstrels_begin, tavern_minstrels_end),
      (party_slot_eq, ":troop", slot_faction_ai_state, sfai_feast),
      (party_slot_eq, ":troop", slot_faction_ai_object, "$current_town"),
      (set_visitor, 32, ":troop"),
########################################################
      (assign, ":cur_pos", 16),

	  (try_begin),
		(troop_get_slot, ":player_spouse", "trp_player", slot_troop_spouse),
But now I cannot enter to courts.
 
Code:
          (try_begin),
            (faction_slot_eq, ":center_faction", slot_faction_ai_state, sfai_feast),
            (faction_slot_eq, ":center_faction", slot_faction_ai_object, ":center_no"),
            (store_random_in_range, ":troop", tavern_minstrels_begin, tavern_minstrels_end),
            (set_visitor, 32, ":troop"),
          (try_end),
 
Status
Not open for further replies.
Back
Top Bottom