Author Topic: Is there such a thing as local parts?  (Read 4810 times)

The closest thing we have to that are arrays, really.
edit: however you could make an array of positions.

Can you show me how to make an array? I have no idea how torquescript works. doesnt look anything like Lua or Visual Basic.

Can you show me how to make an array? I have no idea how torquescript works. doesnt look anything like Lua or Visual Basic.
Code: [Select]
%arraycount = 0;
%array[%arraycount] = (stuff here);
%array[%arraycount++] = (stuff here);
%array[%arraycount++] = (stuff here);
%array[%arraycount++] = (stuff here);

Then to retrieve stuff:
for(%a = 0; %a <= %arraycount; %a++)
{
   %thing = %array[%a];
   do stuff with the array here
}

Thanks, that helped loads.
Here's a snipet of land from Chernarus:


The flat areas are towns or roads. The dark green is where there are supposed to be trees.

Is the limit 256k with creating bricks through .cs? And is there some type of wait() function, so that loading all that code doesn't take minutes for blockland to respond?

Is the limit 256k with creating bricks through .cs? And is there some type of wait() function, so that loading all that code doesn't take minutes for blockland to respond?
The global brick limit is 256k bricks. You can get around that limit for the server, but if the client can't physically ghost much more than that number.

As for waiting, you would have to schedule each brick creation. Schedules just tell the engine to wait a few ticks before  continuing the code. Here's how a schedule could work for your purposes
Code: [Select]
function createABrick(%i)
{
    //get your data however using the %i for an index
    //create the brick
    cancel($yourSchedule); //Remove any existing schedule loops to avoid propagation
    $yourSchedule = schedule(10,0,"createABrick",%i++); //Set a 10ms schedule to a global variable
}
The syntax for schedules is schedule(time in ms, object ID or 0, function name, [arguments]);

The global brick limit is 256k bricks. You can get around that limit for the server, but if the client can't physically ghost much more than that number.

This is where your selective ghosting (local parts, as you call it) would come in. By only creating bricks when players are nearby, you will stay well within the 256k limit.

Nice map, btw. What did you use to generate the terrain?
« Last Edit: September 01, 2013, 10:28:46 AM by Greek2me »

This is where your selective ghosting (local parts, as you call it) would come in. By only creating bricks when players are nearby, you will stay well within the 256k limit.

Nice map, btw. What did you use to generate the terrain?
haha ya I want to see that generator

I know about selective ghosting. I'm not quite at that level of torquescript scripting. It's tricky in roblox, I can't imagine how I'd do it in Blockland. I gotta say, the coding is fugly :P. Lua is butiful.

I have a huge table of 2048*2048 height coordinates of the map. The trees I scan a picture of a map to see what coordinates look green enough to be trees(not 100% accurate, but what are the alternatives?). This is done in Visual Basic. VB creates the .cs file with the following code:

Code: [Select]
%ac = 0;
%a2[%ac] =0; //Color Array
%a1[%ac] = ""0 0 0""" //Location array

%a2[%ac]=14;
%a1[%ac++]=10 0 0"
%a2[%ac]=2;
%a1[%ac++]=20 0 0"
%a2[%ac]=5;
%a1[%ac++]=40 0 0"
//etc etc

for(%a = 1; %a <= %ac; %a++)
{   
%L = %a1[%a];
%C = %a2[%a];                 
%cube = new fxDTSbrick()   
{
datablock = brick4xCubeData; 
position = %L; 
angleID = 0; 
colorID = %C;
isPlanted = 1;
};
%cube.setTrusted(1);
%cube.plant(); 
}  ", True)



I'm also the guy behind the BL->RBLX converter
http://www.youtube.com/watch?v=d_ibNbYeNf0
:3

I still don't know a thing about game making in BL, but my plan is to use those terrain blocks to make the map smooth for cars and walking without jumping. Can anyone else picture a map like that, and if it's possible?

Also, whats the stud/s walkspeed of a standard blocklander?

Code: [Select]
%ac = 0;
%a2[%ac] =0; //Color Array
%a1[%ac] = ""0 0 0""" //Location array

%a2[%ac]=14;
%a1[%ac++]=10 0 0"
%a2[%ac]=2;
%a1[%ac++]=20 0 0"
%a2[%ac]=5;
%a1[%ac++]=40 0 0"
//etc etc

for(%a = 1; %a <= %ac; %a++)
{   
%L = %a1[%a];
%C = %a2[%a];                 
%cube = new fxDTSbrick()   
{
datablock = brick4xCubeData; 
position = %L; 
angleID = 0; 
colorID = %C;
isPlanted = 1;
};
%cube.setTrusted(1);
%cube.plant(); 
}  ", True)


Fixed your horrible syntax mistakes.

Code: [Select]
%ac = 0;
%a2[%ac] = 0; //Color Array
%a1[%ac] = "0 0 0"; //Location array

%a2[%ac] = 14;
%a1[%ac++] = "10 0 0";
%a2[%ac] = 2;
%a1[%ac++] = "20 0 0";
%a2[%ac] = 5;
%a1[%ac++] = "40 0 0";
//etc etc

for(%a = 1; %a <= %ac; %a++)
{   
%L = %a1[%a];
%C = %a2[%a];
                 
%cube = new fxDTSbrick()   
{
datablock = brick4xCubeData; 
position = %L; 
angleID = 0; 
colorID = %C;
isPlanted = 1;
};

%cube.setTrusted(1);
%cube.plant(); 
}

that was pseudocode. the triple quotes are from visual basic. as is the
Quote
) ", True)
at the end

I still don't know a thing about game making in BL, but my plan is to use those terrain blocks to make the map smooth for cars and walking without jumping. Can anyone else picture a map like that, and if it's possible?
Yea, it's possible. It requires quite a bit of mathing though, so if it's calculated in real time (in TS) you're screwed

No each block would just be the ramps. The calculating for the millions of bricks to figure out what type of ramp they will be will be done on my computer.

I always run into random problems, I can't figure out what I did wrong:

The save file looks exactly like what the save file of a proper texture brick looks like:


Code: [Select]
8x Cube Steep" 1888 2000 0 2 1 2  ModTer/brickTOP 0 0 1 1 1
+-OWNER 999999
8x Cube Steep" 1892 2000 0 2 1 2  ModTer/brickTOP 0 0 1 1 1
+-OWNER 999999
8x Cube Steep" 1896 2000 0 2 1 2  ModTer/brickTOP 0 0 1 1 1
+-OWNER 999999
8x Cube Steep" 1900 2000 0 2 1 2  ModTer/brickTOP 0 0 1 1 1
+-OWNER 999999
doesnt work

Code: [Select]
8x Cube Steep" 557 1034 4 1 1 23 ModTer/brickTOP 0 0 1 1 1
+-OWNER 999999
does work

Make sure that those textures are enabled when you start the server.

Make sure that those textures are enabled when you start the server.
How would I do that?