Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Hello there,

So I just picked up Warband modding in the last few days, mainly just because I wanted to combine a few mods and make some retextured variants of existing items. I've wound up doing a lot more than I originally planned, and one of those things was finding the third board shield model in the source files. I would like to activate this into an item, since I prefer the more squared-off top as opposed to the rounded top of the vanilla board shields. However, I've run into a bit of a problem that I'm sure people here have solved, but which I can't seem to find a solution for:

I've changed the texture to the one that was made for this shield model, as the default in vanilla had it set to one of the other board shield textures. However, when I got to load the item up in-game, it places the heraldic texture for one of the rounded board shields onto this shield. How do I fix/override this? I can't seem to find in the game files where this is defined.



There is also another issue I've run into. I wanted to add more face textures for the female character, however, while I think I've got them all set-up correctly, I wind up with a white texture with a streak of pixelated black across it instead of my correct textures.

I have a .brf with the face textures all set-up, and it is activated in Module.ini, and all the textures have been added to the Skins file. What else do I need to do to make them work?

I would show images, but I'm not allowed post links or images, evidently.

Thank you in advance for the help!
 
Hi guys, does anyone know if there is a script that makes specific unit type (for example cav) to attack one unit type (e. g. archers)? I think I found a thread about it before but I can't find it anymore
 
Spartan_Hoplite said:
Hi guys, does anyone know if there is a script that makes specific unit type (for example cav) to attack one unit type (e. g. archers)?

player can use hold F1 to give this order (target a group to focus fire on that division)

to code this behavior you will need to check agents AI operations to control the target priority and movement. No idea if there is a ready to copy script for this, but the operations are listed on header_operations.py and the flags on header_mission_templates.py.
 
kalarhan said:
Spartan_Hoplite said:
Hi guys, does anyone know if there is a script that makes specific unit type (for example cav) to attack one unit type (e. g. archers)?

player can use hold F1 to give this order (target a group to focus fire on that division)
I didn't know that could be done :smile: I have tried that in battle and my guys just go to that point and hold the position, how should I do that properly?
 
Does a script already exist to determine the amount of soldiers in a battle? Say if I want a scene in game_menu to only be used if there are more than 250 soldiers present?
 
Dear wise and experienced,

About three hours ago I got into modding (quite late to this field, I do admit), decided to try out creating a faction similar to outlaws to roam the world and attack unsuspecting level 1 players.
When I tried to make them spawn I got the NameError num_wild_tribes_spawn_points not defined, works when I use any other bandit num_spawn_points instead, but that is not remotely kosher, I'd guess (it affects other bandits spawning, it seems)
The question is where do I declare the num_wild_tribes_spawn_points, since I haven't been able to find where are all the other ones within the module system.
Code:
(try_begin),
       (store_num_parties_of_template, ":num_parties", "pt_wild_tribe"),
       (lt,":num_parties",16), #was 14 at mount&blade, 18 in warband, 16 last decision
       (store_random,":spawn_point",num_wild_tribesmen_spawn_points),
       (val_add,":spawn_point","p_wild_tribesmen_sp"),
       (set_spawn_radius, 25),
       (spawn_around_party,":spawn_point","pt_wild_tribe"),
     (try_end),
Thanks in advance to any generous enough to answer
 
horst_hessler said:
I got the NameError num_wild_tribes_spawn_points not defined, works when I use any other bandit num_spawn_points instead, but that is not remotely kosher, I'd guess (it affects other bandits spawning, it seems)
The question is where do I declare the num_wild_tribes_spawn_points

that is a Python constant.

a constant is used instead of a numeric value as a reference. You dont know what a "2" means. But you can understand what a "num_of_this_thingy" means, right?

open module_constants.py, search for the other similar constants, add yours, recompile.



get the number of troops from the collective parties and apply any logic to redirect to a specific scene/mission template. You can see the parties on "script_calculate_battle_advantage"
 
kalarhan said:
horst_hessler said:
I got the NameError num_wild_tribes_spawn_points not defined, works when I use any other bandit num_spawn_points instead, but that is not remotely kosher, I'd guess (it affects other bandits spawning, it seems)
The question is where do I declare the num_wild_tribes_spawn_points

that is a Python constant.

a constant is used instead of a numeric value as a reference. You dont know what a "2" means. But you can understand what a "num_of_this_thingy" means, right?

open module_constants.py, search for the other similar constants, add yours, recompile.



get the number of troops from the collective parties and apply any logic to redirect to a specific scene/mission template. You can see the parties on "script_calculate_battle_advantage"


Thanks, and sorry if it came off as stupid, it's literally 3 hours since Igot even remotely close to editing Warband
 
So I'm trying to do a take on the Fancy Damage System to make it so that a certain group of troops only take quarter damage from someone who isn't of the same type (for lore reasons), and it looks like it should work, and it had in the past, but now when I test it the delivered damage isn't changing.

Code:
common_fate_damage_system = (
 ti_on_agent_hit, 0, 0, [],
[
	(store_trigger_param_1, ":agent"),
	(store_trigger_param_2, ":attacker"),	
	(store_trigger_param_3, ":damage"),
	(store_trigger_param_3, ":orig_damage"),
	(assign, reg11, ":orig_damage"),
	(agent_get_troop_id, ":troop", ":agent"),
	(agent_get_troop_id, ":attacker_troop", ":attacker"),	
	(str_store_troop_name, s10, ":troop"),
	(str_store_troop_name, s11, ":attacker_troop"),
	
	(try_begin),
		(is_between, ":troop", servants_begin, servants_end), 
		(try_begin),
			(neg|is_between, ":attacker_troop", servants_begin, servants_end), 
			(assign, ":mod_damage", ":damage"),		
			(val_div, ":mod_damage", 4), # puts damage at 25%
			(val_mul, ":mod_damage", 3),
			(val_sub, ":damage", ":mod_damage"),
			(assign, reg10, ":damage"),
			(display_message, "@{s10} was hit by {s11} for {reg11} but has instead taken {reg10} damage instead!"),
		(else_try),
			(is_between, ":attacker_troop", servants_begin, servants_end), 
			(display_message, "@Two Servants are fighting!"),
		(try_end),
	(try_end),	
	
	(store_sub, ":diff_damage", ":damage", ":orig_damage"),
	(val_mul, ":diff_damage", -1),
	(store_agent_hit_points, ":hitpoints" , ":agent", 1),
	(val_add, ":hitpoints", ":diff_damage"),
	(agent_set_hit_points,":agent",":hitpoints", 1),
])

