Author Topic: Clarification on coding blockland  (Read 9188 times)

Hi guys,

Being new here.. but no stranger to coding stuff, I thought I would find links to a basic run-down on how things hang together in Blockland on the blockland.us homepage.. am I missing something?

Searching the forums I have found a wonderful summary of TS functions/coding, but I cant work out how this links in to Blockland and how I can make something.

Can blocks be scripted? or only Add-On objects like planes and cars and Weighted Companion Cubes?  (e:g can I script one block to cause another block to jump 1 square to the left when I bump into the first block?)
 
So I visit the forums in the hope of finding a sticky 'Introduction to Blockland and TorqueScript' but cant see or find anything like this amongst the specific questions on specific objects/missions etc.

Sorry for asking a question I sure has been asked before, but Im just finding this info hard to find searching the forums.  I googled for a wiki on Blockland scripting but found none.. I hope Im overlooking something obvious.

eg: I found this into to TS: http://www.garagegames.com/docs/tge/general/ch05s02.php

..but how to I get a simple 'hello world' script to run? I assume I have to save it in a *.ts file but where? And where would I see the output of said Hello world script?

Thanks in advance.

Firstly, TorqueScript is most commonly saved to a .cs file. Secondly, the "console" will be one of your most helpful tools when scripting Blockland. This can be opened using the ` key above Tab.

You would put this into a helloworld.cs file (and put it in Add-Ons/Client/ so it gets automatically executed or loaded) to make a hello world script:

Code: [Select]
function helloWorld()
{
     echo("Hello World!");
}

And then put into the console:

Quote
helloWorld();

to run it.

About the blocks, no, bricks in Blockland can not move. You can, however, script objects (possibly modeled like bricks) to do that.

Glad to see someone interested in creating add-ons that knows what they are doing.

Add-ons can be any of the following:

Weapons (such as the flamethrower)
Vehicles (such as the plane)
Tools (such as the brick duplicator)
player types (such as top-down player)
small little scripts (such as giving rules when the player types /rules in the chat)
or more complicated scripts, such as the zombie mod, or wrench events.

Hi Guys.. thanks for the positive replies.

I have a hello world script running (thanks Sekret) and I have loaded the editor and am happily pressing F10 to edit the interface (make the HUD crosshair larger) and F11 to edit objects in a mission (like moving the glass from the front of the oven in the kitchen).

So now the fun part.. one always has to have a goal..

I want to have 4 blocks/pillars/buttons or buttons or some such that are placed in a NWSW pattern with the player standing in the middle.. as the player bumps into each block.. a remote objects moves in that NESW direction.

(Anyone remember Head over Heals on the C64?)

So I assume I need a 3d model of a block/pillar/thing.. and another model that does the moving.. and somehow I attach triggers to the blocks and link them to the position of the moving thing.

Somehow I need to know the ID (I assume those 4 digit numbers that go with objects I see in F11 are their unique IDs within the mission)

Am I on the right track?

Any suggestions as to what to do next?

I will start looking at the code of the ball and the gravity gun.. but any help would be very appreciated.

Thanks.
 

For moving objects, I suggest looking at mods like Trader's Doors and the Elevators when they are released.

I remember that game, one character was a dog with arms, the other was a dog/cat with legs and you collected barmy items like Klaxons and other things.

About the blocks, no, bricks in Blockland can not move. You can, however, script objects (possibly modeled like bricks) to do that.
You can move blocks, but its more of a delete block, copy in new position, rinse and repeat rather than actual moving.
This, however, would lead to glitches and lag unless pulled off very carefully.

Mr Pickle's build platform might be a good resource if I understood what you want (never played heads over heels.)

Thanks for that.. I now have the Builder Platform (and a bunch more add-Ons) and am studying.

This is really trivial at the moment but it includes answers to questions I have had:

http://creativeobjectworld.com/cgi-bin/cow.pl?&f=0&m=input&l=94168&c=examine+blockland+notes