Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Fire_and_Blood said:
In 5th line, add a "," after "close_window"

Okay,now this is coming;

JEbvzo.png

code;
[trp_wagon_master,"start", [],
    "What can I do for you, chief?", "wagon_train_talk",[]],

  [anyone|plyr,"wagon_train_talk", [], "You follow my lead and try to stay out of trouble.", "wagon_train_follow_lead",[]],
  [anyone,"wagon_train_follow_lead", [], "Alright. We'll be right behind you.", "close_window",[(party_set_ai_behavior, "$g_encountered_party", ai_bhvr_escort_party),
                                                                                                    (party_set_ai_object,"$g_encountered_party", "p_main_party"),
                                                                                                    (assign, "$g_leave_encounter", 1)]],
 
  [anyone|plyr,"wagon_train_talk", [], "You stay here. I'll be back in a while.", "wagon_train_stay_here",[]],
  [anyone,"wagon_train_stay_here", [], "Alright. We'll be waiting here for you.", "close_window",[(party_set_ai_behavior, "$g_encountered_party", ai_bhvr_hold),
                                                                                                    (assign, "$g_leave_encounter", 1)]],
       
[anyone|plyr,"wagon_train_talk", [], "Let's check the inventory.", "start",[(change_screen_loot, "trp_wagon_possessions"),]],
 
  [anyone|plyr,"wagon_train_talk", [], "Let's check the troop assignments.", "start",[(change_screen_exchange_members, "$g_talk_troop_party"),]],

    [anyone|plyr, "wagon_train_talk", [],  "[Disband the wagon]", "close_window",
  [(disable_party, "p_wagon_train"), (assign, "$wagon_active", 0), # To allow for creation of another one
  ]],

  [anyone,"wagon_train_disband1", [(party_get_num_companions,":num_troops","$g_encountered_party"),(gt,":num_troops",1)],
                                    "Are you sure? I still have troops.", "wagon_train_disband2",[]],

  [anyone,"wagon_train_disband1", [(party_get_num_companions,":num_troops","$g_encountered_party"),(eq,":num_troops",1)],
                                    "All right.  I'll see you around.", "close_window",[(party_clear,"p_wagon_train"),
                                                                                                        (party_add_members,"p_wagon_train","trp_wagon_master",1),
                                                                                                        (disable_party, "p_wagon_train"),
                                                                                                      (assign, "$wagon_active", 0), # To allow for creation of another one
                                                                                                        ]],

  [anyone|plyr, "wagon_train_disband2", [],  "Yes, I want to disband the wagon train.", "close_window", [(party_clear,"p_wagon_train"),
                                                                                                        (party_add_members,"p_wagon_train","trp_wagon_master",1),
                                                                                                        (disable_party, "p_wagon_train"),
                                                                                                      (assign, "$wagon_active", 0), # To allow for creation of another one
                                                                                                        ]],

  [anyone|plyr, "wagon_train_disband2", [],  "Wait. I want to look at the troops.", "start", [(change_screen_exchange_members, "$g_talk_troop_party"),]],
 
So,i should change that;

[anyone|plyr, "wagon_train_talk", [],  "[Disband the wagon]", "close_window",
  [(disable_party, "p_wagon_train"), (assign, "$wagon_active", 0), # To allow for creation of another one
  ]],

to

[anyone|plyr, "wagon_train_talk", [],  "[Disband the wagon]", "wagon_train_disband1",
  [(disable_party, "p_wagon_train"), (assign, "$wagon_active", 0), # To allow for creation of another one
  ]],

Thank you. :smile:


 
Is there a way to check for stuck parties? For example, if I where to trap a small faction inside a valley of a mountain, which is only passable during specific seasons, the parties will run into the mountain trying to reach a target that lies outside.

@jacobhinds
Seneschal is the guy you talk to, when you've conquered a castle/town. So deleting them may be a bad idea.

However, you can assign the same seneschal to multiple castles, just like the scene.
 
You never talk to the seneschals, they do have dialogs but are disabled. Don't delete them unless you don't want players to access additional storage, as they act as the town/castle's chest troop.
 
I have a performance question regarding sea travel and can't quite decide which option is better.

