Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
@TheVideoGameInn make a folder called 'output'; put it inside module system folder. Open module_info and put export_dir = "output/". Compile the mod. Open 'output' folder and copy all files. Now open your mod folder and paste all those files that you copied earlier. Test the game. Tell us if it works.
 
Well, call me a Nord's uncle, it worked!

Thanks so much! That was an ingenious idea I hadn't though of. I guess it's probably permissions, my computer usually gets worked up about that (though curiously my user is admin).

In any case, cheers, I'll make sure to name an in game sword after you.
 
Lex Hugs Pandas set the team of neutral agents to -1 they won't react to anything (unless scripted)
I have got agents to spawn in on multiplayer during testing of an OSP I'm working on but what would happen when someone joins the scene if it would sync the current agents or spawn new ones or both.
I'm using the spawn_agent script so far as I couldn't seem to get agents to appear using anything else (novice scripter).

OSP link below, just information no demo yet.
http://forums.taleworlds.com/index.php/topic,317313.msg7529612.html#msg7529612
 
ShaunRemo said:
Lex Hugs Pandas set the team of neutral agents to -1 they won't react to anything (unless scripted)
I have got agents to spawn in on multiplayer during testing of an OSP I'm working on but what would happen when someone joins the scene if it would sync the current agents or spawn new ones or both.
I'm using the spawn_agent script so far as I couldn't seem to get agents to appear using anything else (novice scripter).

OSP link below, just information no demo yet.
http://forums.taleworlds.com/index.php/topic,317313.msg7529612.html#msg7529612
Wow thank you this looks so helpful, how come it only has 900 views, should have more.
 
ShaunRemo said:
what would happen when someone joins the scene if it would sync the current agents or spawn new ones or both.

The server automatically syncs the agents with the players.
Note that you should not use any spawn operation client side (I know that spawning an item client side will crash the client game).

Another way of spawning an (or more) agent(s) is:
Code:
(store_current_scene, ":cur_scene"), 
(modify_visitors_at_site, ":cur_scene"),
(add_visitors_to_current_scene, <entry_no>,<troop_id>,<number_of_troops>, <team_no>, <group_no>),
## <group_no> represents who can order the agent to do stuffs (it can be a player id (so the player can give orders like charge or hold) or can be 0(which represents the server; in case of a dedicated server, the bots will listen to no one))
 
Here is my mission template:

