Author Topic: I am a begginner and need some help.  (Read 2381 times)

I know some basics, and understand some coding. However, I don't know how to get a script working other than typing it into the console.
For now I just want to do this simple code:

Quote
function helloWorld()
{
echo("Hello World!");
}

I don't know where to put it for it to work. Please help?

Well, I usually put my files into the base folder of blockland before i package them up.
You usually have to restart blockland so the new file will be recognized when you first create it, but alternatively you can type setmodpaths(getmodpaths());

So open up blockland, make a file in your base folder called Test.cs, put that hello world code inside of it and save.

Now switch back to blockland and open the console and type this.

setmodpaths(getmodpaths()); exec("base/test.cs");

It should say Executing base/test.cs.

Then simply call your function from the console and it should work.

To package your add-on, you will have to put it into a client_test.zip with a description, namecheck, and a client.cs which can either contain the test code and you wont need another .cs file, or make it execute the test code which requires another .cs file.

This is an example of how a packaged add-on should look, take a look at the client.cs file inside of it (this is a client sided add-on).

http://forum.returntoblockland.com/dlm/viewFile.php?id=3835

Well, I usually put my files into the base folder of blockland before i package them up.
You usually have to restart blockland so the new file will be recognized when you first create it, but alternatively you can type setmodpaths(getmodpaths());

So open up blockland, make a file in your base folder called Test.cs, put that hello world code inside of it and save.

Now switch back to blockland and open the console and type this.

setmodpaths(getmodpaths()); exec("base/test.cs");

It should say Executing base/test.cs.
Thanks. Can I use notepad or does it have to be a special program?
Then simply call your function from the console and it should work.

To package your add-on, you will have to put it into a client_test.zip with a description, namecheck, and a client.cs which can either contain the test code and you wont need another .cs file, or make it execute the test code which requires another .cs file.

This is an example of how a packaged add-on should look, take a look at the client.cs file inside of it (this is a client sided add-on).

http://forum.returntoblockland.com/dlm/viewFile.php?id=3835

setmodpaths(getmodpaths())

You actually don't have to do that in this case. exec automatically refreshes the file cache for that specific path (base/Test.cs). You'd only have to do that if something specific used isFile or was in a .zip file.

-Very Large Snip-
None of that crap is needed.
Just use exec("base/blah.cs");
It works fine.

You'd only have to do that if something specific used isFile or was in a .zip file.

The cache only applies to zip files. All other files within the Blockland directory are not cached, and so files added even while Blockland is running can be accessed without any special provisions.

Mr. Wallet's scripting class has some very nice resources. Click on the "Day #" links at the bottom of the OP.

This is some unofficial Torque documentation you may want to look through, but it's not required reading if you want to learn.

If you're interested in GUIs, Jes00 made a nice tutorial, here.

Other than that, if you need to know stuff, just use the Blockland Modification Forums catagory on the search page.

Hey guys - one more question.
Can I just use notepad or do I have to use a special program?


Hey guys - one more question.
Can I just use notepad or do I have to use a special program?

Notepad is fine, although I recommend Torquedev. It has real-time error checking, customizable designs and plugin support.

Notepad is fine, although I recommend Torquedev. It has real-time error checking, customizable designs and plugin support.
i like torquedev :D

Has anyone else been able to find plugins for it?

Has anyone else been able to find plugins for it?
Once they made the plugin support, the company went out of buiseness, and the plugin examples went down. So nobody was ever able to make any plugins for it.