Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Since I want to implement the "meet the guild master" option to the HYW mod I tried to get used to MB modding. I worked through the "Module System Documentation" but I encountered a poblem at "Part 2: Editing Module System Files" (http://forums.taleworlds.com/index.php/topic,11422.0.html)
I wanted to add "Mod_Town" as it is described in the tutorial. But after doing everything that ist mentioned in the tutorial, when executing the "build_module.bat" it says "NameError: name 'icon_new_icon' is not defined" and I won't see "Mod_Town" on the map and the log when I start a new game.

What am I doing wrong? Does it make sense to get into modding with this tutorial, because it seems to be outdated in some points (they are nearly five years old)?
Another thing that I don't understand is that I have things like
# NEW TOWNS:
# NORMANDY: Rouen, Caen, Bayeux, Coutances, Evreux, Avranches
# Brittany: Rennes, Nantes,
# Maine: Le Mans
# Anjou: Angers
in my "module_parties.py" which has to be caused by HYM although I have copied the content of "Native" into my "MyModule" folder in "\modules".
How does this come?
 
How do i check a party flag?

Setting them is rather simple, like: (party_set_flags, "p_main_party", pf_is_ship, 1),
but i missed the command to simple check it.

Thx in advance =)
 
Somebody said:
There is already one that degrades vassal-liege relations.
Code:
    #Individual lord political calculations
    #Check for lords without fiefs, auto-defections, etc
    (0.5,	
     [
...
(call_script, "script_troop_get_relation_with_troop", ":troop_no", ":faction_leader"),
(le, reg0, -75),
If you simply want to prevent them from defecting, change -75 to -300 or something or modify script_cf_troop_can_intrigue which gets checked afterwards. Otherwise, you can use (call_script, "script_troop_change_relation_with_troop", ":troop_no", ":faction_leader", value), before the relationship check.

So would, let's say,
(call_script, "script_troop_change_relation_with_troop", "trp_knight_1_1", "trp_kingdom_lord_1", 50)
add 50 to the relation between the lord and the king?
 
cuo said:
Since I want to implement the "meet the guild master" option to the HYW mod I tried to get used to MB modding. I worked through the "Module System Documentation" but I encountered a poblem at "Part 2: Editing Module System Files" (http://forums.taleworlds.com/index.php/topic,11422.0.html)
I wanted to add "Mod_Town" as it is described in the tutorial. But after doing everything that ist mentioned in the tutorial, when executing the "build_module.bat" it says "NameError: name 'icon_new_icon' is not defined" and I won't see "Mod_Town" on the map and the log when I start a new game.

What am I doing wrong? Does it make sense to get into modding with this tutorial, because it seems to be outdated in some points (they are nearly five years old)?
Another thing that I don't understand is that I have things like
# NEW TOWNS:
# NORMANDY: Rouen, Caen, Bayeux, Coutances, Evreux, Avranches
# Brittany: Rennes, Nantes,
# Maine: Le Mans
# Anjou: Angers
in my "module_parties.py" which has to be caused by HYM although I have copied the content of "Native" into my "MyModule" folder in "\modules".
How does this come?
Add your "new_icon" at the bottom of the module_map_icons file. Then compile; ignore the warnings for now. Then open up ID_map_icons.py and add your icon to the bottom, increasing the number with 1. Example: If the last line is "icon_town_a = 78", then add beneath it "icon_new_icon = 79" (these are not real values, I just made them up.)
About the interesting town names, forget it... It's the devs that've written this, it's not caused by HYW. You can simply do whatever you want with this comment or anything else historical. :smile:

Oh, and by the way: Search for "Jik's Module System Tutorial"... It's also a bit dated, but not as the official documentation.
EDIT: Link: http://forums.taleworlds.com/index.php?topic=56798.0

Hope this helps you!
 
Hi, I was wondering if someone could direct me to a list of the entry points used in game (especially in castle sieges)? I can't seem to find a simple list of which entry point number mean. Thanks :smile:
 
Lumos said:
Add your "new_icon" at the bottom of the module_map_icons file. Then compile; ignore the warnings for now. Then open up ID_map_icons.py and add your icon to the bottom, increasing the number with 1. Example: If the last line is "icon_town_a = 78", then add beneath it "icon_new_icon = 79" (these are not real values, I just made them up.)
About the interesting town names, forget it... It's the devs that've written this, it's not caused by HYW. You can simply do whatever you want with this comment or anything else historical. :smile:

Oh, and by the way: Search for "Jik's Module System Tutorial"... It's also a bit dated, but not as the official documentation.
EDIT: Link: http://forums.taleworlds.com/index.php?topic=56798.0

Hope this helps you!

Thanks for the explanation and the link. I appreciate this.
 
Does anyone know what version of Python is needed to compile the Warband ModSystem?
I have Windows XP, and currently Python 2.7.

Thanks in advance!  :mrgreen:
 
Can someone help me with this code: It is designed to "summon" a bot when pressing the "h" Key and welding a specified Item. And can someone maybe point me to a good tutorial about mission templates? For Example i dont really know what the secnd number means, i was once told it's some kind of delay before the result script is triggered when the condition is fulfilled.
The first number is the number of frames after that it checks if the conditionj is fulfilled. The third number is the number of seconds before it can be triggered again, is that right?
Code:
IT_summon_magic = (0,5,60,			
			[
				(key_clicked, key_h), #could use global var, game_key, or something - see list in header_triggers
				(get_player_agent_no, "$summoner_agent"),
				(agent_get_wielded_item, "$staff", "$summoner_agent", 0),		
					(try_begin),	
						(eq, "$staff", "itm_summon_staff_1"),
						(multiplayer_is_server),
						(get_player_agent_no, "$summoner_agent"),
#		       			(faction_set_slot,"fac_kingdom_3"  ,slot_dungeon_1_begin,"trp_dungeon_zombie"),
						(agent_get_team  ,":team", "$summoner_agent"),
						(store_current_scene, ":scene"),
						(modify_visitors_at_site, ":scene"),
						(add_visitors_to_current_scene, pos1, "trp_invader6_zomb_ai", 1, ":team", -1),
						(assign, "$skeleton_summon", 1),
					(try_end),
			],
				[
				(assign, "$skeleton_summon", 0),
				])
Just for you to know: The global variable is used in a script. If it is "1" when something spawns, that thing is set to the users position.

At this point: Is tehre any way to reset the timer (the "60" in my code i mean) to 0 so that it can be triggered again? Because if i use it for example in a battle round, and the round ends around ten seconds later, i am still not able to use it again next round. Hope you understand what i mean and can help me.
 
I think that's impossible... The triggers always used fixed integers for the time, which, AFAIK, are un-modifiable.
You could use something like "store_mission_timer_*" and store it somewhere, and check if it's more than 60, and then reset it with (reset_mission_timer_*). I personally used timers for the abilities in TBS (or will use, :lol:).

EDIT: about this, would a type cast to an integer in Python make the trigger accept the value of a global variable or a slot (or maybe its index, as it will only compile it once...)?
 
A couple of Q's:

1.
Is it possible to edit the armors so that they have different value for stopping blunt, cut and pierce damage?
((what is the point for different kind of damage types if the armors don't take any count?))

2.
Is it possible to add and define new entry points? Is it possible to have multiple same entry points (for troop spawn points in sieges as an example)

3.
Is it possible to have and scene prop that is destructible and when it is destroyed, another scene prop "replaces" it? Is this done in any released mod?

I hope someone can give an answer or an educated guess :smile:
 
prowokator said:
A couple of Q's:

1.
Is it possible to edit the armors so that they have different value for stopping blunt, cut and pierce damage?
((what is the point for different kind of damage types if the armors don't take any count?))
No, it's not possible, but the point is not that the armors determine the damage but the weapon type. Blunt ignores armour partially and so does pierce. This is determined by
Code:
armor_soak_factor_against_cut       = 0.8
armor_soak_factor_against_pierce    = 0.65
armor_soak_factor_against_blunt     = 0.5

armor_reduction_factor_against_cut       = 1.0
armor_reduction_factor_against_pierce    = 0.5
armor_reduction_factor_against_blunt     = 0.75
in the module.ini. A heavier armour still has more armour than a light one even though blunt and pierce remove some of that.
 
Question about bots in MP;

When you give a bot a firearm in MP, he can shoot, but you do not hear the sound of the shot. I searched over the forum and tried the scripts the Hunt mod used, but still, no result.

Does anyone knows if there is a way for this issue?

For the normal players I use the scripts from Yoshiboy's tutorial, here. Can I apply this bots too?
 
The scripts used in Hunt Mod don't take bots into account. What you have to do is store the agent id of the firer (trigger param 1), and check if it's a player. If it is, do the stuff in Hunt mod; if it's not, do this (you'll recognize it from the event handling script.
Code:
(get_max_players, ":num_players"),
          (try_for_range, ":cur_player", 0, ":num_players"),
            (player_is_active,":cur_player"),
            (multiplayer_send_2_int_to_player, ":cur_player", multiplayer_event_sound_at_player, <desired sound here>",":player_no"),
          (try_end),


 
Status
Not open for further replies.
Back
Top Bottom