Author Topic: [SOLVED] What do these return numbers mean on fxDTSbrick::plant()  (Read 1951 times)

I'm trying to spawn in a set of bricks usin (new fxDTSbrick()), but only half of them show up for some reason
so I decided to do echo(%brick.plant()); when planting the brick
and I got two numbers
sometimes it echoed 1, sometimes 2
what do they mean?

I need help because most of the bricks that do spawn in are glitchy anyway

Code: [Select]
// i have an array of vector3s to be the positions to spawn the bricks at
// $spc is the count of spawn dirt
for(%i = 0; %i < $spc; %i++)
{
%pos = SpawnData.SpawnPos[%i];
if(getWord(%pos, 0) !$= "")
{
                // i have a set of script objects that act as the base for different blocks
                // $Z_Offset is just how high I want the bricks, it's set to 70000
%dirt = getDirtType("0 0" SPC $Z_Offset); // automatically get the first layer of dirt
%dirt.place(%pos SPC $Z_Offset);
}else{
warn("Spawn Position doesn't exist... ignoring...");
}
}

function KM_Layer::place(%this, %pos)
{


%brick = new fxDTSbrick()
{
datablock = "brick4cube1data";
position = %pos;
rotation = "0 0 0 0";
scale = "1 1 1";
angleID = "0";
colorfxid = 0;
shapefxID = "0";
isPlanted = 1;
scale = "1 1 1";
stackBL_ID = getNumKeyID();

            
name = %this.name;
health = %this.health;
type = %this;
colorID = %this.color;
printID = %this.print;
};

OrePosData.orePos[%pos] = 1;
echo("Layer Position:" SPC %pos);

echo(%brick.plant());
BrickGroup_1337.add(%brick);
}

It's supposed to be an 8x8 grid of dirt, but instead only a few are planted

The green blocks aren't being loaded by my script, those are a blockland save



me flying in the blocks

« Last Edit: August 13, 2016, 05:29:16 PM by KozzyMoto »

They're plant errors. Here's what all the numbers refer to:
0 - No error.
1 - Overlap.
2 - Float.
3 - Stuck.
5 - Buried.

Why would it give me float or overlap errors? Can't I place blocks where ever I want?

Why would it give me float or overlap errors? Can't I place blocks where ever I want?
You can, the plant errors are just for information purposes, it should still plant the brick.

Then why wouldn't it place more than half the blocks? And also why are the blocks glitchy?

They're plant errors. Here's what all the numbers refer to:
0 - No error.
1 - Overlap.
2 - Float.
3 - Stuck.
5 - Buried.
Code: [Select]
case 0: return 0;
case 1: return "overlap";
case 2: return "float";
case 3: return "stuck";
case 4: return "unstable";
case 5: return "buried";
default: return "forbidden";

Then why wouldn't it place more than half the blocks? And also why are the blocks glitchy?
Because if it gives errors, then the brick wasn't planted correctly. Aside from like floating. Ipq should have clarified.

Dump your SpawnData since that's where the positions come from. Dump your loop count as well.

I checked it, and the console says it's planting all of them.

this is from the console

Loops: < what $spc is equal to
Spawn Position: < The position that it's grabbing from SpawnData
Layer Position: < The position that the brick was planted at
#: < brick plant error

