From 6a42edb5158c426d9009104db9fa536309d15156 Mon Sep 17 00:00:00 2001 From: cale Date: Tue, 12 Apr 2016 19:04:48 +0200 Subject: [PATCH] added tutorial quest --- mods/character_editor/init.lua | 3 --- mods/story/api.lua | 3 +++ mods/story/parts/quests.conf | 4 ++-- mods/story/parts/tutorial_1.dialog | 9 ++++++++ mods/story/parts/tutorial_1.quest | 15 +++++++++++++ mods/story/parts/tutorial_1_2.dialog | 5 +++++ mods/story/parts/tutorial_1_3.dialog | 19 ++++++++++++++++ mods/story/parts/tutorial_1_4.dialog | 13 +++++++++++ mods/story/parts/tutorial_2.quest | 1 + mods/village/init.lua | 27 +++++++++++++++++++++++ mods/village/textures/village_create.png | Bin 0 -> 291 bytes 11 files changed, 94 insertions(+), 5 deletions(-) create mode 100644 mods/story/parts/tutorial_1.dialog create mode 100644 mods/story/parts/tutorial_1.quest create mode 100644 mods/story/parts/tutorial_1_2.dialog create mode 100644 mods/story/parts/tutorial_1_3.dialog create mode 100644 mods/story/parts/tutorial_1_4.dialog create mode 100644 mods/story/parts/tutorial_2.quest create mode 100644 mods/village/textures/village_create.png diff --git a/mods/character_editor/init.lua b/mods/character_editor/init.lua index efb01f4..8056cd1 100644 --- a/mods/character_editor/init.lua +++ b/mods/character_editor/init.lua @@ -67,9 +67,6 @@ minetest.register_on_joinplayer(function(player) character_editor.mesh[player:get_player_name()] = "character.x" character_editor.characters[player:get_player_name()] = {} character_editor.set_texture(player, 1, "character.png") -end) - -minetest.register_on_newplayer(function(player) character_editor.show_window(player) end) diff --git a/mods/story/api.lua b/mods/story/api.lua index 0c483df..5b6beeb 100644 --- a/mods/story/api.lua +++ b/mods/story/api.lua @@ -297,6 +297,9 @@ function story.generator.run(part, player, line_pos) out = {part="", wait=false, quit=true} return out end + if cmd[1] == "$give" and cmd[2] and cmd[3] then + player:get_inventory():add_item("main", cmd[2].. " " .. cmd[3]) + end end end i = i +1 diff --git a/mods/story/parts/quests.conf b/mods/story/parts/quests.conf index 926516c..2e39b49 100644 --- a/mods/story/parts/quests.conf +++ b/mods/story/parts/quests.conf @@ -1,3 +1,3 @@ -lvl1=quest_1,quest_2,quest_3 -lvl2=quest_1,quest_2,quest_3,quest_4 +lvl1=tutorial_1 +lvl2=quest_3,quest_2 lvl3=quest_5,quest_6 diff --git a/mods/story/parts/tutorial_1.dialog b/mods/story/parts/tutorial_1.dialog new file mode 100644 index 0000000..f6d0c5e --- /dev/null +++ b/mods/story/parts/tutorial_1.dialog @@ -0,0 +1,9 @@ +Kai : I havent seen you before, are you new here? +You : Yes, I heard that this is a city where many adventurers live. +Kai : That is right. +Kai : You dont have some basic materials with you to build a house, have you? +You : no, not yet +Kai : Ok, I think you should get some stones - they lay on the floor. +Kai : I have some wood for you. +You : Thank you :D +Kai : Come back when you have some stones. diff --git a/mods/story/parts/tutorial_1.quest b/mods/story/parts/tutorial_1.quest new file mode 100644 index 0000000..30dbafa --- /dev/null +++ b/mods/story/parts/tutorial_1.quest @@ -0,0 +1,15 @@ +$dialog tutorial_1 +$wait +$give default:wood 5 +$quest dignode default:stones_on_floor 3 10 +$wait quest +$dialog tutorial_1_2 +$wait +$quest placenode default:workbench 1 7 +$wait quest +$dialog tutorial_1_3 +$wait +$give default:grass 9 +$dialog tutorial_1_4 +$wait +$quit diff --git a/mods/story/parts/tutorial_1_2.dialog b/mods/story/parts/tutorial_1_2.dialog new file mode 100644 index 0000000..45e1b79 --- /dev/null +++ b/mods/story/parts/tutorial_1_2.dialog @@ -0,0 +1,5 @@ +Kai : Great, It seems like you got some stones :) +You : Yes +Kai : You should craft a workbench out of the wood I gave you before. +Kai : To craft a workbench put 3 wood into your hand crafting (press I to open your inventory)! +Kai : After that, you should place the workbench on the floor. diff --git a/mods/story/parts/tutorial_1_3.dialog b/mods/story/parts/tutorial_1_3.dialog new file mode 100644 index 0000000..c80d1a8 --- /dev/null +++ b/mods/story/parts/tutorial_1_3.dialog @@ -0,0 +1,19 @@ +Kai : Now, just craft some strings. Like this : + + G G G + - - - + - - - + + G : Grass + - : nothing + +Kai : after that you need to craft a strong string: + + S S S + - - - + - - - + + S : String + - : nothing + +Kai : Now, craft some sticks out of one wood. diff --git a/mods/story/parts/tutorial_1_4.dialog b/mods/story/parts/tutorial_1_4.dialog new file mode 100644 index 0000000..c0514e3 --- /dev/null +++ b/mods/story/parts/tutorial_1_4.dialog @@ -0,0 +1,13 @@ +Kai : You can craft a stone axe now! + + - A - + - B - + - C - + + A : Stone + B : String (strong) + C : Stick + +Kai : With a stone axe you can dig trees! +Kai : You also can use it to get more stones (from caves). +You : Thank you very much for your help :) diff --git a/mods/story/parts/tutorial_2.quest b/mods/story/parts/tutorial_2.quest new file mode 100644 index 0000000..99e8714 --- /dev/null +++ b/mods/story/parts/tutorial_2.quest @@ -0,0 +1 @@ +$quit diff --git a/mods/village/init.lua b/mods/village/init.lua index ac42f33..5a82a48 100644 --- a/mods/village/init.lua +++ b/mods/village/init.lua @@ -107,3 +107,30 @@ minetest.register_decoration({ decoration = "village:spawn", }) + +-- after start game +minetest.register_on_joinplayer(function(player) + if not places.pos["home_village"] and minetest.get_player_privs(player:get_player_name()).server then + minetest.chat_send_player(player:get_player_name(), "Choose a point for the home village!") + minetest.chat_send_player(player:get_player_name(), "Try to find a grassland biome - the start is much easier there :)") + minetest.chat_send_player(player:get_player_name(), "The biome should be flat.") + player:get_inventory():add_item("main", "village:create_start_game") + end +end) + +minetest.register_craftitem("village:create_start_game", { + description = "Create Home Village", + inventory_image = "village_create.png", + + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type == "node" then + village.gen(pointed_thing.above) + itemstack:take_item() + places.pos["home_village"] = pointed_thing.above + placer:setpos(pointed_thing.above) + places.save_places() + end + return itemstack + end, +}) + diff --git a/mods/village/textures/village_create.png b/mods/village/textures/village_create.png new file mode 100644 index 0000000000000000000000000000000000000000..613b2f9b862a8f5e64d1a385a9420b1783f96a84 GIT binary patch literal 291 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPN3lG0FLy!hTJWxoo#5JPCIX^cyHLrxhxhOTUBsE2$ zJhLQ2!QIn0AiR-J9H^+<)5S5w;`G}|ihKVB&Pj}OmiFz83esEgMEf_>=Pe4;=d1SJWLZ=bT`=`|>d`%GuI@h5S^i;~8#hnw e_qRg#H!=QU_dnvZb1%?e3=E#GelF{r5}E*SHD=WS literal 0 HcmV?d00001