Author Topic: Building a brick from nothing?  (Read 2306 times)

Any way to build a functioning brick out of nowhere? I tried new fxDTSbrick() { }; but I seem to only get two outcomes:

 - If .isPlanted is true, the game thinks that the brick is slightly larger than its collision is (perhaps the size of a ghost brick, with each face popped out a little), resulting in normal building not allowing new bricks to touch the artificial one because of an "overlap" error.

 - If  .isPlanted is false, the brick acts weird, but largely behaves as though it has no collision or raycasting.

I've tried lots and lots of stuff (all based on creation via new fxDTSbrick() { };), but these are the only two solid-brick-creating outcomes I can muster. What do you think guys, can it be done?

I really need to know this too :o
EDIT: Maybe you have to make a false client?
« Last Edit: May 10, 2009, 05:42:51 AM by Destiny/Zack0Wack0 »

Create the brick with isPlanted as 0, then call .plant() on it and see what happens.

Create the brick with isPlanted as 0, then call .plant() on it and see what happens.
Still overlaps and isn't quite on the brick grid properly... (plants the spawned brick fine)
« Last Edit: May 10, 2009, 07:35:16 AM by Destiny/Zack0Wack0 »

This is very simple to do, unfortunately I can think of a couple of add-ons of the top of my head that do this already so I won't be telling you how!

This is very simple to do, unfortunately I can think of a couple of add-ons of the top of my head that do this already so I won't be telling you how!

Aw don't be like that :(

Check out the duplicator, it has brick creation code in it.

Yeah, check out the duplicator, that sounds awesome!

Oh and Ephialtes, I did so:

Macro Definition: a single computer instruction that results in a series of instructions in machine language

=D
« Last Edit: May 10, 2009, 02:06:12 PM by AGlass0fMilk »

Or maybe the Macro saver, I think that writes codes for brick creation in it.

I think you need to re-visit the definition of a macro.

Or maybe the Macro saver, I think that writes codes for brick creation in it.
No.
Check out the duplicator, it has brick creation code in it.
Yes.

There's no need to be a jerk Ephi; you could at least have told me the name of an add-on that had it.  :panda:

EDIT: found the magic command. You need to .setTrusted(1) the brick, then the overlap error goes away.
« Last Edit: May 10, 2009, 03:39:02 PM by Mr. Wallet »

Don't forget the few functions afterwards.

new problem: creating a brick in mid-air, building a new brick A on it, then building a new brick B on A, then killing B causing A and the created brick to also be killed in a buggy fashion (no nice ghost debris falling away).

Anyone know a way to fix this?

You could delete the brick under it.

EDIT: I finally got it to work with the following method (note that I don't intend to build on anything except artificial bricks):
  • ondeath, set all non-artificial upbricks and downbricks to baseplates, then run parent::ondeath, then un-set them and check each of them.
  • the check involves looking at every single brick in any way connected to them using a recursive function. Once it runs out of new bricks to check or it finds an artificial brick, it returns the result.
  • if the check result shows that the brick in question is NOT connected to an artificial brick, it's now "floating"; the checked brick is killed off under normal rules, resulting in all bricks attached to it to cascade-kill as normal.

And wallah! :cookieMonster:
There's a bunch of optimizing to be done to remove redundant checks and infinite-up-down check loops and whatnot, but that's the short of it.
« Last Edit: May 11, 2009, 06:45:17 AM by Mr. Wallet »