Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
kalarhan said:
HelrothHyrmir said:
Can I create more templates other than 3?

as many as you want, but you need to understand how the IF-THEN-ELSE block works with MBScript first, how variables work, etc, to modify the script that uses them. Did you read the basic tutorials?

like this https://forums.taleworlds.com/index.php/topic,142422.0.html

I did read a couple of them, but still did not encounter with one you sent the link from. Gotta take a read on it!
 
Hey guys, I have a question. I made a menu option for hiding the party when the player has x rank of Tracking skill(Levels 2 and 5, respectively) and when his party is under a certain number(30 and 60, again, at each different option). I want the menu to appear when those requirements meet and NOT before, which doesn't happen. Both options are available when skill is less than 2 and when it is more than 2 it works normally and as intended. Those menu optnions are inserted and the encounter attack menu. Code follows:

Code:
#HIDE PARTY START	  
      ("encounter_hide_party_t1",
      [
		(store_skill_level, ":party_hiding_skill", skl_tracking, "trp_player"),
		(le,":party_hiding_skill",2),
		(store_party_size, ":party_hiding_party_size","p_main_party"),
		(le,":party_hiding_party_size",30),		
      ],
      "Hide in the brush with your party.",
      [
		(dialog_box, "@Using your tracking and hunting skills, you manage to hide your party and yourself in the brush, evading the enemy.", "@Enemy Evaded"),
	    (rest_for_hours, 1, 5, 0),	  
        (leave_encounter),(change_screen_return),
      ]),
	  
	 ("encounter_hide_party_t2",
      [
		(store_skill_level, ":party_hiding_skill", skl_tracking, "trp_player"),
		(le,":party_hiding_skill",5),
		(store_party_size, ":party_hiding_party_size","p_main_party"),
		(le,":party_hiding_party_size",60),		
      ],
      "Hide in the brush with your party.",
      [
		(dialog_box, "@Using your tracking and hunting skills, you manage to hide your party and yourself in the brush, evading the enemy.", "@Enemy Evaded"),
	    (rest_for_hours, 1, 5, 0),        
		(leave_encounter),(change_screen_return),
      ]),
#HIDE PARTY END	  	 
 