Code:
   (
    "ai_training_modified",mtf_battle_mode,-1,
    "You start training.",
    [
    (0,mtef_scene_source|mtef_team_0,af_override_all,aif_start_alarmed,1,[]),
     (1,mtef_scene_source|mtef_team_1,af_override_all,aif_start_alarmed,1,[]),
     (2,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (3,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (4,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (5,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (6,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (7,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (8,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (9,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (10,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (11,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (12,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (13,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (14,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (15,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (16,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (17,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (18,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (19,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (20,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (21,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (22,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (23,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (24,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (25,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (26,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (27,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (28,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     ],
    [
      
     (ti_before_mission_start, 0, 0, [], [
	 
	 (store_current_scene, ":cur_scene"),
	 (try_begin),
		 (eq,":cur_scene","scn_mod_test_map_1"),
		 (set_fog_distance, 10, 0xFF000000),
	 (else_try),
		(eq,":cur_scene","scn_mod_test_map_2"),
		(set_fog_distance, 10, 0xFFFF0000),
	 (else_try),
		(eq,":cur_scene","scn_mod_test_map_3"),
		(set_fog_distance, 10, 0xFFFFFF00),
	 (try_end),
	 
	 (mission_disable_talk),
	 

	
	(display_message,"@test 1",0x0000FF00),
	
	 ]),
	 
	       (ti_on_agent_spawn, 0, 0, [],
       [
		 (store_trigger_param_1, ":agent_no"),
         (agent_get_troop_id, ":troop_no", ":agent_no"),
		 (try_begin), 
			(eq, ":troop_no", "trp_player"),
			(agent_set_no_death_knock_down_only, ":agent_no", 1),
		 (try_end),
		 
         ]),
		 
		 (0, 0, 1, [], [

	#(team_set_relation, 1, 0, -1),

	(try_for_agents, ":agent"), 
		(agent_is_alive, ":agent"), 
		(agent_is_human, ":agent"),
			(try_begin),
				(agent_is_non_player, ":agent"),  
				(agent_get_position,pos12,":agent"),
				(agent_set_team,":agent",1),
				(set_show_messages, 0),
				(team_give_order, 1, grc_everyone, mordr_hold),
				(set_show_messages, 1),
				(team_set_order_position, 1, grc_everyone, pos12),
			(else_try),
				(agent_get_position,pos11,":agent"),
				(agent_set_team,":agent",0),
			(try_end),
		(get_distance_between_positions_in_meters, ":dist",  pos11, pos12),
			(try_begin),
			  (le, ":dist", 2),
			  (display_message,"@test 2",0x0000FF00),
			  (particle_system_burst, "psys_roket_yanma_1", pos12, 75),
			  (set_show_messages, 0),
			  (team_give_order, 1, grc_everyone, mordr_charge),
			  (set_show_messages, 1),
			  (agent_force_rethink, ":agent"),
			(try_end),
	(try_end),
		 ]),
	 
	(ti_on_agent_knocked_down, 0, 0, [],
       [    
			(get_player_agent_no, ":player_agent"),
			(agent_set_hit_points, ":player_agent", 100),	
		    (entry_point_get_position, pos10, 0),
	        (agent_set_position, ":player_agent", pos10),
	]),
	 
      (ti_tab_pressed, 0, 0, [],
       [(finish_mission,0)]),

      common_battle_order_panel,
      common_battle_order_panel_tick,
    ],
  ),

Agents just waits. How can I correct this mission template?
 
Tüfekçi Başı said:
Here is my mission template:

Code:
   (
    "ai_training_modified",mtf_battle_mode,-1,
    "You start training.",
    [
    (0,mtef_scene_source|mtef_team_0,af_override_all,aif_start_alarmed,1,[]),
     (1,mtef_scene_source|mtef_team_1,af_override_all,aif_start_alarmed,1,[]),
     (2,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (3,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (4,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (5,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (6,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (7,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (8,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (9,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (10,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (11,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (12,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (13,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (14,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (15,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (16,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (17,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (18,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (19,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (20,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (21,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (22,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (23,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (24,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (25,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (26,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (27,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     (28,mtef_visitor_source|mtef_team_1,af_override_horse,aif_start_alarmed,1,[]),
     ],
    [
      
     (ti_before_mission_start, 0, 0, [], [
	 
	 (store_current_scene, ":cur_scene"),
	 (try_begin),
		 (eq,":cur_scene","scn_mod_test_map_1"),
		 (set_fog_distance, 10, 0xFF000000),
	 (else_try),
		(eq,":cur_scene","scn_mod_test_map_2"),
		(set_fog_distance, 10, 0xFFFF0000),
	 (else_try),
		(eq,":cur_scene","scn_mod_test_map_3"),
		(set_fog_distance, 10, 0xFFFFFF00),
	 (try_end),
	 
	 (mission_disable_talk),
	 

	
	(display_message,"@test 1",0x0000FF00),
	
	 ]),
	 
	       (ti_on_agent_spawn, 0, 0, [],
       [
		 (store_trigger_param_1, ":agent_no"),
         (agent_get_troop_id, ":troop_no", ":agent_no"),
		 (try_begin), 
			(eq, ":troop_no", "trp_player"),
			(agent_set_no_death_knock_down_only, ":agent_no", 1),
		 (try_end),
		 
         ]),
		 
		 (0, 0, 1, [], [

	#(team_set_relation, 1, 0, -1),

	(try_for_agents, ":agent"), 
		(agent_is_alive, ":agent"), 
		(agent_is_human, ":agent"),
			(try_begin),
				(agent_is_non_player, ":agent"),  
				(agent_get_position,pos12,":agent"),
				(agent_set_team,":agent",1),
				(set_show_messages, 0),
				(team_give_order, 1, grc_everyone, mordr_hold),
				(set_show_messages, 1),
				(team_set_order_position, 1, grc_everyone, pos12),
			(else_try),
				(agent_get_position,pos11,":agent"),
				(agent_set_team,":agent",0),
			(try_end),
		(get_distance_between_positions_in_meters, ":dist",  pos11, pos12),
			(try_begin),
			  (le, ":dist", 2),
			  (display_message,"@test 2",0x0000FF00),
			  (particle_system_burst, "psys_roket_yanma_1", pos12, 75),
			  (set_show_messages, 0),
			  (team_give_order, 1, grc_everyone, mordr_charge),
			  (set_show_messages, 1),
			  (agent_force_rethink, ":agent"),
			(try_end),
	(try_end),
		 ]),
	 
	(ti_on_agent_knocked_down, 0, 0, [],
       [    
			(get_player_agent_no, ":player_agent"),
			(agent_set_hit_points, ":player_agent", 100),	
		    (entry_point_get_position, pos10, 0),
	        (agent_set_position, ":player_agent", pos10),
	]),
	 
      (ti_tab_pressed, 0, 0, [],
       [(finish_mission,0)]),

      common_battle_order_panel,
      common_battle_order_panel_tick,
    ],
  ),

Agents just waits. How can I correct this mission template?

"ai_training_modified",mtf_battle_mode,-1,

Change this like that:

mtf_arena_fight|mtf_commit_casualties,-1,

I'm not sure if it works, better wait an answer from someone who has more knowledge about mission templates.
 
For instance, I made a new warrider logo which normally seems like this in the game:

images

It's in the CommonRes file, so not related to Native. My question is if I add a Resource file including my warrider logo to my mod, which logo someone else playing my mod sees in the game? I mean is it enough to name my logo warrider_logo and put it to my mod's Resource file (with its texture of course) for changing the current one?
 
They start as enemy and they charges me. I said them "hold" first. They will charge me if I come closer them 2 meters.
I put this.
Code:
(team_give_order, 1, grc_everyone, mordr_charge),

But not. :sad:

I sure I have a mistake but I cannot see my mistake. :sad:
 
Hello, I have a couple questions:

First question: This is really bugging me, in the module_mission_templates it has under the team death match section the following line of code:
Code:
           (call_script, "script_multiplayer_find_spawn_point", ":player_team", 1, ":is_horseman"),
But when I look this line up in module_scripts the only script which comes up is "script_multiplayer_find_spawn_point_2", does this mean the above line of code is useless?

Second question: I still don't really understand what 'slots' are all about, this is the explanation given in the official 'Module System Tutorial':
Another powerful tool defined in the constants section is the use of slots. Slots can be assigned to any tuple object (troops, factions, parties, quest,
etc) and can store a specific value that is used by all in that object type. Let’s look at where the definition for quest slots are listed:
Code:
########################################################
## QUEST SLOTS #############################
########################################################
slot_quest_target_center = 1
slot_quest_target_troop = 2
slot_quest_target_faction = 3
slot_quest_object_troop = 4
##slot_quest_target_troop_is_prisoner = 5
slot_quest_giver_troop = 6
slot_quest_object_center = 7
slot_quest_target_party = 8
slot_quest_target_party_template = 9
slot_quest_target_amount = 10
slot_quest_current_state = 11
slot_quest_giver_center = 12
slot_quest_target_dna = 13
slot_quest_target_item = 14
slot_quest_object_faction = 15
slot_quest_convince_value = 19
slot_quest_importance = 20
slot_quest_xp_reward = 21
slot_quest_gold_reward = 22
slot_quest_expiration_days = 23
slot_quest_dont_give_again_period = 24
slot_quest_dont_give_again_remaining_days = 25
########################################################
On the left side of the ‘=’ are the names given to each slot. The slot number is on the right side of the ‘=’. The names make it easier to know what the
slot is used for. To be specific, “slot_quest_xp_reward” is used by native code to store how much XP you get from completing the quest. When
referencing this value, you can either reference it as slot_quest_xp_reward, or by the number 21. When looking through the code it’s easier to
understand the name over the number.
As we get into creating the quest, we will be using some of these slots for our quest. This way, the value can be set in one place, and if it needs to be
changed we only need to change it in one place. The other benefit is that if the player has more than 1 quest active, we don’t have to worry that we
might be over-writing variables we defined. Each quest (like all tuple objects) has its own slots.
So is a way to think about slots like they are a like a sort of 'interplanetary' variable,  where a local variable is only used in a tuple, a global variable is used in a document and an 'interplanetary' variable is used across the module system?
 
Hello, I'm currently starting out modding in warband, I'm currently am tinkering with morgh's editor on troop text files but I'm still trying to understand the module system and where to start out making a mod out of native.


1) I take it that the module system is where you script everything where outputs all the unreadable text files, and that it's a system where it compiles your input so that you can extract the contents onto say, a Native copy?

2) I'm starting out on creating a new map, and troops. I'm getting the hang of using Morgh's editor with troops, factions and items, but have no idea how to start on others.  Might I ask the experienced modders here to point me to a direction into modding?
 
Johao said:
Hello, I'm currently starting out modding in warband, I'm currently am tinkering with morgh's editor on troop text files but I'm still trying to understand the module system and where to start out making a mod out of native.


1) I take it that the module system is where you script everything where outputs all the unreadable text files, and that it's a system where it compiles your input so that you can extract the contents onto say, a Native copy?

2) I'm starting out on creating a new map, and troops. I'm getting the hang of using Morgh's editor with troops, factions and items, but have no idea how to start on others.  Might I ask the experienced modders here to point me to a direction into modding?

first steps (sticky thread): http://forums.taleworlds.com/index.php/topic,240255.0.html
then visit tutorial section http://forums.taleworlds.com/index.php/board,171.0.html, tools section and scene thread http://forums.taleworlds.com/index.php/topic,163368.0.html
 
Johao said:
1) I take it that the module system is where you script everything where outputs all the unreadable text files, and that it's a system where it compiles your input so that you can extract the contents onto say, a Native copy?
That is correct.
Johao said:
2) I'm starting out on creating a new map, and troops. I'm getting the hang of using Morgh's editor with troops, factions and items, but have no idea how to start on others.  Might I ask the experienced modders here to point me to a direction into modding?
I am pretty new to modding as well, but have you read this:
http://forums.taleworlds.com/index.php/topic,56798.0.html
I found this really useful, especially for creating single player mods.
 
Tüfekçi Başı said:
They start as enemy and they charges me. I said them "hold" first. They will charge me if I come closer them 2 meters.
I put this.
Code:
(team_give_order, 1, grc_everyone, mordr_charge),

But not. :sad:

I sure I have a mistake but I cannot see my mistake. :sad:

Your trigger 0,0,1->tells them to hold all the time. Also even if they start charging, they will immediately start holding.
 
@kalarhan
Thanks but I've already checked the intro guide. Guess I couldn't really understand that bit well. The sceners thread would certainly be helpful though

@Lex
Thanks for the link too

Well, I've headbutted into another problem here. Redownloaded the module system, double checked the bloody python link path in computer properties, and I'm still not getting things right, even with the folder in the desktop, even opening the .bat file as admin. Can someone give me a hand here on this error?

Excuse the long post.


python: can't open file 'process_init.py': [Errno 2] No such file or directory
python: can't open file 'process_global_variables.py': [Errno 2] No such file or
directory
python: can't open file 'process_strings.py': [Errno 2] No such file or director
y
python: can't open file 'process_skills.py': [Errno 2] No such file or directory

python: can't open file 'process_music.py': [Errno 2] No such file or directory
python: can't open file 'process_animations.py': [Errno 2] No such file or direc
tory
python: can't open file 'process_meshes.py': [Errno 2] No such file or directory

python: can't open file 'process_sounds.py': [Errno 2] No such file or directory

python: can't open file 'process_skins.py': [Errno 2] No such file or directory
python: can't open file 'process_map_icons.py': [Errno 2] No such file or direct
ory
python: can't open file 'process_factions.py': [Errno 2] No such file or directo
ry
python: can't open file 'process_items.py': [Errno 2] No such file or directory
python: can't open file 'process_scenes.py': [Errno 2] No such file or directory

python: can't open file 'process_troops.py': [Errno 2] No such file or directory

python: can't open file 'process_particle_sys.py': [Errno 2] No such file or dir
ectory
python: can't open file 'process_scene_props.py': [Errno 2] No such file or dire
ctory
python: can't open file 'process_tableau_materials.py': [Errno 2] No such file o
r directory
python: can't open file 'process_presentations.py': [Errno 2] No such file or di
rectory
python: can't open file 'process_party_tmps.py': [Errno 2] No such file or direc
tory
python: can't open file 'process_parties.py': [Errno 2] No such file or director
y
python: can't open file 'process_quests.py': [Errno 2] No such file or directory

python: can't open file 'process_info_pages.py': [Errno 2] No such file or direc
tory
python: can't open file 'process_scripts.py': [Errno 2] No such file or director
y
python: can't open file 'process_mission_tmps.py': [Errno 2] No such file or dir
ectory
python: can't open file 'process_game_menus.py': [Errno 2] No such file or direc
tory
python: can't open file 'process_simple_triggers.py': [Errno 2] No such file or
directory
python: can't open file 'process_dialogs.py': [Errno 2] No such file or director
y
python: can't open file 'process_global_variables_unused.py': [Errno 2] No such
file or directory
python: can't open file 'process_postfx.py': [Errno 2] No such file or directory

Could Not Find C:\Windows\system32\*.pyc

______________________________

Script processing has ended.
Press any key to exit. . .
 
Lex Hugs Pandas said:
So is a way to think about slots like they are a like a sort of 'interplanetary' variable,  where a local variable is only used in a tuple, a global variable is used in a document and an 'interplanetary' variable is used across the module system?

almost, if you are familiar with C programming or sth similar, the slots or constants are used just like a "#define ABCDE 1", the compiller itself writes "1" whenever you write "ABCDE" in the code, the global and local variables are used by the game itself, globals being acessible anywhere and locals only in their correspondent block code(tuple)
 
Status
Not open for further replies.
Back
Top Bottom