Skip to content
Snippets Groups Projects
Commit d407fa5f authored by Miniontoby's avatar Miniontoby :writing_hand_tone1:
Browse files

Added a spawn and 'worldgen'

parent c20e4f91
No related branches found
No related tags found
No related merge requests found
name = The Sam Story name = The Sam Story
author = Miniontoby author = Miniontoby
description = A by The Stanley Parable inspired Minetest game description = A by The Stanley Parable inspired Minetest game
allowed_mapgens = singlenode
disallowed_mapgens =
disallowed_mapgen_settings =
disabled_settings = creative_mode,enable_damage
Minetest-WorldEdit @ c223ca4c
Subproject commit c223ca4cec7cb17ddff30f3fd0a35a8c85ca42d5
local S = minetest.get_translator("blocks")
minetest.register_node("blocks:floor", {
description = S("Floor"),
tiles = {"blocks_floor.png"},
groups = {cracky = 1, level = 2},
})
name = blocks
description = The Sam Story Game mod: blocks
local S = minetest.get_translator("engine")
local playername = ''
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
local open = io.open
read_file = function(path)
local file = open(path, "rb")
if not file then return nil end
local content = file:read "*a"
file:close()
return content
end
load_spawn = function()
worldedit.deserialize({x = 0, y = 10, z = 0}, read_file(modpath .. "/schems/spawn.we"))
end
minetest.register_on_joinplayer(function(player)
player:set_physics_override({speed = 1})
player:set_pos({x = 2, y = 12, z = 2})
minetest.chat_send_player(player:get_player_name(), S("Use /start to start!"))
end)
minetest.after(1, function()
load_spawn()
end)
name = engine
description = The Sam Story Game mod: engine
depends = worldedit
5:return {{["x"] = 0, ["y"] = 0, ["z"] = 0, ["name"] = "blocks:floor"}, {["x"] = 0, ["y"] = 0, ["z"] = 1, ["name"] = "blocks:floor"}, {["x"] = 0, ["y"] = 0, ["z"] = 2, ["name"] = "blocks:floor"}, {["x"] = 0, ["y"] = 0, ["z"] = 3, ["name"] = "blocks:floor"}, {["x"] = 0, ["y"] = 0, ["z"] = 4, ["name"] = "blocks:floor"}, {["x"] = 1, ["y"] = 0, ["z"] = 0, ["name"] = "blocks:floor"}, {["x"] = 1, ["y"] = 0, ["z"] = 1, ["name"] = "blocks:floor"}, {["x"] = 1, ["y"] = 0, ["z"] = 2, ["name"] = "blocks:floor"}, {["x"] = 1, ["y"] = 0, ["z"] = 3, ["name"] = "blocks:floor"}, {["x"] = 1, ["y"] = 0, ["z"] = 4, ["name"] = "blocks:floor"}, {["x"] = 2, ["y"] = 0, ["z"] = 0, ["name"] = "blocks:floor"}, {["x"] = 2, ["y"] = 0, ["param1"] = 15, ["z"] = 1, ["name"] = "blocks:floor"}, {["x"] = 2, ["y"] = 0, ["param1"] = 15, ["z"] = 2, ["name"] = "blocks:floor"}, {["x"] = 2, ["y"] = 0, ["z"] = 3, ["name"] = "blocks:floor"}, {["x"] = 2, ["y"] = 0, ["z"] = 4, ["name"] = "blocks:floor"}, {["x"] = 3, ["y"] = 0, ["z"] = 0, ["name"] = "blocks:floor"}, {["x"] = 3, ["y"] = 0, ["param1"] = 15, ["z"] = 1, ["name"] = "blocks:floor"}, {["x"] = 3, ["y"] = 0, ["param1"] = 15, ["z"] = 2, ["name"] = "blocks:floor"}, {["x"] = 3, ["y"] = 0, ["z"] = 3, ["name"] = "blocks:floor"}, {["x"] = 3, ["y"] = 0, ["z"] = 4, ["name"] = "blocks:floor"}, {["x"] = 4, ["y"] = 0, ["z"] = 0, ["name"] = "blocks:floor"}, {["x"] = 4, ["y"] = 0, ["z"] = 1, ["name"] = "blocks:floor"}, {["x"] = 4, ["y"] = 0, ["z"] = 2, ["name"] = "blocks:floor"}, {["x"] = 4, ["y"] = 0, ["z"] = 3, ["name"] = "blocks:floor"}, {["x"] = 4, ["y"] = 0, ["z"] = 4, ["name"] = "blocks:floor"}}
\ No newline at end of file
local S = minetest.get_translator("narrator")
narrator = {tracks = {}, locations = {}}
narrator.tracks = {{name="lobby", length=60, lengthhr="1:00"}}
local playername = ''
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
narrator.get_sound_from_text = function(textid)
id = nill
for pid in pairs(narrator.tracks) do
if narrator.tracks[pid].name == textid then
id = pid
minetest.log("[narrator] Found id: ".. id)
end
end
if id == nil then
return false
end
local track=narrator.tracks[id]
if not track then
return false
end
return track
end
narrator.play_track = function(sid)
local track = narrator.get_sound_from_text(sid)
if not track then return end
local player = minetest.get_player_by_name(playername)
if narrator.playing then
narrator.stop_track()
else
local handle = minetest.sound_play(track.name, {to_player=player, gain=1})
if handle then
narrator.handles = handle
end
end
narrator.playing = id
narrator.track_time_left = track.length
end
narrator.stop_track = function()
minetest.sound_stop(narrator.handles)
narrator.playing=false
narrator.handles=nil
narrator.track_time_left = 0
end
minetest.register_chatcommand("start", {
params = "",
description = "Starts game",
privs = {shout = true},
func = function(name)
playername = name
narrator.play_track("lobby")
end
})
name = narrator
description = The Sam Story Game mod: narrator
depends = worldedit
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment