Author Topic: Standalone environment loading  (Read 984 times)

I know there's already environment loading add-ons, but those are for when you're loading up a save or when you quit and restart your game, but i'd like one that lets you load environments separately

Blockland is already able to save the current environment settings via 'saveEnvironment("Add-Ons/Folder/FileName.txt");', so i thought that there should be a command or a GUI that lets you load up those text files

so it would be like loading environment saves? that'd be cool and convenient

so it would be like loading environment saves? that'd be cool and convenient
It would be, and people could even share their entire environments rather than doing it piece by piece by sharing just the sky, ground, and water files

what does the environment file look like?
it could be as simple as exec("add-ons/folder/filename.txt"); if that's the way they're formatted correctly

what does the environment file look like?
it could be as simple as exec("add-ons/folder/filename.txt"); if that's the way they're formatted correctly
It's pretty much like what the gamemode.txt file in gamemodes use

Code: [Select]
$EnvGuiServer::SimpleMode 0
$EnvGuiServer::SkyFile Add-Ons/Sky_Slate_Desert/Slate_Desert.dml
$EnvGuiServer::WaterFile NONE
$EnvGuiServer::GroundFile Add-Ons/Ground_White/white.ground
$EnvGuiServer::SunFlareTopTexture base/lighting/corona.png
$EnvGuiServer::SunFlareBottomTexture base/lighting/corona.png
$EnvGuiServer::DayOffset
$EnvGuiServer::DayLength 300
$EnvGuiServer::DayCycleEnabled 0
$EnvGuiServer::DayCycle Add-Ons/DayCycle_Default/default.daycycle
$EnvGuiServer::Sunational socialistmuth 29.5385
$EnvGuiServer::SunElevation 27.9487
$EnvGuiServer::DirectLightColor 0.369159 0.401869 0.322430 1.000000
$EnvGuiServer::AmbientLightColor 0.822430 0.738318 0.565421 1.000000
$EnvGuiServer::ShadowColor 0.341121 0.350467 0.355140 1.000000
$EnvGuiServer::SunFlareColor 0.000000 0.000000 0.000000 0.000000
$EnvGuiServer::SunFlareSize 0
$EnvGuiServer::VisibleDistance 600
$EnvGuiServer::FogDistance 500
$EnvGuiServer::FogHeight
$EnvGuiServer::FogColor 0.822430 0.738318 0.565421 1.000000
$EnvGuiServer::WaterColor 255 255 255 128
$EnvGuiServer::WaterHeight 5
$EnvGuiServer::UnderWaterColor 0 0 128 128
$EnvGuiServer::SkyColor 1.000000 1.000000 1.000000 1.000000
$EnvGuiServer::WaterScrollX 0
$EnvGuiServer::WaterScrollY 0
$EnvGuiServer::GroundColor 0.654206 0.654206 0.654206 0.004673
$EnvGuiServer::GroundScrollX 0
$EnvGuiServer::GroundScrollY 0
$EnvGuiServer::VignetteMultiply 0
$EnvGuiServer::VignetteColor 0.000000 0.000000 0.000000 0.392157

It hadn't actually occurred to me to use the execution command
« Last Edit: August 02, 2015, 08:26:24 AM by Masterlegodude »

oh, no semicolons at the end of each line and no ='s to set the values
that's annoying, could almost have just used exec

instead it might just have to open the file, read each line and do something like eval(getWord(line, 0) SPC "=" SPC getSubStr(line, strLen(getWord(line, 0)) + 1, strLen(line) - strLen(getWord(line, 0)) - 1) @ ";");

i'm guessing there's probably an easier way to split the first word and the rest of the string
and it might be better to use a switch to set everything, instead of using eval

edit: getWords(line, 1) would probably work better
BL crashes when you get 0 or less words from getWords it seems
« Last Edit: August 02, 2015, 08:42:06 AM by phflack »

there's already something like this made: http://swololol.com/rtb#s=Client_SaveEnvironment



and phflack, there's a way to loading enviroments a lot easier, its featured in the speed kart gamemode. so check it out if you want or whatever