| Blockland Forums > Modification Help |
| I have had a problem trying to execute my first script in blockland |
| << < (7/7) |
| takato14:
--- Quote from: Bauklotz on January 13, 2011, 11:11:15 AM ---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. --- End quote --- 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. :/ |
| 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. |
| ZSNO:
Incase anyone wants to know... --- Code: ---$defaultGame = "Add-Ons;config;saves"; --- End code --- |
| MegaScientifical:
--- Quote from: Bauklotz on January 13, 2011, 11:08:23 AM --- --- Code: ---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; } --- End code --- --- End quote --- 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: ---function isDefaultDirectory(%dir) { %path = strReplace(getModPaths(),";","\t"); for(%i = 0; %i < getFieldCount(%path); %i++) if(getField(%path, %i) $= %dir) return true; return false; } --- End code --- |
| Navigation |
| Message Index |
| Previous page |