(sprite "images/creatures/dummyguy/dummyguy.sprite")
)
(init-script "
- import(\"levels/test/default.nut\");
intro();
")
)
(sector
(name "main")
(init-script "
- import(\"levels/test/default.nut\");
intro();
")
(gravity 10.000000)
(author "slacker")
(sector
(name "main")
- (init-script "import(\"levels/world2/default.nut\");
-AIRHINT.set_action(\"outline\");
-EARTHHINT.set_action(\"outline\");
-WOODHINT.set_action(\"outline\");")
+ (init-script "
+ AIRHINT.set_action(\"outline\");
+ EARTHHINT.set_action(\"outline\");
+ WOODHINT.set_action(\"outline\");")
(ambient-light 1 1 1)
(spawnpoint
(name "main")
(image "images/tiles/doodads/iceshrub.png")
)
(dispenser
- (cycle 1)
+ (cycle 2)
(x 3843)
(y 709)
+ (random #t)
+ (type "cannon")
(badguy "kamikazesnowball")
)
(fish
(license "GPL 2+ / CC-by-sa 3.0")
(sector
(name "main")
- (init-script "import(\"levels/test/transition.nut\");")
(ambient-light 0.7022965 0.8745861 1)
(ambient_sound
(sample "sounds/rain.wav")
(sector
(name "main")
(music "music/forest2.ogg")
- (init-script "import(\"levels/world2/default.nut\" );")
(ambient-light 1 1 1)
(background
(x 4000)
(sector
(name "main")
(music "music/forest.music")
- (init-script "import(\"levels/world2/default.nut\");")
(ambient-light 1 1 1)
(background
(y 1500)
(sector
(name "main")
(music "music/forest2.ogg")
- (init-script "import(\"levels/world2/default.nut\")")
(ambient-light 1 1 1)
(background
(x 4000)
(sector
(name "main")
(music "music/forest.music")
- (init-script "import(\"levels/world2/default.nut\");")
(ambient-light 1 1 1)
(background
(y 420)
(sector
(name "main")
(music "music/forest2.ogg")
- (init-script "import(\"levels/world2/default.nut\");")
(ambient-light 1 1 1)
(background
(x 3300)
(sector
(name "main")
(music "music/forest.music")
- (init-script "import(\"levels/world2/default.nut\");")
(ambient-light 1 1 1)
(background
(x 4000)
(sector
(name "secret")
(music "music/cave.ogg")
- (init-script "import(\"levels/world2/default.nut\");")
(ambient-light 1 1 1)
(background
(speed 0.5)
(license "GPL 2+ / CC-by-sa 3.0")
(sector
(name "main")
- (init-script "
- import(\"levels/world2/default.nut\");
- ")
(ambient-light 1 1 1)
(background
(x 500)
(license "GPL 2+ / CC-by-sa 3.0")
(sector
(name "main")
- (init-script "
- import(\"levels/world2/default.nut\");
- ")
(ambient-light 1 1 1)
(background
(speed 0.5)
(license "GPL 2+ / CC-by-sa 3.0")
(sector
(name "main")
- (init-script "
- import(\"levels/world2/default.nut\");
- ")
(ambient-light 1 1 1)
(background
(speed 0.5)
(license "GPL 2+ / CC-by-sa 3.0")
(sector
(name "main")
- (init-script "
- import(\"levels/world2/default.nut\");
- ")
(ambient-light 1 1 1)
(background
(speed 0.5)
(license "GPL 2+ / CC-by-sa 3.0")
(sector
(name "main")
- (init-script "
- import(\"levels/world2/default.nut\");
- ")
(ambient-light 1 1 1)
(background
(speed 0.5)
(sector
(name "main")
(music "music/forest.music")
- (init-script "import(\"levels/world2/default.nut\");")
(ambient-light 1 1 1)
(background
(x 4000)
(sector
(name "main")
(music "music/forest2.ogg")
- (init-script "import(\"levels/world2/default.nut\");")
(ambient-light 1 1 1)
(ambient_sound
(sample "sounds/rain.wav")
(sector
(name "main")
(music "music/forest.music")
- (init-script "
- import(\"levels/world2/default.nut\");
- ")
(ambient-light 1 1 1)
(background
(y 500)
(sector
(name "main")
(music "music/forest2.ogg")
- (init-script "import(\"levels/world2/default.nut\");")
(ambient-light 1 1 1)
(background
(y 650)
(sector
(name "tree house")
(music "music/forest.music")
- (init-script "import(\"levels/world2/default.nut\");")
(ambient-light 1 1 1)
(background
(speed 0.5)
(sector
(name "main")
(music "music/forest3.ogg")
- (init-script "import(\"levels/world2/default.nut\");
-AIRHINT.set_action(\"outline\");
-EARTHHINT.set_action(\"outline\");
-WOODHINT.set_action(\"outline\");")
+ (init-script "
+ AIRHINT.set_action(\"outline\");
+ EARTHHINT.set_action(\"outline\");
+ WOODHINT.set_action(\"outline\");")
(ambient-light 1 1 1)
(camera
(mode "normal")
(sector
(name "main")
(music "music/forest.music")
- (init-script "import(\"levels/world2/default.nut\");")
(ambient-light 1 1 1)
(background
(x 200)
(sector
(name "main")
(music "music/forest.music")
- (init-script "import( \"levels/world2/default.nut\" );")
(ambient-light 1 1 1)
(ambient_sound
(sample "sounds/saw.wav")
(sector
(name "main")
(music "music/forestmap.ogg")
- (init-script "import(\"levels/world2/default.nut\");")
(ambient-light 1 1 1)
(special-tile
(invisible-tile #t)
Level::load(const std::string& filepath)
{
try {
+ filename = filepath;
lisp::Parser parser;
const lisp::Lisp* root = parser.parse(filepath);
std::string author;
std::string contact;
std::string license;
+ std::string filename;
std::string on_menukey_script;
Sectors sectors;
Statistics stats;
#include "lisp/writer.hpp"
#include "lisp/list_iterator.hpp"
#include "tile.hpp"
+#include "file_system.hpp"
+#include "physfs/physfs_stream.hpp"
#include "audio/sound_manager.hpp"
#include "game_session.hpp"
#include "resources.hpp"
camera->reset(player->get_pos());
update_game_objects();
+ //Run default.nut just before init script
+ //Check to see if it's in a levelset (info file)
+ std::string basedir = FileSystem::dirname(get_level()->filename);
+ if(PHYSFS_exists((basedir + "/info").c_str())) {
+ try {
+ IFileStream in(basedir + "/default.nut");
+ run_script(in, std::string("Sector(") + name + ") - default.nut");
+ } catch(std::exception& ) {
+ // doesn't exist or erroneous; do nothing
+ }
+ }
+
// Run init script
if(init_script != "") {
std::istringstream in(init_script);
#include "main.hpp"
#include "spawn_point.hpp"
#include "file_system.hpp"
+#include "physfs/physfs_stream.hpp"
#include "tile_manager.hpp"
#include "tile_set.hpp"
#include "gui/menu.hpp"
throw SquirrelError(global_vm, "Couldn't set worldmap in roottable");
sq_pop(global_vm, 1);
+ //Run default.nut just before init script
+ try {
+ IFileStream in(levels_path + "/default.nut");
+ run_script(in, "WorldMap::default.nut");
+ } catch(std::exception& ) {
+ // doesn't exist or erroneous; do nothing
+ }
+
+
if(init_script != "") {
std::istringstream in(init_script);
run_script(in, "WorldMap::init");