Author Topic: permanently delete fake killed bricks (solvd)  (Read 457 times)

« Last Edit: April 18, 2019, 05:58:17 PM by Biqus »

Code: [Select]
registerOutputEvent("fxDTSBrick", "deleteBrick");

function fxDTSBrick::deleteBrick(%brick)
{
%brick.delete();
}

thank you but i cannot try it until later

Doesn’t setting the timer to -1 keep them destroyed? It doesn’t exactly “delete” them, but it keeps them on the floor and still pushable. I don’t see much of a point of physically deleting them, especially if you want to reset it you can just issue a “cancelEvents” event to the namedbrick. It seems easier than rebuilding them and setting up the script again.

i should have put an explanation but i was thinking of making a tdm where you can build structures and I want them to be destroyable

Ah ok, jes’ script should do the trick then

(ngl tho that’s a goodass idea)

jes’ script is just an event that deletes a bruck, not deleting on fakekill. if you want to delete fakekilled bricks you need this:

Code: [Select]
package deleteOnFakekill {
    function FxDTSBrick::fakekillBrick(%brick, %velocity, %time) {
        %brick.schedule((%time - 1) * 1000, delete);
        parent::fakekillBrick(%brick, %velocity, %time);
    }
};
activatePackage(deleteOnFakeKill);

jes’ script is just an event that deletes a bruck, not deleting on fakekill. if you want to delete fakekilled bricks you need this:

Code: [Select]
package deleteOnFakekill {
    function FxDTSBrick::fakekillBrick(%brick, %velocity, %time) {
        %brick.schedule((%time - 1) * 1000, delete);
        parent::fakekillBrick(%brick, %velocity, %time);
    }
};
activatePackage(deleteOnFakeKill);
this is why i wish i knew how to script
I would compile this into an addon zip but I feel like I'd forget it up. How do you do it from a script, just throw it into a server.cs and do the other addon stuff and make a Script_whatever?

this is why i wish i knew how to script
I would compile this into an addon zip but I feel like I'd forget it up. How do you do it from a script, just throw it into a server.cs and do the other addon stuff and make a Script_whatever?
Yep.
https://www.dropbox.com/s/5crlrkvqjmtl6os/Script_DeleteFakeKillBricks.zip?dl=1

thank you very much dude

one more thing can this be done with onBlownUp bricks
« Last Edit: April 18, 2019, 10:18:00 PM by Biqus »


one more thing can this be done with onBlownUp bricks
Code: [Select]
package deleteOnBlownUp {
    function FxDTSBrick::onBlownUp(%brick, %a, %b, %c) {
        %brick.schedule(1000, delete);
        parent::onBlownUp(%brick, %a, %b, %c);
    }
};
activatePackage(deleteOnBlownUp);

Doesn’t setting the timer to -1 keep them destroyed? It doesn’t exactly “delete” them, but it keeps them on the floor and still pushable. I don’t see much of a point of physically deleting them, especially if you want to reset it you can just issue a “cancelEvents” event to the namedbrick. It seems easier than rebuilding them and setting up the script again.
last time i was testing, fakekill didn't support -1 and using disappear -1 right after made it flash respawn and fade away

@phflack -1 for fakekill works, but the fakekilled brick doesnt stick around forever, just for a really long time iirc