Author Topic: Cannot write to shaders folder, not detected as a default directory  (Read 2597 times)

Apparently you cannot write to the shaders folder, which is located in the blockland folder.

Why is this? I would love to make a shader mod that just requires the client to install an add-on, not having them manually add it to the shaders folder.

I know that you can openForWrite inside the shader's folder. How are you trying to write something the shader's folder.

you need to append the glsl files

Try this:

setModPaths(getModPaths() @ ";shaders");


if(isObject(optionsDlg))
   optionsDlg.delete();
exec("./optionsDlg.gui");
if($Pref::ShaderQuality == 5)
   OPT_ShaderQuality5.performCli ck();
if($Pref::ShaderQuality == 6)
   OPT_ShaderQuality6.performCli ck();

Coder by Jasa
OR



Quote
function applyPointLightPatchShader()
{
   echo("Applying point light patch");
   %timeStart = getSimTime();

   %destFile = new FileObject();
   %destFile.openForWrite("shaders/common.glsl");

   %sourceFile = new FileObject();
   %sourceFile.openForRead("Add-Ons/client_pointLightPatch/common.glsl");

   while(!%sourceFile.isEOF())
   {
      %destFile.writeLine(%sourceFile.readLine());
   }

   %sourceFile.close();
   %sourceFile.delete();

   %destFile.close();
   %destFile.delete();

   %time = getSimTime() - %timeStart;

   echo("Done (" @ %time @ "ms)");
}

if(getBuildNumber() != 1715)
{
   warn("client_pointLightPatch: Point light patch not applied, game version not supported.");
   warn("   Game Version: " @ getBuildNumber());
   warn("   Patch Version: Revision 1715");
   return;
}
else
{
   applyPointLightPatchShader();
}
Coder by Tawm.

Or


package ShaderScreencap
{
   function doDofScreenshot(%tog)
   {
      if(%tog)
      {
         %old = $Pref::ShaderQuality;
         OptionsDlg.setShaderQuality(6);
         Parent::doDofScreenshot(%tog);
         OptionsDlg.setShaderQuality(%old);
      }
      else
         Parent::doDofScreenshot(%tog);
   }
   
   function doHudScreenshot(%tog)
   {
      if(%tog)
      {
         %old = $Pref::ShaderQuality;
         OptionsDlg.setShaderQuality(6);
         Parent::doHudScreenshot(%tog);
         OptionsDlg.setShaderQuality(%old);
      }
      else
         Parent::doHudScreenshot(%tog);
   }
};
activatePackage("ShaderScreencap");
Coder by Xalos


These for the shader script give you an idea for writing the coder
« Last Edit: September 15, 2013, 10:43:38 AM by Furling² »

The first code and the last code have nothing to do with the topic.

The first code and the last code have nothing to do with the topic.
Done, I cross the line at the frist code and the last code, Just middle code quote.

Done, I cross the line at the frist code and the last code, Just middle code quote.
You don't need to post whole functions when all they need is a few lines.

Try this:

setModPaths(getModPaths() @ ";shaders");

Doesn't work, apparently.

I know that you can openForWrite inside the shader's folder.

Not anymore :(

you need to append the glsl files

Nope, doesn't work.

Badspot dislikes anyone screwing with any files outside of config and Add-Ons, I believe this is achievable through creating an external program tho.

It could be a program that contains a full GUI for messing with the settings and learning what each setting does that constantly sends a function that resets Blockland's shader mode after changes are made.

Badspot dislikes anyone screwing with any files outside of config and Add-Ons, I believe this is achievable through creating an external program tho.

It could be a program that contains a full GUI for messing with the settings and learning what each setting does that constantly sends a function that resets Blockland's shader mode after changes are made.

It's kind of ironic that they once encouraged custom shaders.