Author Topic: I have had a problem trying to execute my first script in blockland  (Read 3067 times)

It doesn't.
Not all computers use C:\ as root drive, and some use multiple and have the default on a diffirent path.
And the default folder for programs depends on 64-bit and operating system language.
For example, on 64-bit, 32x programs usually install in "Program Files (x86)".
And in Danish installations, the folder is named "Programmer", or in German installations, "Programme". Just examples.
I have 6 windows computers. The root drive of all of them is "C:\". I never said they were all the same; its simply the way most of them are configured. And I dont think that Metro is German. :/
« Last Edit: January 16, 2011, 05:05:50 PM by takato14 »

Alright, this is stupid.

Go to your blockland install.

Open your Add-Ons folder.

Add a folder named "Script_Test".

Place a "server.cs" in that folder.

Place a "Description.txt" in that folder.

Start Blockland.

Either enable "Script_Test" on the add-ons list or type exec("Add-Ons/Script_Test/Server.cs"); into the console after loading a mission.

I dont see how this could POSSIBLY need 3 pages to figure out.

Incase anyone wants to know...
Code: [Select]
$defaultGame = "Add-Ons;config;saves";

Code: [Select]
function addDefaultDirectory(%dir) {
   if(isDefaultDirectory(%dir))
      return;
   setModPaths(getModPaths() @ ";" @ %dir);
}
function isDefaultDirectory(%dir) {
    %path = getModPaths();
   for(%i=0;%i<getFieldCount(strReplace(%path,";","\t");%i++)
      if(getField(strReplace(%path,";","\t"),%i) $= %dir)
           return true;
   return false;
}

Wow, man. I never mess with that stuff. I need to extend my reach.

Edit: You're missing a ), and doing it in an odd way. Here's mine:

Code: [Select]
function isDefaultDirectory(%dir) {
%path = strReplace(getModPaths(),";","\t");
for(%i = 0; %i < getFieldCount(%path); %i++)
if(getField(%path, %i) $= %dir)
return true;
return false;
}
« Last Edit: January 25, 2011, 07:40:39 AM by MegaScientifical »