Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
What script controls which troops get assigned to the "archer" vs infantry vs. cavalry groups?
I have been searching through source files for std_archers and find no assignment section.

Is there a way to change it to include skirmisher with javelins.
Nearly all my troops have javelins but most line up with infantry.
Brytenwalda is the source system.
 
gdwitt said:
What script controls which troops get assigned to the "archer" vs infantry vs. cavalry groups?

its inside the engine (hardcoded), based on the troops flags. However you can override it with a operation

Code:
troop_set_class                          = 1517  # (troop_set_class, <troop_id>, <value>),
                                                 # Sets troop class (infantry, archers, cavalry or any of custom classes). Accepts values in range 0..8. See grc_* constants in header_mission_templates.py.
 
Mispronounced said:
Is the character creation menu a presentaion or game menu? Where can I find it?

neither, its hardcoded.

However you still can: change background, the position of elements (game_variables.txt), the "when" its called (before visiting world map or after it)
 
kalarhan said:
Mispronounced said:
Is the character creation menu a presentaion or game menu? Where can I find it?

neither, its hardcoded.

However you still can: change background, the position of elements (game_variables.txt), the "when" its called (before visiting world map or after it)

I'd like to change what happens when you click done. What file to i edit?
 
Greetings,

When pressing 1, or 2, or 3, for instance, which selects your infantry, archers or cavalry.

Is there a presentation or something for this? I looked for gk_infantry_hear, and couldn't find it.

I know I can do this with a trigger by checking if the key is pressed (every 0 seconds) and then apply the code I would like, such as playing sound if its pressed.

However, for performance sake, if there is a presentation or something that gets called whenever the player presses 1 or 2 or 3, that would save performance and remove the need for a hack (work around) of making a trigger.

Thank you I would appreciate an answer for this.

