Author Topic: NONE of my bricks exist!  (Read 1467 times)

Already stated the problem and the solution.

Also, it's fxDtsBrick::onPlant(%this) not fxDtsBrick::onPlant(%this) because it's not a datablock, so %obj would never exist. I don't think you need to return the parent since it's just onPlant.

Code: [Select]
function fxDtsBrick::Plant(%br)
should be

Code: [Select]
function FxDTSBrick::onPlant(%this, %obj)
and don't forget to return the parnet
fxDTSBrickData::onPlant* if I remember correctly is called after a brick is planted, and would create a lot of needless lag, building and deleting the bricks if you don't have the points.
That's the reason GSF used fxDTSBrick::plant, since it's called before the brick is planted.
It might be possible to do
Code: [Select]
function fxDTSBrickData::onLoadPlant(%data, %object) {
    %object.isLoaded = true;
    return Parent::onLoadPlant(%data, %object);
}
function fxDTSBrick::plant(%this) {
    if (%this.isLoaded) {
        return Parent::plant(%this);
    }
    // rest of code here
}

Just do fxDtsBrick::onPlant(%brick)..

pah has a legitimate point and his solution works.
macroing would cause a ton of ghosting with the points mod if implemented with onPlant

I'm certain ::plant is going to get called before ::onloadplant.

::onTrustCheckFinished is the solution that makes the most sense. It also doesn't create a lot of needless lag. A lot of default stuff even plants the brick first before deleting it. Like, plant a brick on someone's brick who doesn't have trust with you. You'll see the brick plant and then disappear. I'm pretty sure ::onPlant is still called, despite the brick being deleted and this will remove someone's points without refunding them. It doesn't create any lag. ::onTrustCheckFinished is only called if the brick successfully plants, this is what water bricks use to create their physicalzones.

pah has a legitimate point and his solution works.
macroing would cause a ton of ghosting with the points mod if implemented with onPlant
There's no reason to package ::onLoadPlant and ::onPlant, if ::onLoadPlant is called I'm pretty sure ::onPlant will not be called, same when ::onPlant is called ::onLoadPlant should not be called, only ::plant is called on both of these situations. (If I'm wrong please post a log with trace when loading a brick from a save and when planting a brick normally)

Shift Kitty's ::onTrustCheckFinished is much better to use than ::onPlant