Kolba
This is my second tutorial after "Creating new SP/parties" - http://forums.taleworlds.com/index.php/topic,53192.0.html.
We will start from really simple quest called "Relic". Let's start!
1. First open module_troops.py and add anywhere this line:
Let's analyse:
"antler" - is an ID name of troop. It won't be showed in game, since it's used only as a reference in other files.
Antler - is a name of troop. It will be showed in game.
Antler - plural name of troop. Not used for heroes, useful for single troops.
tf_hero - without that part of code, troop isn't hero. So yes, this is only for heroes.
scn_town_4_tavern - the scene where the hero will appear. If you want to change it, check module_parties.py for town list and then module_scenes.py for scene list.
entry(3) - entry point of troop in scene. You need to manually add it in edit-mode.
reserved - nothing interesting.
fac_commoners - the faction of troop. If you want to change it, check module_factions.py.
[itm_nomad_armor,itm_nomad_boots] - inventory of troop. You can add your own, just remember that you need to check module_items.py and add phrase "itm" before each item.
def_attrib - troop attributes.
level(2) - simply, level of troop.
wp(20) - number of weapon proficiences.
knows_common - skills of troop. You can add for example "knows_riding_2|knows_power_strike_4" etc.
0x00000000000430c701ea98836781647f - face code of troop. You can generate face code in in-game edit mode.
2. Let's add another troop:
Note that this hero have new faction "order_of_night". And other troop:
There is something to explain. For example "tf_guarantee_armor" - troop will always wear armor, "tf_guarantee_horse" - soldier will always be mounted etc.
3. Now let's go to module_factions.py and paste this line:
And as always - analyse!
order_of_night - ID of faction.
Order of Night - name of faction showing in-game.
0.5 - relations between members of this faction.
"player_faction",-1.0 - relations between another factions. In our example, the Order of Night will hate player.
4. Let's move to the biggest part of tutorial - module_dialogs.py. Under ramun_the_slave_trader dialogs paste those huge lines:
I am sorry, that I didn't explained anything here, but in the afternoon (now I am very busy) I'll add explanations. And excuse me, my language is not perfect, since I am 13 years old.
5. Now let's add the new item "relic". Open module_items.py and add following line:
You can add any item replacing "relic", but the best one is a book:
relic - ID name of item. Used as a reference in other .py files.
St. Grunwalder - name of item showing in game.
book_e - item mesh. Check the Native resources.
itp_type_book - type of item. In our example it's a book.
10000 - price of item in shops (in denars).
weight(2) - defines the weight of the item in kilogrammes.
abundance(100) - this stat governs how often the item will appear in merchant inventories and combat loot. 100 is standard; can be more or less than 100 (down to 0).
imodbits_none - item imodbits (for example cracked, bent etc.), not used for books.
6. And end of our tutorial. Paste those lines into the bottom of module_quests.py:
Build module, run game and walkthrought for you:
1. Go to Suno tavern.
2. Get a quest from Antler.
3. Raise a quite big army.
4. Patrol the terrains around Veidar.
5. Fight with Order of Night.
6. Persuade Thyr to get a relic.
7. Go back to Antler.
And that's everything! Yes, my language is poor, but I'll try to improve it and add polished version of tutorial.
Thanks for reading,
Kolba
We will start from really simple quest called "Relic". Let's start!
1. First open module_troops.py and add anywhere this line:
["antler","Antler","Antler",tf_hero, scn_town_4_tavern|entry(3),reserved, fac_commoners,[itm_nomad_armor,itm_nomad_boots],def_attrib|level(2),wp(20),knows_common,0x00000000000430c701ea98836781647f],
Let's analyse:
"antler" - is an ID name of troop. It won't be showed in game, since it's used only as a reference in other files.
Antler - is a name of troop. It will be showed in game.
Antler - plural name of troop. Not used for heroes, useful for single troops.
tf_hero - without that part of code, troop isn't hero. So yes, this is only for heroes.
scn_town_4_tavern - the scene where the hero will appear. If you want to change it, check module_parties.py for town list and then module_scenes.py for scene list.
entry(3) - entry point of troop in scene. You need to manually add it in edit-mode.
reserved - nothing interesting.
fac_commoners - the faction of troop. If you want to change it, check module_factions.py.
[itm_nomad_armor,itm_nomad_boots] - inventory of troop. You can add your own, just remember that you need to check module_items.py and add phrase "itm" before each item.
def_attrib - troop attributes.
level(2) - simply, level of troop.
wp(20) - number of weapon proficiences.
knows_common - skills of troop. You can add for example "knows_riding_2|knows_power_strike_4" etc.
0x00000000000430c701ea98836781647f - face code of troop. You can generate face code in in-game edit mode.
2. Let's add another troop:
["thyr","Thyr","Thyr",tf_hero,|tf_unkillable, no_scene,0, fac_order_of_night,[itm_great_axe,itm_black_armor,itm_winged_great_helmet,itm_nomad_boots,itm_charger],knight_attrib_1|level(30),wp(140),knows_common|knows_riding_6|knows_athletics_3|knows_ironflesh_2|knows_shield_2,man_face_younger_1, man_face_older_2],
Note that this hero have new faction "order_of_night". And other troop:
["guardian","Guardian","Guardian",tf_guarantee_armor|tf_guarantee_boots|tf_guarantee_horse|tf_guarantee_helmet,0,0,fac_order_of_night,
[itm_great_axe,itm_black_armor,itm_mail_coif,itm_nomad_boots,itm_charger],
knight_attrib_1|level(30),wp(140),knows_common|knows_riding_6|knows_athletics_3|knows_ironflesh_2|knows_shield_2,man_face_younger_1, man_face_older_2],
There is something to explain. For example "tf_guarantee_armor" - troop will always wear armor, "tf_guarantee_horse" - soldier will always be mounted etc.
3. Now let's go to module_factions.py and paste this line:
("order_of_night","Order of Night", 0, 0.5,[("player_faction",-1.0)], []),
And as always - analyse!
order_of_night - ID of faction.
Order of Night - name of faction showing in-game.
0.5 - relations between members of this faction.
"player_faction",-1.0 - relations between another factions. In our example, the Order of Night will hate player.
4. Let's move to the biggest part of tutorial - module_dialogs.py. Under ramun_the_slave_trader dialogs paste those huge lines:
[trp_antler, "start", [[eq,"$holy_relic",2]], "Greetings {playername}.","bye2",[]],
[trp_antler|plyr, "bye2", [], "Greetings to you too, Antler.","close_window",[]],
[trp_antler, "start", [[eq,"$holy_relic",1]], "Did you find the relic?","relic_find_question",[]],
[trp_antler|plyr, "relic_find_question", [(player_has_item,"itm_relic")], "Yes! It was quite difficult.", "relic_znaleziona",[(call_script,"script_end_quest","qst_relic")]],
[trp_antler|plyr, "relic_find_question", [], "No, not yet.", "close_window",[]],
[trp_antler, "relic_znaleziona", [], "Really? Well, congratulations {young man/lassie}! I decided to don't give you reward. This book is a reward. You can sell it in shops.","close_window",[[assign,"$holy_relic",2]]],
[trp_antler, "start", [[eq,"$holy_relic",0]], "Hello, {young man/lassie}! Are you looking for a job or something?", "god1",[]],
[trp_antler|plyr, "god1", [], "Yes!", "god2",[]],
[trp_antler, "god2", [], "Good. Do you heard anything about Order of Night? They're band of wandering bastards or fallen knights, led by Thyr. They recently raided Veluca monastery and stolen holy relic. Now, they should be resting near village of Veidar. Find them, kill everyone except Thyr. Then, persuade him to give you information about location of relic. I hope it's quite clearly. I'll pay you 2000 denars.", "god3",[]],
[trp_antler|plyr, "god3", [], "Allright, that's nice offer. I'll regain relic!", "godyes",[
(setup_quest_text, "qst_relic"),
(str_store_string, s2, "@A guy called Antler told me interesting story. Fallen Knights called Order of Night, recently raided Veluca monastery and stolen holy relic. I must find them and after battle, persuade their leader Thyr to give me holy relic. Those bastards, now should be near Veidar!"),
(call_script,"script_start_quest","qst_relic","trp_antler"), (set_spawn_radius,1),(spawn_around_party,"p_village_48","pt_order_of_night")]],
[trp_antler|plyr, "god3", [], "No, I don't have time for that!", "close_window",[]],
[trp_antler, "godyes", [], "Excellent!", "close_window",[[assign,"$holy_relic",1]]],
[party_tpl|pt_order_of_night,"start", [(eq,"$talk_context",tc_party_encounter)], "Hey, you there! What are you looking for?", "order2",[]],
[party_tpl|pt_order_of_night|plyr,"order2", [], "For a holy relic! Give me it, or I'll cut your throats!", "order3",[]],
[party_tpl|pt_order_of_night,"order3", [], "Hahaha! First give me four billion denars!", "order4",[]],
[party_tpl|pt_order_of_night|plyr,"order4", [], "Nice joke. Prepare to fight, cowards!", "close_window",[[encounter_attack]]],
[party_tpl|pt_order_of_night,"order2", [], "Nevermind...", "close_window",[(assign, "$g_leave_encounter",1)]],
[party_tpl|pt_order_of_night,"start", [(eq,"$talk_context",tc_hero_defeated)], "I yield! Please, don't kill me! I'll give you relic!","relikwia",[]],
[party_tpl|pt_order_of_night|plyr,"relikwia", [], "So, be it. Give me relic and I'll let you go.", "relikwia2",[]],
[party_tpl|pt_order_of_night,"relikwia2", [], "Here you are. But, please! Don't kill me!", "relikwia3",[(troop_add_item, "trp_player","itm_relic",)]],
[party_tpl|pt_order_of_night|plyr,"relikwia3", [], "That's not my bussines! Go on, you see the hills, over there? Run, run, or I'll change my mind!", "close_window",[(assign, "$g_leave_encounter",1)]],
I am sorry, that I didn't explained anything here, but in the afternoon (now I am very busy) I'll add explanations. And excuse me, my language is not perfect, since I am 13 years old.
5. Now let's add the new item "relic". Open module_items.py and add following line:
["relic","St. Grunwalder", [("book_e",0)], itp_type_book, 0, 10000,weight(2)|abundance(100),imodbits_none],
You can add any item replacing "relic", but the best one is a book:
relic - ID name of item. Used as a reference in other .py files.
St. Grunwalder - name of item showing in game.
book_e - item mesh. Check the Native resources.
itp_type_book - type of item. In our example it's a book.
10000 - price of item in shops (in denars).
weight(2) - defines the weight of the item in kilogrammes.
abundance(100) - this stat governs how often the item will appear in merchant inventories and combat loot. 100 is standard; can be more or less than 100 (down to 0).
imodbits_none - item imodbits (for example cracked, bent etc.), not used for books.
6. And end of our tutorial. Paste those lines into the bottom of module_quests.py:
("relic", "Find holy relic", qf_random_quest,
"A guy called Antler told me interesting story. Fallen Knights called Order of Night, recently raided Veluca monastery and stolen holy relic. I must find them and after battle, persuade their leader Thyr to give me holy relic. Those bastards, now should be near Veidar!"
),
Build module, run game and walkthrought for you:
1. Go to Suno tavern.
2. Get a quest from Antler.
3. Raise a quite big army.
4. Patrol the terrains around Veidar.
5. Fight with Order of Night.
6. Persuade Thyr to get a relic.
7. Go back to Antler.
And that's everything! Yes, my language is poor, but I'll try to improve it and add polished version of tutorial.
Thanks for reading,
Kolba