The main idea is, that I want all parties to travel on water, not bridge or some replaced material. Parties, who want to travel via water, will travel to the nearest port and then get re-positioned on the water.

There are two options:
1) The port towns will be placed at the land/water border, so that they can be reached from both land and water. Once a party reaches the port town, it will either be moved on land with map_get_land_position_around_position, or onto water with map_get_water_position_around_position.
2) Each town will be accompanied by a port party, as seen in the screenshot. A party would travel to the town and get relocated to the port with a ship icon, or vice versa.

The first option will require less parties on the map, as the extra ports are not needed, though the calculation process with be slightly more complex, plus I'd have to keep track of whether the party is entering the port towns from water or land side.

Any thoughts, as to which method would be less demanding on the system?

x1a6vk.png
 
i get errors while i compile this item:
["carbine", "Carbine", [("carbine",0)], itp_type_crossbow |itp_no_parry|abundance(500)| itp_primary|itp_cant_reload_while_moving|itp_merchandise|itp_two_handed|itp_can_penetrate_shield|itcf_shoot_musket|itcf_carry_spear,
600 , weight(3.5)|difficulty(0)|spd_rtng(50) | shoot_speed(200) | thrust_damage(50 ,pierce)|max_ammo(1)|accuracy(85),imodbits_crossbow ],
it shows me this:
Code:
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
 
Fire_and_Blood said:
I have a performance question regarding sea travel and can't quite decide which option is better.

The main idea is, that I want all parties to travel on water, not bridge or some replaced material. Parties, who want to travel via water, will travel to the nearest port and then get re-positioned on the water.

There are two options:
1) The port towns will be placed at the land/water border, so that they can be reached from both land and water. Once a party reaches the port town, it will either be moved on land with map_get_land_position_around_position, or onto water with map_get_water_position_around_position.
2) Each town will be accompanied by a port party, as seen in the screenshot. A party would travel to the town and get relocated to the port with a ship icon, or vice versa.

The first option will require less parties on the map, as the extra ports are not needed, though the calculation process with be slightly more complex, plus I'd have to keep track of whether the party is entering the port towns from water or land side.

Any thoughts, as to which method would be less demanding on the system?

x1a6vk.png


Guys, please help in this! I am sooooo very interested in that as well, but my attemts to check and change every party icon on water(bridge material-fords) result to immediate and constant crashes.
Thanks, Fire and Blood for bringing it up! :smile:
 
Hi

I tried setting up a webserver from this thread. http://forums.taleworlds.com/index.php?topic=299534.0
I have downloaded the program, and changed the port from '8080' to '80'. But when I start up the Webserver, Apache and MySQL won't activate. (Don't have skype either) If there are any solutions I'd be happy to see them.  :grin:

Thankings,
Suns
 
Is there any way to force AI to use ships when they will bringing closer to the water and allow them to sail without replacing the terrain type? Maybe something like in Caribbean?
(Sorry for my bad English)
 
Masterancza said:
Is there any way to force AI to use ships when they will bringing closer to the water and allow them to sail without replacing the terrain type? Maybe something like in Caribbean?
(Sorry for my bad English)

I second that.

Also,i have a question.I activated the custom banner selection.But,when i made my own banner,after 24 hours,custom banner screen is coming again.And,my selected banner is not using by player.game is asking to me every 24 hours for banner selection.

Trigger;

Code:
# Banner selection menu
  (24,
   [
    (eq, "$g_player_banner_granted", 1),
    (troop_slot_eq, "trp_player", slot_troop_banner_scene_prop, 0),
    (le,"$auto_menu",0),
#normal_banner_begin
    #(start_presentation, "prsnt_banner_selection"),
#custom_banner_begin
    (start_presentation, "prsnt_custom_banner"),
    ]),

in scripts;

