Author Topic: %new  (Read 2691 times)

Your shapeFile path is incorrect.

It should be "base/data/bricks/baseplates/32x32F.blb".  In everyone else's example, both the path and the file extension have been incorrect.

What he wants to do is place a 32x32 plate wherever he is standing, and at the moment he's trying to define a staticshape with a blb specified for the shapefile.

Yeah.

Needs moar

Code: [Select]
new fxDTSBrick()
{
datablock = whateverThe32x32FDatablockIs;
};

I was going to say that staticshapes for bricks is friendry.

Ok thanks for the help but still 1 problem

It says that %new.setPosition through position = %client.obj.position;{ is an error with # around the }


Code: [Select]
//LandPlots//
function serverCmdlandclaim(%client){

%new = new StaticShape();
%new.setPosition(%client.player.getPosition());
}

position = %client.obj.position;{

scale = "1 1 1"

rotation = "1 0 0 0";

datablock = "LandDatablock";

}

%newDatablockInstance = new StaticShape(){

dataBlock = newDatablock;
}
{
datablock StaticShapeData(LandDatablock){
shapeFile = "base/data/bricks/baseplates/32x32F.blb";
}


« Last Edit: January 22, 2008, 07:10:54 PM by Kunit_Yo »

You have more than one problem.  Please pay attention.

1. You cannot start a bracket (e.g. "{" or "}") after the termination of a command (e.g. ";").

2. Every command must terminate (e.g. ";").

3. You need to create an fxDTSBrick, not a StaticShape.

Code: [Select]
function serverCmdClaimLand(%client)
{
%brick = new fxDTSBrick()
{
dataBlock = brick32x32fData;
};

%brick.setTransform(%client.Player.position SPC "1 0 0 0");
}

Still though, I believe that will only spawn a ghost brick.  The ghost would have to be planted, which can't happen unless the brick could be planted by normal rules or you write code to bypass the normal brick planting restrictions.  Based on the quality of your code above, I'd say you're not yet ready for such an endeavor and you should probably stick to the basics like console echoes, math operations, and string operations until you get a good sense of what it actually means to code in TorqueScript.

Ya lol thanks anyway I gave up on that project

Haha. Thats some nice determination.

Yep lol. This script im trying to do is way to advanced for me right now.