Antonis said:
    ("encounter_hide_party_t1",
      [
(store_skill_level, ":party_hiding_skill", skl_tracking, "trp_player"),
(le,":party_hiding_skill",2),
(store_party_size, ":party_hiding_party_size","p_main_party"),
(le,":party_hiding_party_size",30),
      ],
condition block must be true (all lines in it), so review line by line what are you asking the game there.
Above you are saying: if skill is equal or less than 2 (0,1,2) AND size is equal or less than 30 (0, 1, 2, .., 29, 30) THEN show menu
 
Oh
Right. I needed to have an ge(or between) conditional operation on the skill condition. Just noticed it. Thanks.  :facepalm:

EDIT: Ok, so, I won't double post, I'll just edit this post here. I have this problem. I have taken the old Combat Abilities script and changed it according to what I wanted to achieve. Most of it works great and as intended and then there's this bit. It compiles normally, no errors or anything, not in copilation OR in-game, but doesn't work. The bit that has that behavior are two mission templates, while the other two I made/edited/pasted/all those things work just fine. A couple of new ones, made by me(fire spell and storm spell) also work perfectly well. I probably miss-typed sth, or forgot something, but I cannot figure out what, for the life of me. Any help is appreciated, as always!

Code:
# sprint NEW8
common_speed_spell = (
		0, 0, 60, [(key_clicked, key_j),(store_skill_level,"$attribute",skl_athletics,"trp_player"),(ge,"$attribute",4),(eq,"$ability",1),(neg|main_hero_fallen)], [
                 (play_sound,"snd_man_victory"),
                 (display_message,"@You cast Wings of Eledran, enhancing your speed!",0x6495ed),                 
                 (reset_mission_timer_b),

                 (assign, "$ability", 3),
                 (store_attribute_level,"$attribue2","trp_player",1),
                 (val_mul,"$attribue2",8),

                 (store_skill_level,"$athletics","skl_athletics","trp_player"),

                 (troop_raise_skill,"trp_player","skl_athletics",7),         
                 (troop_raise_attribute,"trp_player",1,15),

                 (store_skill_level,"$athleticsnew","skl_athletics","trp_player"),                 
           
         ],

     1, 0, 0, [(store_mission_timer_b,"$timer"),(gt,"$timer","$attribue2"),(eq,"$ability",3)], [

                 (val_sub,"$athletics","$athleticsnew"),

                 (troop_raise_skill,"trp_player","skl_athletics","$athletics"),

                 (troop_raise_attribute,"trp_player",1,-15),                   

                 (display_message,"@You feel the effects of your Wings of Eledran spell disappearing...",0x6495ed),
                 (call_script, "script_sprint_exp_penalty"),       

                 (assign, "$ability", 1),

         ],

     1, 0, 0, [(main_hero_fallen),(eq,"$ability",3)], [

                 (val_sub,"$athletics","$athleticsnew"),

                 (troop_raise_skill,"trp_player","skl_athletics","$athletics"),

                 (troop_raise_attribute,"trp_player",1,-15),                   

                 (display_message,"@You feel the effects of your Wings of Eledran spell disappearing...",0x6495ed),
                 (call_script, "script_sprint_exp_penalty"),       

                 (assign, "$ability", 1),
         ],     

     ti_tab_pressed, 0, 0, [(eq,"$ability",3)], [

                   (val_sub,"$athletics","$athleticsnew"),

                 (troop_raise_skill,"trp_player","skl_athletics","$athletics"),

                 (troop_raise_attribute,"trp_player",1,-15),                   

                 (display_message,"@You feel the effects of your Wings of Eledran spell disappearing...",0x6495ed),
                 (call_script, "script_sprint_exp_penalty"),       

                 (assign, "$ability", 1),
         ],
)		 


# sprint end
	
# focus NEW8
common_focus_spell = (
     0, 0, 60, [(key_clicked, key_k),(store_attribute_level,"$attribute","trp_player",2),(ge,"$attribute",14),(eq,"$ability",1),(neg|main_hero_fallen)], [

                 (display_message,"@You focus on the battle, entering the trance-like state of Battle Meditation!",0x6495ed),                 
                 (reset_mission_timer_b),

                 (assign, "$ability", 4),
                 (store_attribute_level,"$attribue2","trp_player",2),
                 (store_attribute_level,"$bonus","trp_player",2),

                 (val_mul,"$bonus",10),                 
                 (val_mul,"$attribue2",2),

                (troop_raise_proficiency_linear,"trp_player",0,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",1,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",2,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",3,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",4,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",5,"$bonus"),                         

                 (troop_raise_attribute,"trp_player",1,5),

           
         ],

     1, 0, 0, [(store_mission_timer_b,"$timer"),(gt,"$timer","$attribue2"),(eq,"$ability",4)], [

                 (val_mul,"$bonus",-1),

                (troop_raise_proficiency_linear,"trp_player",0,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",1,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",2,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",3,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",4,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",5,"$bonus"),           

                 (troop_raise_attribute,"trp_player",1,-5),                   

                 (display_message,"@Your lose your focus...",0x6495ed),
                 (call_script, "script_focus_exp_penalty"),       

                 (assign, "$ability", 1),

         ],

      1, 0, 0, [(main_hero_fallen),(eq,"$ability",4)], [

                 (val_mul,"$bonus",-1),

                (troop_raise_proficiency_linear,"trp_player",0,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",1,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",2,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",3,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",4,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",5,"$bonus"),           

                 (troop_raise_attribute,"trp_player",1,-5),                   

                 (display_message,"@Your lose your focus... ",0x6495ed),
                 (call_script, "script_focus_exp_penalty"),       

                 (assign, "$ability", 1),
         ],     

     ti_tab_pressed, 0, 0, [(eq,"$ability",4)], [

                 (val_mul,"$bonus",-1),

                (troop_raise_proficiency_linear,"trp_player",0,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",1,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",2,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",3,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",4,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",5,"$bonus"),           

                 (troop_raise_attribute,"trp_player",1,-5),                   

                 (display_message,"@Your lose your focus... ",0x6495ed),
                 (call_script, "script_focus_exp_penalty"),       

                 (assign, "$ability", 1),


         ],     
)
# focus end 
 
How do we edit the loot we get from raiding caravans? It gets ridiculous in native warband as asking for toll usually much more profitable than raiding them.

Any way to implement WFaS send caravan mechanic to native warband?
 
Hi there, I am very new to modding and just want to make minor changes for some of the modules I play, currently, I am playing the diplomacy mod(latest version) and would like to know how to continue commanding troops with the command overlay open after being knocked out.

Despite having battle continuation, there is no way of commanding troops after being knocked out in the base diplomacy mod, ive noticed how this is possible in other popular mods such as Pendor and Perisno. If the answer for my question has already been posted elsewhere please redirect me if needed. Thank you very much.
 
Antonis said:
I probably miss-typed sth, or forgot something, but I cannot figure out what, for the life of me. Any help is appreciated, as always!

for start you should add more test messages like in here
Code:
(display_message,"@Your lose your focus... ",0x6495ed),

to see what the code is doing. That way it will show you which parts breaks (the bug). Remember to enable EDIT MODE (game launcher), so that you can read it on rgl_log.txt directly.

Use Notepad++, SublimeText, etc as they auto reload a file that changed content, so you can follow the log messages on real time. If you have two monitors you can even have the log on one monitor and the game on the other. Otherwise just play on windowed mode, so it is easy to ALT+TAB between game and editor.

You can remove the testing messages later of course. They are for dev debug, not players.
 
That's the problem, though. There's no rgl error, no error of any kind. It seems that those particular mission templates don't "trigger" when the button is pressed. However, the other two I mentioned, which are pretty much the same code, even calling the script and all, "trigger" just fine, when their key is pressed.
 
Antonis said:
That's the problem, though. There's no rgl error, no error of any kind. It seems that those particular mission templates don't "trigger" when the button is pressed. However, the other two I mentioned, which are pretty much the same code, even calling the script and all, "trigger" just fine, when their key is pressed.

that is why you add more testing messages, like this

Code:
common_speed_spell = (
		0, 0, 60, [
                 (display_message, "@trigger XPTO of 60seconds that requires key J"),
                 (key_clicked, key_j),
                 (display_message, "@trigger XPTO detected key J"),
                 ...

if that doesnt show up then your trigger is not being called by that mission template
 
@Antonis try this way...

Code:
common_speed_spell = [
	(0, 0, 60, #trigger 1
		[
			Operation block
		],
		[
			Operation block
		]
	),

	(1, 0, 0, #trigger 2
		[
			Operation block
		],
		[
			Operation block
		]
	),

	(1, 0, 0, #trigger 3
		[
			Operation block
		],
		[
			Operation block
		]
	),

	(ti_tab_pressed, 0, 0, #trigger 4
		[
			Operation block
		],
		[
			Operation block
		]
	),
 ] #end of trigger list
 
?
Changed the coe accordingly to what you posted. Basicall, added parentheses for every trigger of the mission template, added the end ] and commas accordingly.
 
The structure should be something like this...

Code:
common_speed_spell = [
	more mission triggers
 ]
 
common_focus_spell = [
	more mission triggers
 ]
 
my_new_system_spell = [ #all list in one
	common_speed_spell,
	common_focus_spell,
 ]

mission_templates = [
	("lead_charge", mtf_battle_mode|mtf_synch_inventory, charge,
		"You lead your men to battle.",
		[
			(1,mtef_defenders|mtef_team_0,0,aif_start_alarmed,12,[]),
			(0,mtef_defenders|mtef_team_0,0,aif_start_alarmed,0,[]),
			(4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,12,[]),
			(4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,0,[]),
		],	my_new_system_spell + #common_speed_spell + common_focus_spell +
		[
			more mission triggers
		]
	),
 ]
 
It's the same thing, though. I just call more spells in each mission template. Like,
Code:
common_battle_tab_press,
common_taunting_system,
common_damage_system,
common_horse_whistling,
common_healing_spell,
common_speed_spell,
common_focus_spell,

Works and compiles normally, no errors of any kind, nothing. Plus, the common_taunting_system, common_damage_system, common_horse_whistling and common_healing_spell work as intended. Their triggers aren't much different than the last two's. Structurally and syntactically. I will try even more debug messages here and there.
 
Note that 'common_battle_tab_press', for example, has only one trigger, and it's not a list, it's a tuple, just like:
common_arena_fight_tab_press
custom_battle_check_victory_condition
common_custom_battle_question_answered
etc...
so it can be perfectly added to the 'list' of 'lead_charge' triggers.
You have created a new 'list' of triggers, 'common_speed_spell', common_focus_spell, etc., which should go outside the list already created in "lead_charge", it's a new list.
You can add as many lists to the mission as you want.
I'm not sure if I'm expressing myself well, my English is ****...
 
Dj_FRedy said:
so it can be perfectly added to the 'list' of 'lead_charge' triggers.
You have created a new 'list' of triggers, 'common_speed_spell', common_focus_spell, etc., which should go outside the list already created in "lead_charge", it's a new list.
You can add as many lists to the mission as you want.

single trigger per variable

list of triggers per variable

Code:
  ("lead_chargeXPTOSample",mtf_battle_mode,charge,	
    "You lead your men to battle.",
    [
      (1,mtef_defenders|mtef_team_0,0,aif_start_alarmed,60,[]),
    ], variable_with_list_of_triggers_1 + variable_with_list_of_triggers_2 + 

    [
      variable_with_just_one_trigger_1,
      variable_with_just_one_trigger_2,
      variable_with_just_one_trigger_3,

    ] + variable_with_list_of_triggers_3 + variable_with_list_of_triggers_4
  ),
 
Oh, I get it. See, the original script was to just copy the codes inside the mission template you want, I thought of organizing them into separate "spells", each with a different effect. I didn't think that I should group them if they have more than one triggers.
 
A quick question about Bannerlord. (If anyone knows or could possibly know at this juncture.)

I know in Warband it was difficult if not impossible to have a troop tree split off in three+ directions. Does anyone know if this is possible in Bannerlord? I'd like to have more than two troop directions for the mod I am prepping for but it would be good to know early before I invest too much time in troop trees I will have to end up splitting anyways.

Thank you in advance!
 
Rykka said:
I know in Warband it was difficult if not impossible to have a troop tree split off in three+ directions.

you can do that on Warband already. We dont know about Bannerlord and wont for another year or so, but it is unlikely you cant do it there as well  :razz:

Warband is limited to 2 paths if you use the normal system. There is nothing preventing you from creating your own system (your own code), UI, etc. It is just super easy to use the 2-path system as it is already all done and ready for use, that is all.
 
Status
Not open for further replies.
Back
Top Bottom