Author Topic: How to prevent a brick from being fakekilled by projectiles [SOLVED]  (Read 909 times)

Sorry for the slew of brick-related questions. I just hope this is helpful to future people so they don't have to ask the same questions.

I'm trying to stop bricks from being fakekilled, but packaging fakeKillBrick, onFakeDeath, or onBlownUp to return nothing seems to have no effect on stopping the bricks from getting blown up/fakekilled. Is there any way to stop them from being fakekilled even if brick damage is on?



this works; however it has the adverse side effect that any non-prop brick can be fakekilled by any projectile or impulse. Anyone know why?

EDIT: More info here:

Running a trace with and without the package shows that without it, canExplode is never called. odd...?
« Last Edit: February 16, 2016, 01:48:24 PM by Conan »

Put a 0 ms schedule before you return the onFakeDeath

Put a 0 ms schedule before you return the onFakeDeath
please clarify?

Is it a certain type of brick you don't want fakekilled, or specific brick objects you don't want fakekilled?

Former is just simply putting indestructable = true; on the datablock. Latter would require a script and probably a tool.

Is it a certain type of brick you don't want fakekilled, or specific brick objects you don't want fakekilled?

Former is just simply putting indestructable = true; on the datablock. Latter would require a script and probably a tool.
Former, so thanks. Just wanted every brick in a certain brickgroup_props to not fakekill

actually its the latter wtf was i thinking
this is why i need sleep
« Last Edit: February 14, 2016, 11:28:44 AM by Conan »

$MiniGame::BrickDamage   0

Outside of a minigame I have no help

$MiniGame::BrickDamage   0

Outside of a minigame I have no help

Is there any way to stop them from being fakekilled even if brick damage is on?

onBlownUp -> self -> respawn

onBlownUp -> self -> respawn
with code, please.

i want to avoid having them fakekill whatsoever.

nulily, your solution does not work. i, in my 4am lackofsleep mode, mistook your solution as the one i needed. i actually need the latter, oops.

Well, packaging minigameCanDamage and ::fakeKillBrick didn't work.

But this one did.

Code: [Select]
package nopropkill
{
function fxDTSBrick::canExplode(%this,%maxVolume,%maxFloatingVolume)
{
if(%this.getGroup().getName() $= "BrickGroup_Props")
return false;
return Parent::canExplode(%this,%maxVolume,%maxFloatingVolume);
}
};
activatepackage(nopropkill);



also i feel like this should be noted.

$MiniGame::BrickDamage   0

Outside of a minigame I have no help
onBlownUp -> self -> respawn

this is modification help. not suggestions & requests, not help.
« Last Edit: February 14, 2016, 11:57:05 AM by Shift Kitty »

Well, packaging minigameCanDamage and ::fakeKillBrick didn't work.

But this one did.

Code: [Select]
package nopropkill
{
function fxDTSBrick::canExplode(%this,%maxVolume,%maxFloatingVolume)
{
if(%this.getGroup().getName() $= "BrickGroup_Props")
return false;
return Parent::canExplode(%this,%maxVolume,%maxFloatingVolume);
}
};
activatepackage(nopropkill);
this works; however it has the adverse side effect that any non-prop brick can be fakekilled by any projectile or impulse. Anyone know why?

EDIT: More info here:

Running a trace with and without the package shows that without it, canExplode is never called. odd...?
« Last Edit: February 15, 2016, 11:17:29 PM by Conan »

Running a trace with and without the package shows that without it, canExplode is never called. odd...?

It's an engine function so it doesn't show up in trace unless you overwrite it.

Looking at the return values, i guessed that I needed to return the parent function's return value, so I did that and it fixed everything.

As a general rule of thumb, its probably a good idea to return the parent function's return because otherwise it defaults to the first parameter of the function, it appears.

keywords: return parent function, how to stop bricks from exploding, fix brick fake kill, fix brick exploding, brick explode, parent explode function, fxDTSbrick explode