Code: [Select]
Loops: 64
Spawn Position: -1.5 0.5
Layer Position: -1.5 0.5 70000
2
Spawn Position: -13.5 -9.5
Layer Position: -13.5 -9.5 70000
2
Spawn Position: 0.5 -1.5
Layer Position: 0.5 -1.5 70000
1
Spawn Position: 0.5 0.5
Layer Position: 0.5 0.5 70000
1
Spawn Position: 0.5 4.5
Layer Position: 0.5 4.5 70000
2
Spawn Position: -3.5 4.5
Layer Position: -3.5 4.5 70000
2
Spawn Position: -5.5 4.5
Layer Position: -5.5 4.5 70000
1
Spawn Position: -7.5 4.5
Layer Position: -7.5 4.5 70000
2
Spawn Position: -9.5 4.5
Layer Position: -9.5 4.5 70000
1
Spawn Position: -1.5 -9.5
Layer Position: -1.5 -9.5 70000
2
Spawn Position: -3.5 -9.5
Layer Position: -3.5 -9.5 70000
1
Spawn Position: -5.5 -9.5
Layer Position: -5.5 -9.5 70000
2
Spawn Position: -7.5 -9.5
Layer Position: -7.5 -9.5 70000
1
Spawn Position: -9.5 -9.5
Layer Position: -9.5 -9.5 70000
2
Spawn Position: -11.5 -9.5
Layer Position: -11.5 -9.5 70000
1
Spawn Position: 0.5 -3.5
Layer Position: 0.5 -3.5 70000
2
Spawn Position: -13.5 -7.5
Layer Position: -13.5 -7.5 70000
1
Spawn Position: -11.5 -7.5
Layer Position: -11.5 -7.5 70000
1
Spawn Position: -9.5 -7.5
Layer Position: -9.5 -7.5 70000
1
Spawn Position: -7.5 -7.5
Layer Position: -7.5 -7.5 70000
1
Spawn Position: -5.5 -7.5
Layer Position: -5.5 -7.5 70000
1
Spawn Position: -3.5 -7.5
Layer Position: -3.5 -7.5 70000
1
Spawn Position: -1.5 -7.5
Layer Position: -1.5 -7.5 70000
1
Spawn Position: -3.5 -5.5
Layer Position: -3.5 -5.5 70000
2
Spawn Position: -5.5 -5.5
Layer Position: -5.5 -5.5 70000
1
Spawn Position: -1.5 -5.5
Layer Position: -1.5 -5.5 70000
1
Spawn Position: -7.5 -5.5
Layer Position: -7.5 -5.5 70000
2
Spawn Position: -9.5 -5.5
Layer Position: -9.5 -5.5 70000
1
Spawn Position: -11.5 -5.5
Layer Position: -11.5 -5.5 70000
2
Spawn Position: -13.5 -5.5
Layer Position: -13.5 -5.5 70000
1
Spawn Position: 0.5 -5.5
Layer Position: 0.5 -5.5 70000
1
Spawn Position: 0.5 -7.5
Layer Position: 0.5 -7.5 70000
1
Spawn Position: -13.5 -3.5
Layer Position: -13.5 -3.5 70000
1
Spawn Position: -11.5 -3.5
Layer Position: -11.5 -3.5 70000
1
Spawn Position: -9.5 -3.5
Layer Position: -9.5 -3.5 70000
1
Spawn Position: -7.5 -3.5
Layer Position: -7.5 -3.5 70000
1
Spawn Position: -5.5 -3.5
Layer Position: -5.5 -3.5 70000
1
Spawn Position: -3.5 -3.5
Layer Position: -3.5 -3.5 70000
1
Spawn Position: -1.5 -3.5
Layer Position: -1.5 -3.5 70000
1
Spawn Position: -1.5 -1.5
Layer Position: -1.5 -1.5 70000
1
Spawn Position: -3.5 -1.5
Layer Position: -3.5 -1.5 70000
1
Spawn Position: -5.5 -1.5
Layer Position: -5.5 -1.5 70000
2
Spawn Position: -7.5 -1.5
Layer Position: -7.5 -1.5 70000
1
Spawn Position: -9.5 -1.5
Layer Position: -9.5 -1.5 70000
2
Spawn Position: -11.5 -1.5
Layer Position: -11.5 -1.5 70000
1
Spawn Position: -13.5 -1.5
Layer Position: -13.5 -1.5 70000
2
Spawn Position: 0.5 -9.5
Layer Position: 0.5 -9.5 70000
1
Spawn Position: -11.4 4.5
Layer Position: -11.4 4.5 70000
2
Spawn Position: -13.5 4.5
Layer Position: -13.5 4.5 70000
1
Spawn Position: -13.5 2.5
Layer Position: -13.5 2.5 70000
1
Spawn Position: -13.5 0.5
Layer Position: -13.5 0.5 70000
1
Spawn Position: -11.5 0.5
Layer Position: -11.5 0.5 70000
1
Spawn Position: -11.5 2.5
Layer Position: -11.5 2.5 70000
1
Spawn Position: -9.5 2.5
Layer Position: -9.5 2.5 70000
1
Spawn Position: -9.5 0.5
Layer Position: -9.5 0.5 70000
1
Spawn Position: -7.5 0.5
Layer Position: -7.5 0.5 70000
1
Spawn Position: -7.5 2.5
Layer Position: -7.5 2.5 70000
1
Spawn Position: -5.5 2.5
Layer Position: -5.5 2.5 70000
1
Spawn Position: -5.5 0.5
Layer Position: -5.5 0.5 70000
1
Spawn Position: -3.5 0.5
Layer Position: -3.5 0.5 70000
1
Spawn Position: -3.5 3.5
Layer Position: -3.5 3.5 70000
1
Spawn Position: -1.5 2.5
Layer Position: -1.5 2.5 70000
1
Spawn Position: 0.5 2.5
Layer Position: 0.5 2.5 70000
1
Spawn Position: -1.5 4.5
Layer Position: -1.5 4.5 70000
1

Uh, you have spawn positons under 0, that's why. The Z is not the same for most of your spawn objects. Bricks refuse to plant when under 0

Quote
Uh, you have spawn positons under 0, that's why. The Z is not the same for most of your spawn objects. Bricks refuse to plant when under 0
What? No, the positions are X Y Z

Layer Position: -1.5 0.5 70000
so this is
X: -1.5, Y: 0.5, Z: 70000

You're not under standing what I'm saying. Look at the spawn position. The Z is screwed up.

Quote
You're not under standing what I'm saying. Look at the spawn position. The Z is screwed up.

When I get the spawn position, I add the Z position (70000) to the end of it

%pos is a 2d vector, X and Y
then I have Z_Offset which is 70000 that I add to the end of it

Spawn Position: X Y is just the 2d vector I'm grabbing from the SpawnData
Layer Position: is the actual position that it was planted at

Code: [Select]
%dirt.place(%pos SPC $Z_Offset); // <<<<

Echo the place position. It may not be planting in the right area, as I have said.
« Last Edit: August 13, 2016, 03:00:18 PM by Kyuande »

Quote
Echo the place position. It may not be planting in the right area, as I have said.
The position I'm placing it at or the position of the block AFTER I place it?

Either way it's the same as the corresponding 'Layer Position:'