Search results

  1. MadGuarang

    Need More Info Game dont open via steam since the newest update

    Hi! I had the same issue. I just made it work so, here is what I did. Removed all mods from mod folder, recheck files, restart pc, put all mods back again to mods folder. It seems that for unknown reason something was preventing Bannerlords from finalization of update (if Steam shows that you still need to update or RESUME update it is same issue). Hope this helps.
  2. MadGuarang

    Resolved Cannot enter the game

    After last update I can't load game modding kit.. Details: version 1.5.6, steam. I can, however, load main game, thanks to Fixed Launcher mod.
    When I try running modding kit I can't even run launcher. Instead I am being send to Steam. Then Steam shows Bannerlords needs an update (3,71 GB) and it shows only RESUME button (not PLAY). When I hit Resume button for one-two seconds it 'thinks' and then button changes to UPDATING, and after 1-2 seconds it goes back to RESUME.
    So Steam tells me that I need update, but update button does nothing.
    On steam forum there a couple comments like mine, so it isn't just me.
  3. MadGuarang

    Modding Q&A [For Quick Questions and Answers]

    @kalarhan!
    Many thanks! This was what I was looking for!

    I have bypassed mtef_attrackers link to p_main_party by using
    Code:
     (call_script, "script_party_copy", "p_main_party_backup", "p_main_party"), 
     (call_script, "script_party_copy", "p_main_party", "p_quest_tmp_party"),
    and it worked for me for the ally side. When entering battle my character leads troops from my 'source' -> "p_quest_tmp_party" !

    For enemy side
    Code:
    (party_quick_attach_to_current_battle, ":party_no", ":enemy_side"), #attach as enemy
    will be ideal.

    Thanks again!
  4. MadGuarang

    Modding Q&A [For Quick Questions and Answers]

    kalarhan said:
    MadGuarang said:
    2. Is there any complete tutorial about setting up missions?

    check the PDF here https://forums.taleworlds.com/index.php/topic,56798.0.html, it should solve most of your questions

    Thanks! Great PDF, I wasn't aware of its existence. I have already finished it reading. Unfortunately it breaks apart 'duel with single troop', not battle party vs party. However it helped me a lot with understanding menus and mission templates that lead to battles.

    1.  So, am I right thinking that source of mtef_attacker / defender are parties 'p_collective_friends', 'p_collective_allies' and 'p_collective_enemies' or  I am wrong?
    2.  Still I cannot see or find any procedure that sets source party to this attackers or defenders. Is it hard-coded?
    3.  I mean I was hoping for something like  'set_mercenary_source_party' for 'change_screen_buy_mercenaries'... but for mtef_attackers...
  5. MadGuarang

    Modding Q&A [For Quick Questions and Answers]

    Hi! I am trying to create my own mission in module_templates.

    I have experimented with 'Duel with the lord' mission, tweaking it, but I still feel like I am stupid. More or less I understand that ->
    Code:
     (11,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,12,[]),
    and I think I can use it properly. What I mean is that I more or less can deal with setting individual friends / enemies on scene. But now I need to deal with whole parties, and I feel lost.

    I see that other missions have something like that 
    Code:
     # (3,mtef_defenders|mtef_team_0,0,aif_start_alarmed,0,[]),
         #(1,mtef_attackers|mtef_team_0,0,aif_start_alarmed,12,[]),

    Questions:
    1A. When I do use it in my mission, I see my own party (p_main_party) fighting against enemy. How game engine 'knows' what party is related to attackers or to defenders?
    1B. How do I set 'source' party to attackers or defenders? Let's say that instead "p_main_party" I want to use "p_quest_tmp_party"? I don't really need to cover wounded/killed friends/enemies, I just need to set up simple fight.

    2. Is there any complete tutorial about setting up missions? I read lav's headers and some comments on entry points, but couldn't find anything that would cover exactly 'set-up missions' subject. Does it have any 'official name', that part of modding?


  6. MadGuarang

    Modding Q&A [For Quick Questions and Answers]

    Cozur said:
    What part of the code controls companions appearing in taverns? In case you'd rather have them appear in the castle hall instead?

    I believe that this is it:

    Code:
     ("town_tavern",[
              (party_slot_eq,"$current_town",slot_party_type, spt_town),
              (this_or_next|eq,"$entry_to_town_forbidden",0),
              (eq, "$sneaked_into_town",1),
    #          (party_get_slot, ":scene", "$current_town", slot_town_tavern),
    #          (scene_slot_eq, ":scene", slot_scene_visited, 1), #check if scene has been visited before to allow entry from menu. Otherwise scene will only be accessible from the town center.
              ]
           ,"Visit the tavern.",
           [
               (try_begin),
                 (eq,"$all_doors_locked",1),
                 (display_message,"str_door_locked",0xFFFFAAAA),
               (else_try),
                 (call_script, "script_cf_enter_center_location_bandit_check"),
               (else_try),
                 (assign, "$town_entered", 1),
                 (set_jump_mission, "mt_town_default"),
                 (mission_tpl_entry_set_override_flags, "mt_town_default", 0, af_override_horse),
                 (try_begin),
                   (eq, "$sneaked_into_town",1),
                   (mission_tpl_entry_set_override_flags, "mt_town_default", 0, af_override_all),
                 (try_end),
                 (party_get_slot, ":cur_scene", "$current_town", slot_town_tavern),
                 (jump_to_scene, ":cur_scene"),
                 (scene_set_slot, ":cur_scene", slot_scene_visited, 1),
    
                 (assign, "$talk_context", tc_tavern_talk),
                 (call_script, "script_initialize_tavern_variables"),
    
    			 (store_random_in_range, ":randomize_attacker_placement", 0, 4),
    
                 (modify_visitors_at_site, ":cur_scene"),
                 (reset_visitors),
                 
                 (assign, ":cur_entry", 17),
    
    			 #this is just a cheat right now
                 #(troop_set_slot, "trp_belligerent_drunk", slot_troop_cur_center, "$g_encountered_party"),
    			 (try_begin),
    				(eq, "$cheat_mode", 1),
    				(troop_get_slot, ":drunk_location", "trp_belligerent_drunk", slot_troop_cur_center),
    				(try_begin),
    					(eq, "$cheat_mode", 0),
    				(else_try),
    					(is_between, ":drunk_location", centers_begin, centers_end),
    					(str_store_party_name, s4, ":drunk_location"),
    					(display_message, "str_belligerent_drunk_in_s4"),
    			    (else_try),
    					(display_message, "str_belligerent_drunk_not_found"),
    				(try_end),
    				
    				(troop_get_slot, ":promoter_location", "trp_fight_promoter", slot_troop_cur_center),
    				(try_begin),
    					(eq, "$cheat_mode", 0),
    				(else_try),
    					(is_between, ":promoter_location", centers_begin, centers_end),
    					(str_store_party_name, s4, ":promoter_location"),
    					(display_message, "str_roughlooking_character_in_s4"),
    			    (else_try),
    					(display_message, "str_roughlooking_character_not_found"),
    				(try_end),				
    			 (try_end),
    			 
    			 #this determines whether or not a lord who dislikes you will commission an assassin
    			 (try_begin),
    				(store_current_hours, ":hours"),
    				(store_sub, ":hours_since_last_attempt", ":hours", "$g_last_assassination_attempt_time"),
    				(gt, ":hours_since_last_attempt", 168),
    				(try_for_range, ":lord", active_npcs_begin, active_npcs_end),
    					(troop_slot_eq, ":lord", slot_lord_reputation_type, lrep_debauched),
    					(troop_get_slot, ":led_party", ":lord", slot_troop_leaded_party),
    					(party_is_active, ":led_party"),
    					(party_get_attached_to, ":led_party_attached", ":led_party"), 
    					(eq, ":led_party_attached", "$g_encountered_party"),
    					(call_script, "script_troop_get_relation_with_troop", "trp_player", ":lord"),
    					(lt, reg0, -20),
    					(assign, "$g_last_assassination_attempt_time", ":hours"),
    #					(assign, "$g_last_assassination_attempt_location", "$g_encountered_party"),
    #					(assign, "$g_last_assassination_attempt_perpetrator", ":lord"),
    					
    					(troop_set_slot, "trp_hired_assassin", slot_troop_cur_center, "$g_encountered_party"),					
    				(try_end),
    			 (try_end),	
    						
    			 (try_begin),
    				 (eq, ":randomize_attacker_placement", 0),
    				 (call_script, "script_setup_tavern_attacker", ":cur_entry"),
    
    				 (val_add, ":cur_entry", 1),
    			 (try_end),
    			 
    			 (try_begin),
    				(eq, 1, 0),
    				(troop_slot_eq, "trp_fight_promoter", slot_troop_cur_center, "$current_town"),
                    (set_visitor, ":cur_entry", "trp_fight_promoter"),
    
                    (val_add, ":cur_entry", 1),
    			 (try_end),
    			 
                 (party_get_slot, ":mercenary_troop", "$current_town", slot_center_mercenary_troop_type),
                 (party_get_slot, ":mercenary_amount", "$current_town", slot_center_mercenary_troop_amount),
                 (try_begin),
    			   (gt, ":mercenary_troop", 0),
                   (gt, ":mercenary_amount", 0),
                   (set_visitor, ":cur_entry", ":mercenary_troop"),
                   (val_add, ":cur_entry", 1),
                 (try_end),
    
    			 (try_begin),
    				 (eq, ":randomize_attacker_placement", 1),
    				 (call_script, "script_setup_tavern_attacker", ":cur_entry"),
    
    				 (val_add, ":cur_entry", 1),
    			 (try_end),
                 
                 (try_for_range, ":companion_candidate", companions_begin, companions_end),
                   (troop_slot_eq, ":companion_candidate", slot_troop_occupation, 0),
                   (troop_slot_eq, ":companion_candidate", slot_troop_cur_center, "$current_town"),
    			   (neg|troop_slot_ge, ":companion_candidate", slot_troop_prisoner_of_party, centers_begin),
    			   
                   (set_visitor, ":cur_entry", ":companion_candidate"),
    
                   (val_add, ":cur_entry", 1),
                 (try_end),
    			 
    			 (try_begin),
    				 (eq, ":randomize_attacker_placement", 2),
    				 (call_script, "script_setup_tavern_attacker", ":cur_entry"),
    
    				 (val_add, ":cur_entry", 1),
    			 (try_end),
    			 			 
                 (try_begin), #this doubles the incidence of ransom brokers and (below) minstrels
                   (party_get_slot, ":ransom_broker", "$current_town", slot_center_ransom_broker),
                   (gt, ":ransom_broker", 0),
                   
                   (assign, reg0, ":ransom_broker"),
                   (assign, reg1, "$current_town"),
    			   
                   (set_visitor, ":cur_entry", ":ransom_broker"),
                   (val_add, ":cur_entry", 1),
    			 (else_try),
    			   (is_between, "$g_talk_troop", ransom_brokers_begin, ransom_brokers_end),
    			   (store_add, ":alternative_town", "$current_town", 9),
    			   
    			   (try_begin),
    				(ge, ":alternative_town", towns_end),
    				(val_sub, ":alternative_town", 22),
    			   (try_end),
    			   (try_begin),
    				(eq, "$cheat_mode", 1),
    			    (str_store_party_name, s3, "$current_town"),
    			    (str_store_party_name, s4, ":alternative_town"),
    			    (display_message, "@{!}DEBUG - Current town is {s3}, but also checking {s4}"),
    			   (try_end),	
    			   
                   (party_get_slot, ":ransom_broker", ":alternative_town", slot_center_ransom_broker),
                   (gt, ":ransom_broker", 0),
    			   
                   (set_visitor, ":cur_entry", ":ransom_broker"),
                   (val_add, ":cur_entry", 1),
                 (try_end),
    			 
                 (try_begin),
                   (party_get_slot, ":tavern_traveler", "$current_town", slot_center_tavern_traveler),
                   (gt, ":tavern_traveler", 0),
                   (set_visitor, ":cur_entry", ":tavern_traveler"),
                   (val_add, ":cur_entry", 1),
                 (try_end),
    			 
                  (assign,":bard",0),#dedal
                 (try_begin),
                   (party_get_slot, ":tavern_minstrel", "$current_town", slot_center_tavern_minstrel),
                   (gt, ":tavern_minstrel", 0),
    			   (assign,":bard",1),#dedal
                   (set_visitor, ":cur_entry", ":tavern_minstrel"),
                   (val_add, ":cur_entry", 1),
    			 (else_try),  
    			   (store_add, ":alternative_town", "$current_town", 9),
    			   (try_begin),
    				(ge, ":alternative_town", towns_end),
    				(val_sub, ":alternative_town", 22),
    			   (try_end),
                   (party_get_slot, ":tavern_minstrel", ":alternative_town", slot_center_tavern_minstrel),			   
                   (gt, ":tavern_minstrel", 0),
    			   (assign,":bard",1),#dedal
                   (set_visitor, ":cur_entry", ":tavern_minstrel"),
                   (val_add, ":cur_entry", 1),
                 (try_end),
    			 
                 (try_begin),
                   (party_get_slot, ":tavern_bookseller", "$current_town", slot_center_tavern_bookseller),
                   (gt, ":tavern_bookseller", 0),
                   (set_visitor, ":cur_entry", ":tavern_bookseller"),
                   (val_add, ":cur_entry", 1),
                 (try_end),
    			 
    			 (try_begin),
    				 (eq, ":randomize_attacker_placement", 3),
    				 (call_script, "script_setup_tavern_attacker", ":cur_entry"),
    				 (val_add, ":cur_entry", 1),
    			 (try_end),
    			 			 
                 (try_begin),
                   (neg|check_quest_active, "qst_eliminate_bandits_infesting_village"),
                   (neg|check_quest_active, "qst_deal_with_bandits_at_lords_village"),
                   (assign, ":end_cond", villages_end),
                   (try_for_range, ":cur_village", villages_begin, ":end_cond"),
                     (party_slot_eq, ":cur_village", slot_village_bound_center, "$current_town"),
                     (party_slot_ge, ":cur_village", slot_village_infested_by_bandits, 1),
                     (neg|party_slot_eq, ":cur_village", slot_town_lord, "trp_player"),
                     (set_visitor, ":cur_entry", "trp_farmer_from_bandit_village"),
                     (val_add, ":cur_entry", 1),
                     (assign, ":end_cond", 0),
                   (try_end),
                 (try_end),
                 
                 (try_begin),
                   (eq, "$g_starting_town", "$current_town"),
                                  
                   (this_or_next|neg|check_quest_finished, "qst_collect_men"),
                   (this_or_next|neg|check_quest_finished, "qst_learn_where_merchant_brother_is"),
                   (this_or_next|neg|check_quest_finished, "qst_save_relative_of_merchant"),
                   (this_or_next|neg|check_quest_finished, "qst_save_town_from_bandits"),
                   (eq,  "$g_do_one_more_meeting_with_merchant", 1),
                   
    			   (assign, ":troop_of_merchant", 0),	
                   (try_begin),
                     (eq, "$g_encountered_party_faction", "fac_kingdom_1"),
                     (assign, ":troop_of_merchant", "trp_swadian_merchant"),
                   (else_try),  
                     (eq, "$g_encountered_party_faction", "fac_kingdom_2"),
                     (assign, ":troop_of_merchant", "trp_vaegir_merchant"),
                   (else_try),                   
                     (eq, "$g_encountered_party_faction", "fac_kingdom_3"),
                     (assign, ":troop_of_merchant", "trp_khergit_merchant"),
                   (else_try),  
                     (eq, "$g_encountered_party_faction", "fac_kingdom_4"),
                     (assign, ":troop_of_merchant", "trp_nord_merchant"),
                   (else_try),  
                     (eq, "$g_encountered_party_faction", "fac_kingdom_5"),
                     (assign, ":troop_of_merchant", "trp_rhodok_merchant"),
                   (else_try),  
                     (eq, "$g_encountered_party_faction", "fac_kingdom_6"),
                     (assign, ":troop_of_merchant", "trp_sarranid_merchant"),
                   (try_end),
    			   (gt, ":troop_of_merchant", 0),	
                   
                   (set_visitor, ":cur_entry", ":troop_of_merchant"),
                   (val_add, ":cur_entry", 1),
                 (try_end),                         
                 
               #then at the end of the tavern menu add this lines :
    
    			#dedal begin
    			(try_for_range,":entry",32,41),
    					(store_random_in_range,":r",0,100),
    					(gt,":r",50),#random chance of spawning 
    					(try_begin),
    						(eq,":bard",0),
    						(store_random_in_range,":r",0,15),
    						(gt,":r",13),
    						(mission_tpl_entry_clear_override_items,"mt_town_default",":entry"),
    						(store_random_in_range,":r",0,2),
    						(try_begin),
    							(eq,":r",0),
    							(mission_tpl_entry_add_override_item,"mt_town_default",":entry","itm_dedal_lutnia"),
    						(else_try),
    							(mission_tpl_entry_add_override_item,"mt_town_default",":entry","itm_dedal_lira"),
    						(try_end),
    						(store_random_in_range,":dna",0,1000),
    						(store_random_in_range,":troop","trp_musican_male","trp_musican_female"),
    						(set_visitor,":entry",":troop",":dna"),
    						(assign,":bard",1),
    					(else_try),
    						(store_random_in_range,":town_walker",town_walkers_begin,town_walkers_end),
    						(store_random_in_range,":dna",0,1000),
    						(mission_tpl_entry_clear_override_items,"mt_town_default",":entry"),
    						(store_random_in_range,":r",0,10),
    						(try_begin),
    							(gt,":r",2),
    							(mission_tpl_entry_add_override_item,"mt_town_default",":entry","itm_dedal_kufel"),
    						(try_end),
    						(set_visitor,":entry",":town_walker",":dna"),
    					(try_end),
    			(try_end),
    			#dedal end
                 (change_screen_mission),
               (try_end),
            ],"Door to the tavern."),

    exactly that part:
    Code:
      (try_for_range, ":companion_candidate", companions_begin, companions_end),
                   (troop_slot_eq, ":companion_candidate", slot_troop_occupation, 0),
                   (troop_slot_eq, ":companion_candidate", slot_troop_cur_center, "$current_town"),
    			   (neg|troop_slot_ge, ":companion_candidate", slot_troop_prisoner_of_party, centers_begin),
    			   
                   (set_visitor, ":cur_entry", ":companion_candidate"),
    
                   (val_add, ":cur_entry", 1),
  7. MadGuarang

    Modding Q&A [For Quick Questions and Answers]

    Garedyr said:
    MadGuarang said:
    It surely has to do something with number of parties on the world map and unoptimized triggers.
    What's the average savegame size of your mod?

    Garedyr - You probably do not remember, but you were the first person that introduced me into a warband coding, and cannibalism kit was my first code I have applied to my mod. You're 1st on my credit list :smile:

    1. Average save is around 7-10 MB.   
    2. Yes, I have a lot of parties on my map, but same I did in previous stutter-free version. I also reduced amount of parties just to see would that help and I still had that issue.
    3. Triggers - I have added some triggers for town's improvement's but they are mostly 7*24 or 30*24.    Is there any way to track how do they affect game performance?  Then again my issue is that 1.00 with more parties on world map worked a lot better, than less parties in 1.20 of mod version.

    I am opened for any suggestions, really!

    That savegame file size is fine so it eliminates any potential hard to fix problems as a potential cause of map stuttering.
    Keep in mind that the more parties and slots for them you have, the more data needs to be stored and processed by the CPU when specific triggers are called. That leads us directly to what Ruthven said:

    Ruthven said:
    Check if you have any triggers/scripts with nested try_for_parties loops. That is what causes map lag 99.9999% of the time.

    You should try to avoid using try_for_parties if possible and replace it with try_for_range instead.

    Garedyr, Ruthven - thanks a lot, at least I have something to work with. I have checked all simple triggers and triggers and also thought about my world map situation. Your suggestions are very probable, because indeed I have lots of bandit parties roaming on map, that is few times larger than vanilla map. I do also have additional mercenaries, patrols and scouts - originally commented out from warband.

    My 'suspects' are:
    1.    this trigger is 0.1 second and checks all bandit parties / bandit lairs (last part of code):
    Code:
      # Attach Lord Parties to the town they are in
      (0.1,
       [
           (try_for_range, ":troop_no", heroes_begin, heroes_end),
             (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
             (troop_get_slot, ":troop_party_no", ":troop_no", slot_troop_leaded_party),
             (ge, ":troop_party_no", 1),
    		 (party_is_active, ":troop_party_no"),
    		 
             (party_get_attached_to, ":cur_attached_town", ":troop_party_no"),
             (lt, ":cur_attached_town", 1),
             (party_get_cur_town, ":destination", ":troop_party_no"),
             (is_between, ":destination", centers_begin, centers_end),
             (call_script, "script_get_relation_between_parties", ":destination", ":troop_party_no"),
             (try_begin),
               (ge, reg0, 0),
               (party_attach_to_party, ":troop_party_no", ":destination"),
             (else_try),
               (party_set_ai_behavior, ":troop_party_no", ai_bhvr_hold),
             (try_end),
             
             (try_begin),
               (this_or_next|party_slot_eq, ":destination", slot_party_type, spt_town),
               (party_slot_eq, ":destination", slot_party_type, spt_castle),
               (store_faction_of_party, ":troop_faction_no", ":troop_party_no"),
               (store_faction_of_party, ":destination_faction_no", ":destination"),
               (eq, ":troop_faction_no", ":destination_faction_no"),
               (party_get_num_prisoner_stacks, ":num_stacks", ":troop_party_no"),
               (gt, ":num_stacks", 0),
               (assign, "$g_move_heroes", 1),
               (call_script, "script_party_prisoners_add_party_prisoners", ":destination", ":troop_party_no"),#Moving prisoners to the center
               (assign, "$g_move_heroes", 1),
               (call_script, "script_party_remove_all_prisoners", ":troop_party_no"),
             (try_end),
           (try_end),
    	   	   
    	[color=red](try_for_parties, ":bandit_camp"),   ##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! try for parties!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!![/color]
    	 	 (gt, ":bandit_camp", "p_spawn_points_end"),
    		 #Can't have party is active here, because it will fail for inactive parties
    		 (party_get_template_id, ":template", ":bandit_camp"),
    		 (ge, ":template", "pt_steppe_bandit_lair"),
    		
    		 (store_distance_to_party_from_party, ":distance", "p_main_party", ":bandit_camp"),
    	     (lt, ":distance", 3), 
    	     (party_set_flags, ":bandit_camp", pf_disabled, 0),
    	     (party_set_flags, ":bandit_camp", pf_always_visible, 1),	   
    	   (try_end),
        ]),

    2. this is another 'suspect'. it is checked every 3 (in-game hours) but what I do not understand is that trigger for player loosing its court is messed with  bandits forced going in and out their lairs. Weird? Maybe if I split them into 2 different triggers, set 'bandit' trigger as stand alone, that would help... or its gonna break something I am not aware of?


    Code:
     (3, #check to see if player's court has been captured
       [
         (try_begin), #The old court has been lost
           (is_between, "$g_player_court", centers_begin, centers_end),
           (store_faction_of_party, ":court_faction", "$g_player_court"),
           (neq, ":court_faction", "fac_player_supporters_faction"),
           (call_script, "script_add_notification_menu", "mnu_notification_court_lost", 0, 0),
         (else_try),	#At least one new court has been found
           (lt, "$g_player_court", centers_begin),
           #Will by definition not active until a center is taken by the player faction
           #Player minister must have been appointed at some point
           (this_or_next|faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
    		(gt, "$g_player_minister", 0),
    		
           (assign, ":center_found", 0),
           (try_for_range, ":walled_center", walled_centers_begin, walled_centers_end),
             (eq, ":center_found", 0),
             (store_faction_of_party, ":court_faction", ":walled_center"),
             (eq, ":court_faction", "fac_player_supporters_faction"),
             (assign, ":center_found", ":walled_center"),
           (try_end),
           (ge, ":center_found", 1),
           (call_script, "script_add_notification_menu", "mnu_notification_court_lost", 0, 0),
         (try_end),
      #Also, piggy-backing on this -- having bandits go to lairs and back
        (try_for_parties, ":bandit_party"),           ##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! try for parties!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
           (gt, ":bandit_party", "p_spawn_points_end"),
           (party_get_template_id, ":bandit_party_template", ":bandit_party"),
           (is_between, ":bandit_party_template", "pt_steppe_bandits", "pt_deserters"),
           (party_template_get_slot, ":bandit_lair", ":bandit_party_template", slot_party_template_lair_party),
           (try_begin),#If party is active and bandit is far away, then move to location
             (gt, ":bandit_lair", "p_spawn_points_end"),
             (store_distance_to_party_from_party, ":distance", ":bandit_party", ":bandit_lair"), #this is the cause of the error
             (gt, ":distance", 30),
             #All this needs checking
             (party_set_ai_behavior, ":bandit_party", ai_bhvr_travel_to_point),
             (party_get_position, pos5, ":bandit_lair"),
             (party_set_ai_target_position, ":bandit_party", pos5),
           (else_try), #Otherwise, act freely
             (get_party_ai_behavior, ":behavior", ":bandit_party"),
             (eq, ":behavior", ai_bhvr_travel_to_point),
             (try_begin),
               (gt, ":bandit_lair", "p_spawn_points_end"),
               (store_distance_to_party_from_party, ":distance", ":bandit_party", ":bandit_lair"),
               (lt, ":distance", 3),
               (party_set_ai_behavior, ":bandit_party", ai_bhvr_patrol_party),
               (party_template_get_slot, ":spawnpoint", ":bandit_party_template", slot_party_template_lair_spawnpoint),
               (party_set_ai_object, ":bandit_party", ":spawnpoint"),
               (party_set_ai_patrol_radius, ":bandit_party", 45),
             (else_try),
               (lt, ":bandit_lair", "p_spawn_points_end"),
               (party_set_ai_behavior, ":bandit_party", ai_bhvr_patrol_party),
               (party_template_get_slot, ":spawnpoint", ":bandit_party_template", slot_party_template_lair_spawnpoint),
               (party_set_ai_object, ":bandit_party", ":spawnpoint"),
               (party_set_ai_patrol_radius, ":bandit_party", 45),
             (try_end),
           (try_end),
         (try_end),
         #Piggybacking on trigger:
         (try_begin),
           (troop_get_slot, ":betrothed", "trp_player", slot_troop_betrothed),
           (gt, ":betrothed", 0),
           (neg|check_quest_active, "qst_wed_betrothed"),
           (neg|check_quest_active, "qst_wed_betrothed_female"),
           (str_store_troop_name, s5, ":betrothed"),
           (display_message, "@Betrothal to {s5} expires"),
           (troop_set_slot, "trp_player", slot_troop_betrothed, -1),
           (troop_set_slot, ":betrothed", slot_troop_betrothed, -1),
         (try_end),
         ]),

    Anyways, thanks a lot guys, just one more, last question. Is there any way to check/debug which triggers or scripts affect game performance during gameplay? I don't know how to describe it other way, but let say if you run task manager in windows you can see which app affects your pc, right? I am not sure, but I think that I read somewhere on this forum about something similar in Warband, but still I am not sure...

    Appreciate your help, a lot!
  8. MadGuarang

    Modding Q&A [For Quick Questions and Answers]

    It surely has to do something with number of parties on the world map and unoptimized triggers.
    What's the average savegame size of your mod?

    Garedyr - You probably do not remember, but you were the first person that introduced me into a warband coding, and cannibalism kit was my first code I have applied to my mod. You're 1st on my credit list :smile:

    1. Average save is around 7-10 MB.   
    2. Yes, I have a lot of parties on my map, but same I did in previous stutter-free version. I also reduced amount of parties just to see would that help and I still had that issue.
    3. Triggers - I have added some triggers for town's improvement's but they are mostly 7*24 or 30*24.    Is there any way to track how do they affect game performance?  Then again my issue is that 1.00 with more parties on world map worked a lot better, than less parties in 1.20 of mod version.

    I am opened for any suggestions, really!
  9. MadGuarang

    Modding Q&A [For Quick Questions and Answers]

    Hi!
    I am developer of PARADIGM WORLDS https://www.moddb.com/mods/paradigm-worlds

    I have a huge issue, and as for last 4 month tried to locate my problem I have failed many times. From almost perfect running mod my work changed into a festival of unknown bug, or whole set of bugs. My coding ability is very limited, and I don't know really what to do at this point.

    PROBLEM: World map stutter. Around 2-3 weeks (in-game) it begins to stutter, first just a little, but with every day it is worse and worse. My 1.00 version of mod was stutter-free, but all next versions (up to 1.20)  seem to have this stutter problem. I sacrificed around lots of time (4 month+)  trying to locate the issue, but I have failed.

    1. Did anyone have such an issue - MAP STUTTER? What can be a reason for that?
    2. Between 1.00 and 1.20 there were lots of changes but I wonder if that stutter does have anything with WEATHER effects. In Warband this fog / haze is disabled and I brought it back, is it possible that TW turned it off because it was causing troubles?
    3. Is there any tool for monitoring game engine / debugging / performance  so at least I could see what I am dealing with?


    There are many people counting on me, so I cannot just close project and tell them that I failed. Of course it is also important to me. When you spend over 2 years of your life and you see how your project is developing into smth really interesting it is very painful to see it falling down now.  Any help very much appreciated. I can upload code or anything that could be needed.

    Please at least point me at some direction...

    UPDATE: Just to clarify, stuttering problem happens only on world map,  battles, even large 250+ work great.
  10. MadGuarang

    Modding Q&A [For Quick Questions and Answers]

    HI All!

    In my mod player can give orders to scouts and patrols of his own faction. (Yes, I made patrols, scouts and mercenaries to spawn again , but it is not the matter here).

    So I give them orders like Patrol around town X and it works fine. However when I tell them to attack stronger enemy they always run away, changing their minds.

    If I ask them to escort me it is the same, they see bigger army and come back after *I* deal with it.

    So these descriptions from Lav's say:
    Code:
                                                 # Retrieves what position is currently used as object for AI behavior.
    get_party_ai_current_behavior         = 2293  # (get_party_ai_current_behavior, <destination>, <party_id>),
                                                  # Retrieves current AI behavior pattern when it was overridden by current situation (fleeing from enemy when en route to destination).
    get_party_ai_current_object           = 2294  # (get_party_ai_current_object, <destination>, <party_id>),
                                                  # Retrieves what party has caused temporary behavior switch.

    that any ai army change its behaviour 'because something is happened' for example they met stronger army and decided to flee instead of fighting for me.

    I have tried to mess with 'helpfulness' and 'courage', 'aggressivnes' but that doesn't help.

    Is there any way, to turn off their AI and FORCE them to to my biddings?
    Agents have this 'scripted mode' but is there something like that for parties?

    Below is vanilla script that I had modiefied to work for me :
    # script_party_set_simple_ai
      # Input: arg1 = party_no, arg2 = new_ai_state, arg3 = action_object (if necessary)
      # Output: given action
     
      #Party react to simple orders
     
      ("party_set_simple_ai",
        [
     
          (store_script_param, ":party_no", 1),  #who?
          (store_script_param, ":new_ai_state", 2), # what spai eg. spai_accompanying_army, spai_screening_army
          (store_script_param, ":new_ai_object", 3), #what? enemy party, or castle
     
      (store_faction_of_party, ":faction_no", ":party_no"),
     
    #accompany or screen
      (try_begin),
                (this_or_next|eq, ":new_ai_state", spai_accompanying_army),
                (eq, ":new_ai_state", spai_screening_army),
               
                (party_set_ai_behavior, ":party_no", ai_bhvr_escort_party),
                (party_set_ai_object, ":party_no", ":new_ai_object"),
                (party_set_flags, ":party_no", pf_default_behavior, 0),
               
               
               
                (try_begin),
                  (eq, ":new_ai_state", spai_screening_army),
                  (assign, ":aggressiveness", 12),
                  (assign, ":courage", 15),
                  (assign, ":initiative", 80),
      (assign, ":helpfulness", 190),
                (else_try),
                  (assign, ":aggressiveness", :cool:,
                  (assign, ":courage", 9),
                  (assign, ":initiative", 10),
      (assign, ":helpfulness", 190),
                (try_end),
    (try_end),
     
     

    #raid around village
    (try_begin),
                (eq, ":new_ai_state", spai_raiding_around_center),
                (party_get_position, pos1, ":new_ai_object"),
                (map_get_random_position_around_position, pos2, pos1, 1),
                (party_set_ai_behavior, ":party_no", ai_bhvr_patrol_location),
                (party_set_ai_patrol_radius, ":party_no", 10),
                (party_set_ai_target_position, ":party_no", pos2),
                (party_set_ai_object, ":party_no", ":new_ai_object"),
                (party_set_flags, ":party_no", pf_default_behavior, 0),
            (party_set_slot, ":party_no", slot_party_follow_me, 1),

    (try_begin),
                  (assign, ":aggressiveness", 13),
                  (assign, ":courage", 13),
                  (assign, ":initiative", 80),
      (assign, ":helpfulness", 160),
                (try_end),
    (try_end),



    #attack enemy party
    (try_begin),
                (eq, ":new_ai_state", spai_engaging_army),
            (party_set_ai_behavior, ":party_no", ai_bhvr_attack_party),
            (party_set_ai_object, ":party_no", ":new_ai_object"),
            (party_set_flags, ":party_no", pf_default_behavior, 0),

    (try_begin),
                  (assign, ":aggressiveness", 14),
                  (assign, ":courage", 14),
                  (assign, ":initiative", 80),
      (assign, ":helpfulness", 120),
                (try_end),

      (try_end), 




    (try_begin), #scouting - try rather to scout not engage
    (eq, ":new_ai_state", spai_scouting_around_center),  #scout at  - we need differ somehow from patrol...!

    #but:
                #(assign, ":new_ai_state", spai_patrolling_around_center),
                (party_get_position, pos1, ":new_ai_object"),
                (map_get_random_position_around_position, pos2, pos1, 1),
                (party_set_ai_behavior, ":party_no", ai_bhvr_patrol_location),
                (party_set_ai_target_position, ":party_no", pos2),
                (party_set_ai_object, ":party_no", ":new_ai_object"),
               
                (try_begin),
                  (faction_slot_eq, ":faction_no", slot_faction_ai_state, sfai_attacking_enemies_around_center),
                  (party_set_ai_patrol_radius, ":party_no", 3), #line 100
                (else_try), 
                  (party_set_ai_patrol_radius, ":party_no", :cool:, #line 100
                (try_end),

    (try_begin),
                  (assign, ":aggressiveness", 5),
                  (assign, ":courage", 5),
                  (assign, ":initiative", 60),
                  (assign, ":helpfulness", 60),
                (try_end),
      (try_end),

    #patrol around center
      (try_begin),
                (eq, ":new_ai_state", spai_patrolling_around_center),
                (party_get_position, pos1, ":new_ai_object"),
                (map_get_random_position_around_position, pos2, pos1, 1),
                (party_set_ai_behavior, ":party_no", ai_bhvr_patrol_location),
                (party_set_ai_target_position, ":party_no", pos2),
                (party_set_ai_object, ":party_no", ":new_ai_object"),
               
                (try_begin),
                  (faction_slot_eq, ":faction_no", slot_faction_ai_state, sfai_attacking_enemies_around_center),
                  (party_set_ai_patrol_radius, ":party_no", 1), #line 100
      (assign, ":aggressiveness", 12),
                  (assign, ":courage", 12),
                  (assign, ":initiative", 80),
      (assign, ":helpfulness", 260),
                (else_try), 
                  (party_set_ai_patrol_radius, ":party_no", 5), #line 100
      (assign, ":aggressiveness", :cool:,
                  (assign, ":courage", 9),
                  (assign, ":initiative", 80),
      (assign, ":helpfulness", 160),
                (try_end),

              (party_set_flags, ":party_no", pf_default_behavior, 0),
                (party_set_slot, ":party_no", slot_party_follow_me, 1),
                (party_set_slot, ":party_no", slot_party_ai_substate, 0),

      (try_end),
     


    #defend center
      (try_begin),
                (eq, ":new_ai_state", spai_retreating_to_center),
                (party_get_position, pos1, ":new_ai_object"),
                (map_get_random_position_around_position, pos2, pos1, 1),
                (party_set_ai_behavior, ":party_no", ai_bhvr_patrol_location),
                (party_set_ai_target_position, ":party_no", pos2),
                (party_set_ai_object, ":party_no", ":new_ai_object"),
               
                (try_begin),
                  (faction_slot_eq, ":faction_no", slot_faction_ai_state, sfai_attacking_enemies_around_center),
                  (party_set_ai_patrol_radius, ":party_no", 1), #line 100
      (assign, ":aggressiveness", 9),
                  (assign, ":courage", 14),
                  (assign, ":initiative", 80),
      (assign, ":helpfulness", 100),
                (else_try), 
                  (party_set_ai_patrol_radius, ":party_no", 1), #line 100
      (assign, ":aggressiveness", :cool:,
                  (assign, ":courage", 14),
                  (assign, ":initiative", 80),
      (assign, ":helpfulness", 80),
                (try_end),

              (party_set_flags, ":party_no", pf_default_behavior, 0),
                (party_set_slot, ":party_no", slot_party_follow_me, 1),
                (party_set_slot, ":party_no", slot_party_ai_substate, 0),

      (try_end), 
     
     
     
     
              (party_set_aggressiveness, ":party_no", ":aggressiveness"),
          (party_set_courage, ":party_no", ":courage"),
          (party_set_ai_initiative, ":party_no", ":initiative"),
              (party_set_helpfulness, ":party_no", ":helpfulness"),  

      ]),

    Thanks for help!
  11. MadGuarang

    Modding Q&A [For Quick Questions and Answers]

    @projecthamster

    1.
    To have a Diplomacy in your mod you can use modmerger. You can add POBD and freelancer as well, it is not so hard and what is more important files from modmerger do not change vanilla files, they are new files that integrate with your mod.
    So you can read a bit about modmerger and have a lots of small and big modifications in your mod without actually having to rewrite everything. ->  https://forums.taleworlds.com/index.php/topic,320834.0.html

    There is ready-to-play modmerger with diplo pobd and freelancer in one pack.

    2. To be a king. You can try to implement code provided by kalarhan. However if you want just play a small mod when you start with better things then you can go as well and see this code of mine. I wrote it to make becoming 'king' as fast as possible. Few aesy commands and you get it:
       
      ##setting player stats
    (troop_add_gold, "trp_player", 75000),
    (add_xp_to_troop, 5000, "trp_player"),
    (call_script, "script_change_player_honor", -5),
    (troop_set_slot, "trp_player", slot_troop_renown, 1000),
    (call_script, "script_change_doomsday_clock", 200),

    #adding new troops for hero
          (party_add_members, "p_main_party", "trp_scoiatael_human_hunter", 16),
    (party_add_members, "p_main_party", "trp_scoitael_commando", 16),

    #giving new castles to hero  
          (call_script, "script_give_center_to_lord", "p_town_3", "trp_player", 0),
          (call_script, "script_give_center_to_lord", "p_castle_15", "trp_player", 0),
          (call_script, "script_give_center_to_lord", "p_castle_16", "trp_player", 0),
      (call_script, "script_give_center_to_lord", "p_castle_33", "trp_player", 0),
      (call_script, "script_give_center_to_lord", "p_castle_28", "trp_player", 0),

    #clear 'old' army in castle
    (party_clear, "p_town_3"),
        (party_clear, "p_castle_15"),
        (party_clear, "p_castle_16"),
        (party_clear, "p_castle_33"),
    (party_clear, "p_castle_28"),

    # add new army to a castle
    (party_add_members, "p_town_3", "trp_scoiatael_human_hunter", 16),
    (party_add_members, "p_town_3", "trp_scoiatael_partizan", 16),
    (party_add_members, "p_town_3", "trp_scoitael_ranger", 16),
    (party_add_members, "p_town_3", "trp_scoiatael_saboteur", 16),
    (party_add_members, "p_town_3", "trp_scoitael_commando", 16),
    (party_add_members, "p_town_3", "trp_scoiatael_commando_joined_leader", 3),

    #set relation to faction4 to good (if you set it to -40 then you have war|!)

    (call_script, "script_change_player_relation_with_faction", "fac_kingdom_4", 25),

    (call_script, "script_change_player_right_to_rule", 40),


    (else_try),

    There is a command like ->  (call_script, "script_give_center_to_lord", "p_town_3", "trp_player", 0),  that gives you town nr 3. Engine will treat you as a new king, you can also add new troops to your castle/town, and so on. This is not copy-paste cause I use other troops and parties but you should get the idea.

    And kalarhan was right about changing one faction to be 'Bad'. It is a lot easier than to remake bandits into a new 7th faction (which is rather not simple and needs lots of coding.

    Just use something like ->
    Code:
    (party_add_members, "p_town_3", "trp_scoiatael_partizan", 16),
    and instead trp_scoiatael_partizan put your own "bandit" or whatever.


  12. MadGuarang

    Modding Q&A [For Quick Questions and Answers]

    Thanks a lot! Cracking on it!
  13. MadGuarang

    Modding Q&A [For Quick Questions and Answers]

    1.
    1. why are you trying to move a town with code? Why not do it on setup time (module_parties.py)? Why not spawn it (enable it) at a certain position?

    From story-point-of-view:
    to easy create different versions of the same map. We can change every party name and if we could change place of town we have countless versions just using same map. (think Pirates Sid Meier different time period 1540, 1600, 1660 etc.)  I created some "scenarios" to choose from, with variants balance of power of different factions. Now I would like to make a version of different time.

    From technical-point-of-view: well, I might create another town. But there I had to create another amorer, weapon mechant, copy scn files, generally setting a town takes precious time. Additionally:
    # Party disappears from the map. Note that (try_for_parties) will still iterate over disabled parties, so you need to make additional checks with (party_is_active).
    disable_party - So says Lav. My concern about certain iterations, messing with enabling or disabling party considering my skills is like asking for troubles. My mod has grown up a lot and I am afraid that like a butterfly effect it will hit some other part of my mod. On the other hand I see so simple solution: party_set_poition. That means that I can change town's name (party_set_name) and then move it to another place so it can 'pretend' another town in the different timeline. With this I can create strategic variants with different towns, castles and villages position. It opens fantastic opportunities to create huge variety of scenarios using same map in a quick manner.

    So for now my solution is that: I used parties "Bridge" as I don't use them originally on my map. Then I have manually entered coordinates where I want to move a town.
    Code:
     ("Bridge_2","{!}2",icon_bridge_snow_a|pf_is_static|pf_disabled|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-241.44,-147.88),[],4),
    and
    Code:
    (party_get_position, pos1,"p_Bridge_2"),
    (party_set_position, "p_town_2", pos1),
    Maybe I overlooked, but I wasn't able to see any example so I could learn what 'fixed multiplier' should be set for coordinates for party_set_position command. Nor Native neither other modules I have in posession do not have example of using that command with actual real numbers like
    Code:
    (set_fixed_point_multiplier, 1000),	 
    (position_set_x, pos2, 126),
    (position_set_y, pos2, -92),
    (party_set_position, "p_town_4", pos2),

    or
    Code:
    (party_set_position, "p_town_4", -123.00, 98.00),
    they always use variable like pos1, pos63 and so on. Variables come from commands like party_get_position so it is a closed circle. I just cannot figure what scale should be used. I made several tests with different multipliers and values of coordinates and failed each one. I don't wanna guess, I'd rather understand it.

    To test map coordinates you can use a display_message to print where your party is currently (a example)

    To move centers around on a large scale you can use mapping tools (see tool section)
    I already know coordinates too well. I use constantly Throgrim Map Editor, but it is not the case. I want to create or rather find an easy tool that will allow to freely move parties at a start of the each 'scenario'. I think that probably party_set_position is the easiest way to it, that's it. In one sentence: instead of whole procedure of creating new town I'd rather recycle an already created town with all its slots, etc.



    2. see header_triggers.py for the list of triggers

    My issue is that I don't know how to understand 'ground'? Is it agent? Does it have any value? I am not sure, is it 'scene prop' - with that unfortunately I did not have any experience.  How it is recognised by game - earth, ground? I couldn't find any example of using position_get_distance_to_ground_level, at least in Native. I will search VC and Reckoning modsys's maybe I will find something there.

    If earth / ground is a prop I could use "ti_on_scene_prop_hit". Is ground a scene prop?

    3. Yes, yes, Thanks on opinion in that matter. I have made several tests up to the moment. Listed sysmodule commands, scripts that use time. Well it seems a challenge, interesting. I think its too early for my amateur skill to crack on it, but surely I will try to have a bite sometime later. Step by step.

    Thank very much for all advices, helped a lot.
  14. MadGuarang

    Modding Q&A [For Quick Questions and Answers]

    @kalarhan thanks very much, ... that cleared a lot. I have Lav and it helped me a lot countless times.

    1. I have certain coordinates from ctrl+e warband, eg. -120, 130.    Is there any way to tell what should be value for set_fixed_point_multiplier? Or is there any way to 'translate' warband-game position to the one in warband-module?

    I tried this,
    Code:
    (set_fixed_point_multiplier, 100),	  
    (position_set_x, pos1, 21400),
    (position_set_y, pos1, 11400),
    (party_set_position, "p_town_7", pos1),
    
    
    (set_fixed_point_multiplier, 100),	 
    (position_set_x, pos1, 12600),
    (position_set_y, pos1, -9200),
    (party_set_position, "p_town_4", pos1),
    
    
    ## in-game ctrl+e:    262,122 
       
    (set_fixed_point_multiplier, 100),	  
    (position_set_x, pos1, 26200),
    (position_set_y, pos1, 12200),
    (party_set_position, "p_town_22", pos1),
    
    (set_fixed_point_multiplier, 100),	 
    (position_set_x, pos1, 9400),
    (position_set_y, pos1, 1100),
    (party_set_position, "p_castle_10", pos1),
    but all towns appeared in the same place again, however with different coordinates. x:~108 y:~88 
    I couldn't find too many examples in native for that...

    2. position_get_distance_to_ground_level  - is there any trigger like on_missile_hit_anything or its position has to be checked every second/frame? I am sorry if that's stupid/obvious question, but I am not experienced much with mt.

    3. I have tried the module.ini way of changing time, but multiplying time there staggers map for me, and I see I need more radical solution, if I wanna change hours into days. Even when lowered signifcantly world map speed map staggers because lots of things works by slower time (decisions, weather, recruiting, spawning, wars, tournaments, etc.) to change all this.... ufff. But I see a calendar in the main map view. Where else date is displayed, note, messages log. Maybe it is rather a question of changing HOW calendar displays time. To set up lets say "time_scale_script_ which would change way how time would be count. Or find a way to display itself, make it display different numbers.... Just thinking loudly.

    #script_game_get_date_text:  # This script is called from the game engine when the date needs to be displayed. - would be probably responsible for that?

    Code:
     #script_game_get_date_text:
      # This script is called from the game engine when the date needs to be displayed.
      # INPUT: arg1 = number of days passed since the beginning of the game
      # OUTPUT: result string = date
      ("game_get_date_text",
        [
          (store_script_param_2, ":num_hours"),
          (store_div, ":num_days", ":num_hours", 24),
          (store_add, ":cur_day", ":num_days", 23),
          (assign, ":cur_month", 6),
          (assign, ":cur_year", 6077),
          (assign, ":try_range", 99999),
          (try_for_range, ":unused", 0, ":try_range"),
            (try_begin),
              (this_or_next|eq, ":cur_month", 1),
              (this_or_next|eq, ":cur_month", 3),
              (this_or_next|eq, ":cur_month", 5),
              (this_or_next|eq, ":cur_month", 7),
              (this_or_next|eq, ":cur_month", 8),
              (this_or_next|eq, ":cur_month", 10),
              (eq, ":cur_month", 12),
              (assign, ":month_day_limit", 31),
            (else_try),
              (this_or_next|eq, ":cur_month", 4),
              (this_or_next|eq, ":cur_month", 6),
              (this_or_next|eq, ":cur_month", 9),
              (eq, ":cur_month", 11),
              (assign, ":month_day_limit", 30),
            (else_try),
              (try_begin),
                (store_div, ":cur_year_div_4", ":cur_year", 4),
                (val_mul, ":cur_year_div_4", 4),
                (eq, ":cur_year_div_4", ":cur_year"),
                (assign, ":month_day_limit", 29),
              (else_try),
                (assign, ":month_day_limit", 28),      
              (try_end),
            (try_end),
            (try_begin),
              (gt, ":cur_day", ":month_day_limit"),
              (val_sub, ":cur_day", ":month_day_limit"),
              (val_add, ":cur_month", 1),
              (try_begin),
                (gt, ":cur_month", 12),
                (val_sub, ":cur_month", 12),
                (val_add, ":cur_year", 1),
              (try_end),
            (else_try),
              (assign, ":try_range", 0),
            (try_end),
          (try_end),
          (assign, reg1, ":cur_day"),
          (assign, reg2, ":cur_year"),
          (try_begin),
            (eq, ":cur_month", 1),
            (str_store_string, s1, "str_january_reg1_reg2"),
    		(assign, "$season", 4), #at start as it was spring MadG 1spring 2 summer 3 autumn 4 winter
          (else_try),
            (eq, ":cur_month", 2),
    		(assign, "$season", 4), 
            (str_store_string, s1, "str_february_reg1_reg2"),
          (else_try),
            (eq, ":cur_month", 3),
    		(str_store_string, s1, "str_march_reg1_reg2"),
    		(assign, "$season", 1), 
          (else_try),
            (eq, ":cur_month", 4),
            (str_store_string, s1, "str_april_reg1_reg2"),
    		(assign, "$season", 1),
          (else_try),
            (eq, ":cur_month", 5),
            (str_store_string, s1, "str_may_reg1_reg2"),
    		(assign, "$season", 1), 
          (else_try),
            (eq, ":cur_month", 6),
            (str_store_string, s1, "str_june_reg1_reg2"),
    		(assign, "$season", 2), 
          (else_try),
            (eq, ":cur_month", 7),
            (str_store_string, s1, "str_july_reg1_reg2"),
    		(assign, "$season", 2), 
          (else_try),
            (eq, ":cur_month", 8),
            (str_store_string, s1, "str_august_reg1_reg2"),
    		(assign, "$season", 2), 
          (else_try),
            (eq, ":cur_month", 9),
            (str_store_string, s1, "str_september_reg1_reg2"),
    		(assign, "$season", 3), 
          (else_try),
            (eq, ":cur_month", 10),
            (str_store_string, s1, "str_october_reg1_reg2"),
    		(assign, "$season", 3), 
          (else_try),
            (eq, ":cur_month", 11),
            (str_store_string, s1, "str_november_reg1_reg2"),
    		(assign, "$season", 3), 
          (else_try),
            (eq, ":cur_month", 12),
            (str_store_string, s1, "str_december_reg1_reg2"),
    		(assign, "$season", 4), 
          (try_end),
          (set_result_string, s1),
        ]), 

    So changing few variables, can that allow manipulate time?
  15. MadGuarang

    Modding Q&A [For Quick Questions and Answers]

    Hi, my name is Karol and I am addicted to warband modding :wink:

    Usually I try to solve problems on my own, but these little things are hard to test in game and I couldn't find lot of info about them. They are maybe not very important, however the answers could be very interesting. Especially to other modders.

    Well, here we are:

    1. I have tried to move party from one place to another.  I wanted to move a town. so:

    Code:
    #(party_set_position, "p_town_24", -206,-162),
    #(party_set_position, "p_town_2", -241,-147),
    #(party_set_position, "p_castle_50", -234,-141),
    #(party_set_position, "p_town_15", -104,130),
    #(party_set_position, "p_town_1", -99,185),
    #(party_set_position, "p_town_21", 0,120),
    #(party_set_position, "p_town_18", 0,-49),
    #(party_set_position, "p_town_8", -155,-127),
    #(party_set_position, "p_town_4", 126,-92),
    #(party_set_position, "p_town_7", 214,114),
    #(party_set_position, "p_town_22", 262,122),
    #(party_set_position, "p_castle_10", 94,11),
    
    
    #also tried:
    
    #(position_set_x, pos1, 262),
    #(position_set_y, pos1, 122),
    #(party_set_position, "p_town_22", pos1),
    
    #(position_set_x, pos1, 94),
    #(position_set_y, pos1, 11),
    #(party_set_position, "p_castle_10", pos1),

    The result was disappointing. All towns appeared in the same place, probably around 0.0 of my map. What I did wrong? My problem was that I don't know if there is a command like ~assign pos1 x y like (assign, pos1, 100, 200), or something like that.

    I am aware of map coordinates
    https://forums.taleworlds.com/index.php?topic=148483.0
    and that
    Why I think the answer could be interesting?
    Modder can use that function to easy create different versions of the same map. We can change every party name and if we could change place of town we have countless versions just using same map. (think Pirates Sid Meier different time period 1540, 1600, 1660 etc.)  I created some "scenarios" to choose from, with variants balance of power of different factions. Now I would like to make a version of different time. A command to move party is script would be a godsend to me then.

    2. Second question. I will try to explain using example. Below is the code for items, grenade-type-like. For example panzerfaust shell:
    Code:
    ["panzerfaust_grenade","Panzerfaust Grenade", [("kranu_3",0),("kranu_3",ixmesh_inventory),("kranu_3",ixmesh_flying_ammo),("kranu_3",ixmesh_carry)], itp_type_bullets|itp_can_penetrate_shield|itp_default_ammo, 0, 2000,weight(2.25)|abundance(10)|weapon_length(10)|thrust_damage(200,blunt)|max_ammo(6),imodbits_missile,
    
    [(ti_on_missile_hit, [	(store_trigger_param_1,":grenadier"),
    
    #GRENADE STATS
    (assign, ":damageMin", 75),
    (assign, ":damageMax", 250),
    (assign, ":radius", 500),
    #explosives
    (agent_get_troop_id, ":grenadier_troop", ":grenadier"),   (store_skill_level, ":skl_explosives",  "skl_power_throw", ":grenadier_troop"), (val_add, ":skl_explosives", 1),
    (val_div, ":damageMin", 10),
    (val_div, ":damageMax", 10),
    (val_div, ":radius", 10),
    (val_mul, ":damageMin", ":skl_explosives"),
    (val_mul, ":damageMax", ":skl_explosives"),
    (val_mul, ":radius", ":skl_explosives"),
    #explosives end
    (call_script, "script_create_explosion_panzerfaust", ":grenadier", ":damageMin", ":damageMax", ":radius"),
    ])]],

    So explosion happens only if grenade will hit agent / troop. But when it hits ground, nothing happens. Is there any way to 'tell' grenade to react on hit on ground?

    3. Last question is maybe rather ask for opinion, not for solving problem, on changing of time. I wonder, that maybe if game would act not within lets say vanilla max 3 years (me personally never played more than 400-500 days in-game time). And make scale, flow of time very much faster. So maybe WB mod would become more epic, in a sense that if our story could last 'years' we could even make some script for succesions of thrones, our story would become more like a literature, a history novel, if you know what I mean. It is interesting because that opens to a modder new challenges, but also opportunities to make new features, like managing a dynasty (more like CK2, heh). So how interesting a mod could be if it would happen within of 50, 200, 500 years?
    My question is: has anyone tried it? I have two personal concerns: 1. There is a 'turbo' mode in-world map, if we hit ctrl-space then world 'happens' faster, is there a way to use same command to make flow of the days faster? O r there is a way to change just some variables and no 'turbo' mode is needed. 2. Second concern - butterfly effect? I find sometimes testing mod that something I changed 2 days a go is affecting 'unpredicted' part of mod or script... But how much disastrous can be changing time in Warband? How do you think?

    Thanks in advance for advice :smile:

  16. MadGuarang

    OSP Code SP Perfect troop tree presentation

    Dear @rubik! This piece of code is one of the most beautiful things I had pleasure implement into them mod. When I read that this version of troop-tree will do with even most complicated army compositions I was very sceptical about it. Not that I don't believe your coding skills, but because I have around 1300 different troops on the counter. Divided into over 20 different factions. Different races... and so on.

    Then I implemented this into my mod, Paradigm Worlds, and it works perfectly. More, thanks to that Tree View I was able to locate few mistakes. But most important, first time in life of that mod I could see all troops, not as a numbers in module file, but as very nice visualisations, linked one to another.

    Thank You very much man, you made a great thing that improves a lot of mods, mine too. I will give it to players with version 1.05. They asked me to make that work for many days and thanks to you it happened. Cheers!


    mb356.jpg

    mb355.jpg

    link to the mod if anyone interested:
  17. MadGuarang

    SP Sci-Fi Fantasy PARADIGM WORLDS - Fantasy / Post-Apocaliptic / S-F mod

    Hi!
    If you have problems with bugs in the game you can also lost your problem on moddb mod forum. Somebody probably had same issue and can help you.

    For best you should play the game:
    0  bodies
    RAGDOLL OFF - this is needed for corpses to behave normal

    Last version of the mod should be playable without severe  bugs. I use comments from players to improve mod and I would rather not implement new option if it means bugs, than put new thing which would made game more buggy.

    Skeletons should work properly. However please take into consideration that you should use skeletons file provided by me in the mod.
    Skeletons are scaled over 1.o to something about 1.40 for halfgiants. That unfortunatelly makes ragdoll effect to work erratic.

    Problem with uruks and orcs generally - bug that made them invincible - was an old bug from previous versions of mod. And it was due to 'skeleton' file. You can search for it in the mod folder.

    As for the balance. I never intended to create balanced game. But there is a way to win every faction.

    Player can hire order troops and give orders to hired armies. Player can hire his own custom troops. You just need to play a little to see which kind of troops are effective against others.

    Apart of the thing that visually mod is like a' drug trip ' as someone described it, it is also thought to be played using some strategy and tactical thought.

    This mod differs from others also in the way that if you want to visit some areas you should be powerful enough to do so. And if you go with even big but unexoerienced band to fight with cyborgs or technomages you will proba ly fail.

    If you ever played might and magic, for example mm6, there were some areas that monster killed you instantly because you were to weak. Similar in paradigm worlds.

    On the other hand I assure you that if you:
    Level up your companions
    Choose good troops and good mix of the troops
    Use firing snipers, troops that use grenades, find cavalry, maybe use shock troops in a effective way you will find that game can be quite easy.

    And for starters it is absoluty not a shame if you set difficulty to easy. This game can be sometimes hard ezpecially to new players so remeber that I wanted to create mod to be fun and challenging but not impossible to play.

    I hope you all have fun.

    Sorry for any errors in post but I used mobile not pc to write it.
  18. MadGuarang

    SP Sci-Fi Fantasy PARADIGM WORLDS - Fantasy / Post-Apocaliptic / S-F mod

    Hi. If you kniw which objects and textures are mine, you re welcome to use them in your mod. However please take into consideration that my mod is existing thanks to objects and textures of other modders as well. Theese things are really mixed.

    For sure if something looks weird freak or strange it is probably done by me. There is a lot of textures that were remade by me.

    Safest way would be identify author, you can check my credits section.

    It would be very hard to say exactly model by model what was done by me and what by other modder.

    So if you keep this warning in mind, every modder can use anything done by me in any MB mod. You can post here info, it would be interesting to see how stuff is used later.
  19. MadGuarang

    SP Sci-Fi Fantasy PARADIGM WORLDS - Fantasy / Post-Apocaliptic / S-F mod

    The strange armed guys belong to stargate faction?
    - yes

    You could add leaders to the strange armed man so when we capture them we have the option to release them to reset relations like I was able to do with the undead if I remember correctly.
    - possible

    This option to make peace with minor faction is possible to every faction that spawns horde. (about 1000 units). Every such kind of horde has boss, that can be captured and trade for order license, peace or money.
  20. MadGuarang

    SP Sci-Fi Fantasy PARADIGM WORLDS - Fantasy / Post-Apocaliptic / S-F mod

    Version 1.0 is coming!

    - One of the things I've done already (today to be precise) is that - you move backwards doomsday clock for doing quests, and forwards when failing

    - In a few days I'll write details what will be exactly in new version. I don't wanna rush too much, because I want to make it good.

    - Faction relations will be also chnged, in that case Star Gate will not have any good or bad relations with Sanitarium. As a supporting minor will be Desrt Abominations, they're hated by Techno Mages, so this should balance this region a bit.

    - BTW maybe just bribe Star Gate to be neutral?

    - Late game reinforcements to all parties will be also changed, to spawn better units, not just more the same. This would also help game.

    EDIT: Eliminating any faction... -100 doomsday clock?
Top Bottom