Here is an example of a trigger that could work but I would rather not use it if possible:
Code:
		(0.0, 0.3, 0.0,
		[
                (game_key_clicked, gk_infantry_hear),
		(display_message, "@User is holding 1.", 0x0016fc07),
#Proceed code
 
_Sebastian_ said:
troycall said:
When pressing 1, or 2, or 3, for instance, which selects your infantry, archers or cavalry.
Is there a presentation or something for this? I looked for gk_infantry_hear, and couldn't find it.
The order menu is completely hardcoded, so you won't find a single line of code relating to this.

Ah, a trigger is the only way to do this then?

Alright, thanks.
 
troycall said:
_Sebastian_ said:
troycall said:
When pressing 1, or 2, or 3, for instance, which selects your infantry, archers or cavalry.
Is there a presentation or something for this? I looked for gk_infantry_hear, and couldn't find it.
The order menu is completely hardcoded, so you won't find a single line of code relating to this.

Ah, a trigger is the only way to do this then?

Alright, thanks.
Yes.

Seems I accidentally removed my previous message.
Shame on me...
 
Mispronounced said:
I'd like to change what happens when you click done. What file to i edit?

if you mean what happens AFTER character is created, just place a trigger/check tutorial quest. Native merchant quest (tutorial).

You can do whatever you want (remove the quest, go to world map, open a new menu, a new presentation, etc)
 
The reason I'm asking about the character creation menu is because I'm having an issue with my menus. I followed the examples (more like copy and pasted them) of the Native startup menus and put the "new" menus at the top of game_menus. I also went through and commented out the original game menus for startup. This is mainly because the menus would activate when my menus were over (due to the order, right?).

So here's my problem: After I go through all of my menus and I reach the character creation screen and click done, it presents my menus back to me again (starting at start_king_1). I think this is due to me going over the beginning quest (without a trigger) or just an error in my menus. Here are my menus, sorry for the mess in indentation, and overall messy-ness  :oops:

Code:
game_menus = [

  ("start_king",menu_text_color(0xFF000000)|mnf_disable_all_keys,
    "You are the King of a prosperous land.",
    "none",
    [],
    [
     ("continue",[],"Continue...",
       [(jump_to_menu, "mnu_start_king_1"),
	    (call_script,"script_set_player_kingdom_1"),  #script to set up player kingdom
        ]
       ),
      ("go_back",[],"Go back",
       [
         (change_screen_quit),
       ]),
    ]
  ),   
	  	  
	("start_king_1",menu_text_color(0xFF000000)|mnf_disable_all_keys,	# "custom" menu, makeshift
    "Select your character's gender.",
    "none",
    [],
    [
      ("start_male",[],"Male",
       [
         (troop_set_type,"trp_player", 0),
         (assign,"$character_gender",tf_male),
		 (assign, "$current_town", "p_town_6"),
         (assign, "$g_starting_town", "$current_town"),
         (assign, "$g_journey_string", "str_journey_to_praven"),
		 (party_relocate_near_party, "p_main_party", "$g_starting_town", 2),
         (jump_to_menu,"mnu_start_king_2"),
        ]
       ),
      ("start_female",[],"Female",
       [
         (troop_set_type, "trp_player", 1),
         (assign, "$character_gender", tf_female),#may not even have female player
         (jump_to_menu, "mnu_start_king_2"),
       ]
       ),
	  #("go_back",[],"Go back",
       #[							#may cause issues with king script
       #]),							#clicking continue lags a bit, disabled for now
	    # (jump_to_menu,"mnu_start_king"),	
    ]
  
  ),

  (
    "start_king_2",mnf_disable_all_keys,
    "STORY HERE-your minister and friends left you...etc",
    "none",
    [],
    
    [("start_noble",[],"Continue...",[     
         (assign, "$g_starting_town", "$current_town"),	#because no "take caravan x" menu
         (call_script, "script_player_arrived"),
         (party_set_morale, "p_main_party", 100),
         (set_encountered_party, "$current_town"),
         (assign,"$background_type",cb_noble),		#always noble
		 (troop_set_type,"trp_player", 0),
		 (assign, "$current_town", "p_town_6"),
         (assign, "$g_starting_town", "$current_town"),
         (assign, "$g_journey_string", "str_journey_to_praven"),
		 (party_relocate_near_party, "p_main_party", "$g_starting_town", 2),
	  
      (assign, reg3, "$character_gender"),
	(jump_to_menu,"mnu_choose_king_skill"),
	]),
	
	]
	),
(
    "choose_king_skill",mnf_disable_all_keys,
    "{s13}", 
    "none",
    [(assign,"$current_string_reg",10),
	 (assign, ":difficulty", 0),
	 
	 (try_begin),
		(eq, "$character_gender", tf_female),
		(str_store_string, s14, "str_woman"),
		(val_add, ":difficulty", 1),
	 (else_try),	
		(str_store_string, s14, "str_man"),
	 (try_end),
	
	 (try_begin),
       (eq,"$background_type",cb_noble),
		(str_store_string, s15, "str_noble"),
		(val_sub, ":difficulty", 1),
	 (else_try),
		(str_store_string, s15, "str_common"),
	 (try_end),
	 
	 (try_begin),
		(eq, ":difficulty", -1),
		(str_store_string, s16, "str_may_find_that_you_are_able_to_take_your_place_among_calradias_great_lords_relatively_quickly"),
	 (else_try),
		(eq, ":difficulty", 0),
		(str_store_string, s16, "str_may_face_some_difficulties_establishing_yourself_as_an_equal_among_calradias_great_lords"),
	 (else_try),
		(eq, ":difficulty", 1),
		(str_store_string, s16, "str_may_face_great_difficulties_establishing_yourself_as_an_equal_among_calradias_great_lords"),
	 (try_end),
	],
	[
	("begin_adventuring",[],"Reclaim your lost land!",[
	(set_show_messages, 0),
           (try_begin),
             (eq,"$character_gender",0),
             (troop_raise_attribute, "trp_player",ca_strength,1),
             (troop_raise_attribute, "trp_player",ca_charisma,1),
           (else_try),
             (troop_raise_attribute, "trp_player",ca_agility,1),
             (troop_raise_attribute, "trp_player",ca_intelligence,1),
           (try_end),

             (troop_raise_attribute, "trp_player",ca_strength,1),
             (troop_raise_attribute, "trp_player",ca_agility,1),
             (troop_raise_attribute, "trp_player",ca_charisma,1),
           
             (troop_raise_skill, "trp_player","skl_leadership",1),
             (troop_raise_skill, "trp_player","skl_riding",1),
	       (try_begin),
			 (eq,"$background_type",cb_noble),
			 (eq,"$character_gender",tf_male),
			 (troop_raise_attribute, "trp_player",ca_intelligence,3),
			 (troop_raise_attribute, "trp_player",ca_charisma,3),
			 (troop_raise_skill, "trp_player",skl_weapon_master,4),
			 (troop_raise_skill, "trp_player",skl_power_strike,2),
			 (troop_raise_skill, "trp_player",skl_riding,3),
			 (troop_raise_skill, "trp_player",skl_tactics,3),
			 (troop_raise_skill, "trp_player",skl_leadership,5),
			 (troop_raise_proficiency, "trp_player",wpt_one_handed_weapon,50),
			 (troop_raise_proficiency, "trp_player",wpt_two_handed_weapon,100),
			 (troop_raise_proficiency, "trp_player",wpt_polearm,100),

			 #(troop_add_item, "trp_player","itm_tab_shield_round_a",imod_battered),
			 (troop_set_slot, "trp_player", slot_troop_renown, 100),
			 (call_script, "script_change_player_honor", 3),
			 (troop_add_gold, "trp_player", 6000),
		   (else_try),
			 (eq,"$background_type",cb_noble),
			 (eq,"$character_gender",tf_female),
			 (troop_raise_attribute, "trp_player",ca_intelligence,2),
			 (troop_raise_attribute, "trp_player",ca_charisma,1),
			 (troop_raise_skill, "trp_player",skl_wound_treatment,1),
			 (troop_raise_skill, "trp_player",skl_riding,2),
			 (troop_raise_skill, "trp_player",skl_first_aid,1),
			 (troop_raise_skill, "trp_player",skl_leadership,1),
			 (troop_raise_proficiency, "trp_player",wpt_one_handed_weapon,20),

			 (troop_set_slot, "trp_player", slot_troop_renown, 100),
			 #(troop_add_item, "trp_player","itm_tab_shield_round_a",imod_battered),
			 (troop_add_gold, "trp_player", 6000),
		   (try_end),
		   (jump_to_menu, "mnu_auto_return"),
	#(try_begin),
    #    (eq, "$background_type", cb_noble),
    #      (jump_to_menu, "mnu_auto_return"),
    #        (start_presentation, "prsnt_banner_selection"),
           #(start_presentation, "prsnt_custom_banner"),
    #       (else_try),
    #         (change_screen_return, 1),
    #(try_end),         
		]),
	]
 ),

Since i skipped the tutorial quest, where would I add the trigger?

Again, anyone who helps is doing me a huge favor. You have no idea how glad I am there are people who are willing to help a clutz like me :smile: .
I'm having issues with the script as well, but one problem at a time, right? :grin:
 
Hello guys.
Is there possibility to cancel alternation of day and night? I am making mod in space and i don't need it. Wanna make unendable night.

Also i need to slow all the parties. How to make this?

thx for answers:smile:
 
homicuda said:
Also i need to slow all the parties. How to make this?

1) change the leader skill
2) use this script (called by the engine) for fine control

Code:
  ##  #script_game_get_party_speed_multiplier
  ##  # This script is called from the game engine when a skill's modifiers are needed
  ##  # INPUT: arg1 = party_no
  ##  # OUTPUT: trigger_result = multiplier (scaled by 100, meaning that giving 100 as the trigger result does not change the party speed)
  ##  ("game_get_party_speed_multiplier",
  ##   [
  ##     (store_script_param, ":party_no", 1),
  ##     (set_trigger_result, 100),
  ##    ]),
 
Any way to hide the bolt on the crossbow? I am attempting to use crossbows as a distinct set of firearms with unique animations from other firearms (pistols/muskets).

I do not want to use "use_crossbow_as_firearm=1" as I want unique animations for "crossbow"-rifles (with this setting the crossbows use musket animations).
If I set the bolt mesh to invisible the inventory would also be blank, correct? What actually controls the orientation of items in the inventory/equipped screens?
I suppose I could resize/orient my cartridge (bolt) model so it is always within the weapon when reloading, ie. not visible.
 
wrwlf said:
If I set the bolt mesh to invisible the inventory would also be blank, correct?
Probably, but you could use the ixmesh_inventory flag (as the Native "cartridges" do) to override the mesh in the inventory screen.

Slawtering said:
Has there been any indication of what language Bannerlord is using for scripting?
Most probably C# through Mono, perhaps even Unity-style. I spotted MonoDevelop and DLLs in several of the office interviews.
 
Could someone explain rigged and unrigged models. I'm having some trouble with a helmet that starts off rigged in OpenBRF. A tutorial on OpenBRF would be appreciated as well, I can't seem seen to find one
 
Status
Not open for further replies.
Back
Top Bottom