Code:
# script_give_center_to_lord
  # Input: arg1 = center_no, arg2 = lord_troop, arg3 = add_garrison_to_center
  ("give_center_to_lord",
    [
      (store_script_param, ":center_no", 1),
      (store_script_param, ":lord_troop_id", 2), #-1 only in the case of a player deferring ownership of a center
      (store_script_param, ":add_garrison", 3),

	  (try_begin),
	    (eq, "$cheat_mode", 1),
		(ge, ":lord_troop_id", 0),
		(str_store_party_name, s4, ":center_no"),
		(str_store_troop_name, s5, ":lord_troop_id"),
		(display_message, "@{!}DEBUG -- {s4} awarded to {s5}"),
	  (try_end),
	  
	  (try_begin),
	    (eq, ":lord_troop_id", "trp_player"),
	    (unlock_achievement, ACHIEVEMENT_ROYALITY_PAYMENT),
	    
	    (assign, ":number_of_fiefs_player_have", 1),
	    (try_for_range, ":cur_center", centers_begin, centers_end),
	      (neq, ":cur_center", ":center_no"),
	      (party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
	      (val_add, ":number_of_fiefs_player_have", 1),
	    (try_end),
	    
	    (ge, ":number_of_fiefs_player_have", 5),
	    (unlock_achievement, ACHIEVEMENT_MEDIEVAL_EMLAK),	    
	  (try_end),
	  
      (party_get_slot, ":old_lord_troop_id", ":center_no", slot_town_lord),
      
	  (try_begin), #This script is ONLY called with lord_troop_id = -1 when it is the player faction 
	    (eq, ":lord_troop_id", -1),
	    (assign, ":lord_troop_faction", "fac_player_supporters_faction"),
        (party_set_banner_icon, ":center_no", 0),#Removing banner
		
      (else_try),	
	    (eq, ":lord_troop_id", "trp_player"),
	    (assign, ":lord_troop_faction", "$players_kingdom"), #was changed on Apr 27 from fac_plyr_sup_fac

      (else_try),	  
		(store_troop_faction, ":lord_troop_faction", ":lord_troop_id"),
	  (try_end),	
	  (faction_get_slot, ":faction_leader", ":lord_troop_faction", slot_faction_leader),

	  (try_begin),
	    (eq, ":faction_leader", "trp_player"),

        (try_begin),
            (troop_get_type, ":is_female", "trp_player"),
            (eq, ":is_female", 1),
            (unlock_achievement, ACHIEVEMENT_QUEEN),
        (try_end),
	  (try_end),
	  
	  (try_begin),
		(eq, ":faction_leader", ":old_lord_troop_id"),
		(call_script, "script_add_log_entry", logent_liege_grants_fief_to_vassal, ":faction_leader", ":center_no", ":lord_troop_id", ":lord_troop_faction"),
        (troop_set_slot, ":lord_troop_id", slot_troop_promised_fief, 0),		
	  (try_end),

      (try_begin),
	    (eq, ":lord_troop_id", -1), #Lord troop ID -1 is only used when a player is deferring assignment of a fief
        (party_set_faction, ":center_no", "$players_kingdom"),
	  (else_try),
        (eq, ":lord_troop_id", "trp_player"),
        (gt, "$players_kingdom", 0),
        (party_set_faction, ":center_no", "$players_kingdom"),
      (else_try),
        (eq, ":lord_troop_id", "trp_player"),
        (neg|is_between, "$players_kingdom", kingdoms_begin, kingdoms_end),
        (party_set_faction, ":center_no", "fac_player_supporters_faction"),
      (else_try),
        (party_set_faction, ":center_no", ":lord_troop_faction"),
      (try_end),
      (party_set_slot, ":center_no", slot_town_lord, ":lord_troop_id"),

      (try_begin),
        (party_slot_eq, ":center_no", slot_party_type, spt_village),
        (party_get_slot, ":farmer_party_no", ":center_no", slot_village_farmer_party),
        (gt, ":farmer_party_no", 0),
        (party_is_active, ":farmer_party_no"),
        (store_faction_of_party, ":center_faction", ":center_no"),
        (party_set_faction, ":farmer_party_no", ":center_faction"),
      (try_end),

    (try_begin),
        (this_or_next|party_slot_eq, ":center_no", slot_party_type, spt_town),
			(party_slot_eq, ":center_no", slot_party_type, spt_castle),
		(gt, ":lord_troop_id", -1),
		
#normal_banner_begin
        (troop_get_slot, ":cur_banner", ":lord_troop_id", slot_troop_banner_scene_prop),
        (gt, ":cur_banner", 0),
        (val_sub, ":cur_banner", banner_scene_props_begin),
        (val_add, ":cur_banner", banner_map_icons_begin),
        (party_set_banner_icon, ":center_no", ":cur_banner"),
# custom_banner_begin
        (troop_get_slot, ":flag_icon", ":lord_troop_id", slot_troop_custom_banner_map_flag_type),
        (ge, ":flag_icon", 0),
        (val_add, ":flag_icon", custom_banner_map_icons_begin),
        (party_set_banner_icon, ":center_no", ":flag_icon"),
    (try_end),

Should i remove the "normal banner begin" array from "give_center_to_lord" ?

from create kingdom_hero_party;

Code:
#Setting the flag icon
      #normal_banner_begin
      (troop_get_slot, ":cur_banner", ":troop_no", slot_troop_banner_scene_prop),
      (try_begin),
        (gt, ":cur_banner", 0),
        (val_sub, ":cur_banner", banner_scene_props_begin),
        (val_add, ":cur_banner", banner_map_icons_begin),
        (party_set_banner_icon, "$pout_party", ":cur_banner"),
      #custom_banner_begin
      (troop_get_slot, ":flag_icon", ":troop_no", slot_troop_custom_banner_map_flag_type),
      (try_begin),
        (ge, ":flag_icon", 0),
        (val_add, ":flag_icon", custom_banner_map_icons_begin),
        (party_set_banner_icon, "$pout_party", ":flag_icon"),
      (try_end),

from;

Code:
("change_banners_and_chest",
    [(party_get_slot, ":cur_leader", "$g_encountered_party", slot_town_lord),
     (try_begin),
       (ge, ":cur_leader", 0),
#normal_banner_begin
       (troop_get_slot, ":troop_banner_object", ":cur_leader", slot_troop_banner_scene_prop),
       (gt, ":troop_banner_object", 0),
       (replace_scene_props, banner_scene_props_begin, ":troop_banner_object"),
     (else_try),
       (replace_scene_props, banner_scene_props_begin, "spr_empty"),
#custom_banner_begin
       (troop_get_slot, ":flag_spr", ":cur_leader", slot_troop_custom_banner_flag_type),
       (ge, ":flag_spr", 0),
       (val_add, ":flag_spr", custom_banner_flag_scene_props_begin),
       (replace_scene_props, banner_scene_props_begin, ":flag_spr"),
     (else_try),
       (replace_scene_props, banner_scene_props_begin, "spr_empty"),
     (try_end),
     (try_begin),
       (neq, ":cur_leader", "trp_player"),
       (replace_scene_props, "spr_player_chest", "spr_locked_player_chest"),
     (try_end),
     ]),

from "get relevant comment";

Code:
#normal_banner_begin
       (troop_get_slot, ":banner", "trp_player", slot_troop_banner_scene_prop),
#custom_banner_begin
       (troop_get_slot, ":banner", "trp_player", slot_troop_custom_banner_flag_type),
       (store_random_in_range, ":renown_check", 100, 200),

should i remove these "normal banner begin" arrays from there ? Maybe they're overriding to each other ?
 
There should be a way simpler solution.

Every 24h, this trigger is called:

  # Banner selection menu
  (24,
  [
    (eq, "$g_player_banner_granted", 1),
    (troop_slot_eq, "trp_player", slot_troop_banner_scene_prop, 0),
    (le,"$auto_menu",0),
#normal_banner_begin
    (start_presentation, "prsnt_banner_selection"),
#custom_banner_begin
#    (start_presentation, "prsnt_custom_banner"),
    ]),

If this gets called over and over, it means, you do not reset "$g_player_banner_granted", to 0, after you've chosen a banner.

Just add a (assign, "$g_player_banner_granted", 0), to the end of your custom banner presentation.

Btw. you may want to use Spoiler tags, for such a huge amount of text.
 
Fire_and_Blood said:
There should be a way simpler solution.

Every 24h, this trigger is called:

  # Banner selection menu
  (24,
  [
    (eq, "$g_player_banner_granted", 1),
    (troop_slot_eq, "trp_player", slot_troop_banner_scene_prop, 0),
    (le,"$auto_menu",0),
#normal_banner_begin
    (start_presentation, "prsnt_banner_selection"),
#custom_banner_begin
#    (start_presentation, "prsnt_custom_banner"),
    ]),

If this gets called over and over, it means, you do not reset "$g_player_banner_granted", to 0, after you've chosen a banner.

Just add a (assign, "$g_player_banner_granted", 0), to the end of your custom banner presentation.

Btw. you may want to use Spoiler tags, for such a huge amount of text.
Thank you. :smile:

"Btw. you may want to use Spoiler tags, for such a huge amount of text."

Im forgetting this sometimes.. Sorry.
 
I have an item type_musket and  shoot_musket but
when  reload musket  it does not work, it reloads the crossbow :V  :roll:  :shock:  :shock:
please help me, how to fix ?
sorry my english bad  :mrgreen: :mrgreen:  :mrgreen:
 
HungKnight said:
I have an item type_musket and  shoot_musket but
when  reload musket  it does not work, it reloads the crossbow :V  :roll:  :shock:  :shock:
please help me, how to fix ?
sorry my english bad  :mrgreen: :mrgreen:  :mrgreen:

You need itcf_reload_musket flag.
 
Lord of Shadows said:
When trying to persuade a lord to join your kingdom, how does the game calculate whether they will join you or not?
I think everything is calculated in this dialogue:

module_dialogs :
Code:
[anyone, "lord_recruit_hesitant_persuade", 
  [  
    (faction_get_slot, ":leader", "$g_talk_troop_faction", slot_faction_leader),   
    (call_script, "script_calculate_troop_political_factors_for_liege", "$g_talk_troop", ":leader"),
    (assign, ":result_for_political", reg3),
    (store_sub, ":open_up_desire", 12, ":result_for_political"),
    (assign, reg3, ":open_up_desire"),
    (val_div, ":open_up_desire", 3),
    
	#(store_random_in_range, ":random", -2, ":max_random_value"),
    (store_sub, ":max_random_value", 14, ":open_up_desire"),
	(troop_get_slot, ":temp_ai_seed", "$g_talk_troop", slot_troop_temp_decision_seed),
    (store_mod, ":random", ":temp_ai_seed", ":max_random_value"), 
    (val_sub, ":random", 2), #random changes between -2 to (14 - (":result_for_political" div 3))
    
	#(val_sub, ":random", 20), #open this line when you want to 100% pass this step and remove again after making tests.
	(store_skill_level, ":persuasion_skill", "skl_persuasion", "trp_player"),
	(lt, ":random", ":persuasion_skill"),
  ],

especially that script : calculate_troop_political_factors_for_liege
 
fladin said:
I think everything is calculated in this dialogue:

module_dialogs :
Code:
[anyone, "lord_recruit_hesitant_persuade", 
  [  
    (faction_get_slot, ":leader", "$g_talk_troop_faction", slot_faction_leader),   
    (call_script, "script_calculate_troop_political_factors_for_liege", "$g_talk_troop", ":leader"),
    (assign, ":result_for_political", reg3),
    (store_sub, ":open_up_desire", 12, ":result_for_political"),
    (assign, reg3, ":open_up_desire"),
    (val_div, ":open_up_desire", 3),
    
	#(store_random_in_range, ":random", -2, ":max_random_value"),
    (store_sub, ":max_random_value", 14, ":open_up_desire"),
	(troop_get_slot, ":temp_ai_seed", "$g_talk_troop", slot_troop_temp_decision_seed),
    (store_mod, ":random", ":temp_ai_seed", ":max_random_value"), 
    (val_sub, ":random", 2), #random changes between -2 to (14 - (":result_for_political" div 3))
    
	#(val_sub, ":random", 20), #open this line when you want to 100% pass this step and remove again after making tests.
	(store_skill_level, ":persuasion_skill", "skl_persuasion", "trp_player"),
	(lt, ":random", ":persuasion_skill"),
  ],

especially that script : calculate_troop_political_factors_for_liege

I'll check it out. Thanks.
 
Status
Not open for further replies.
Back
Top Bottom