and while my display_message says the right numbers, the game system message will still say the full damage numbers.

What am I missing here?
 
SupaNinjaMan said:
So I'm trying to do a take on the Fancy Damage System to make it so that a certain group of troops only take quarter damage from someone who isn't of the same type (for lore reasons), and it looks like it should work, and it had in the past, but now when I test it the delivered damage isn't changing.

Code:
common_fate_damage_system = (
 ti_on_agent_hit, 0, 0, [],
[
	(store_trigger_param_1, ":agent"),
	(store_trigger_param_2, ":attacker"),	
	(store_trigger_param_3, ":damage"),
	(store_trigger_param_3, ":orig_damage"),
	(assign, reg11, ":orig_damage"),
	(agent_get_troop_id, ":troop", ":agent"),
	(agent_get_troop_id, ":attacker_troop", ":attacker"),	
	(str_store_troop_name, s10, ":troop"),
	(str_store_troop_name, s11, ":attacker_troop"),
	
	(try_begin),
		(is_between, ":troop", servants_begin, servants_end), 
		(try_begin),
			(neg|is_between, ":attacker_troop", servants_begin, servants_end), 
			(assign, ":mod_damage", ":damage"),		
			(val_div, ":mod_damage", 4), # puts damage at 25%
			(val_mul, ":mod_damage", 3),
			(val_sub, ":damage", ":mod_damage"),
			(assign, reg10, ":damage"),
			(display_message, "@{s10} was hit by {s11} for {reg11} but has instead taken {reg10} damage instead!"),
		(else_try),
			(is_between, ":attacker_troop", servants_begin, servants_end), 
			(display_message, "@Two Servants are fighting!"),
		(try_end),
	(try_end),	
	
	(store_sub, ":diff_damage", ":damage", ":orig_damage"),
	(val_mul, ":diff_damage", -1),
	(store_agent_hit_points, ":hitpoints" , ":agent", 1),
	(val_add, ":hitpoints", ":diff_damage"),
	(agent_set_hit_points,":agent",":hitpoints", 1),
])

and while my display_message says the right numbers, the game system message will still say the full damage numbers.

What am I missing here?

Your code is a bit needlessly complicated but looks like it should work. Maybe you have to use set_trigger_result and you can also try setting the hitpoints one frame delayed, for some stuff this works wonders.
 
I am heavily leaning on Xeno's Fancy Damage Kit before pairing down any bloat to make it streamlined for my purposes.

But you were absolutely right, set_trigger_result has fixed it! You're fantastic.

I don't think that set_trigger_result existed back when the OSP was written because it isn't mentioned at all in the thread. I want to make a post updating it, but I also don't want to necro an ancient thread.
 
SupaNinjaMan said:
[...]I don't think that set_trigger_result existed back when the OSP was written because it isn't mentioned at all in the thread. I want to make a post updating it, but I also don't want to necro an ancient thread.
Do it! That is not a problem. You are adding important new information. OSP threads get responses all the time, even if long dormant.
 
The strange this is, when I first implemented it the previous way, it worked perfectly.

I can't see why it isn't working now, but set_trigger_result works way more easily and without as much hackery as the former way, so I think it's a worthy mention.
 
Cozur said:
Does a script already exist to determine the amount of soldiers in a battle? Say if I want a scene in game_menu to only be used if there are more than 250 soldiers present?
You might want to look at the Viking Conquest Module System (module_game_menus). There are a couple of scenes in the storymode, which check that you have not more than a certain amount of members in the party otherwise you are not allowed to enter the scene (30 I think). but it is really easy to write that yourself, too. Just use store_party_size.
 
So, is there a simple way using the OpenBRF editor to alter where male hair meshes are positioned so I can put them on female characters? There's at least a couple in the base game (and at least one modded one) that I think would work for female hair, but when you put them into the game they sit way too high up.

If it's a super complicated thing, then I'll avoid it, but I figured I'd ask in case it was actually easier to do that my first instinct says it is.
 
UndeadDuke said:
PitchPL said:
(agent_set_visibility, <agent_id>, <value>),
Version 1.153+. Sets agent visibility. 0 for invisible, 1 for visible.
This makes character model invisible, but not for bots, they still know  where he is.

PitchPL said:
(agent_fade_out, <agent_id>)
This removes agent from scene so bots leave him indeed but player control is lost as well so it doesn't sound like a solution

I've tried also:
agent_set_scripted_destination, - agent stops after reaching it and does nothing. Not what I need.
agent_set_look_target_position, - it looks there but only for a second, then again at me. Not what I need.
agent_set_look_target_agent, - same as above

I once made a reading mark at your questions since I found it interesting. Now I am sorting my reading marks and found it again. Not sure if you are still interested in the answer but I have found this here from Efe and thought I give you still an answer: https://forums.taleworlds.com/index.php/topic,300160.0.html
 
Status
Not open for further replies.
Back
Top Bottom