Frictional Games Forum (read-only)

Full Version: How do you make wood bars break when standing on them!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This question might not make sense, but it does to me.

If you don't understand, I am trying to make the player when going on the wooden planks/bars it will break and you fall down in a hole. Is there a way to do it. It's similar to penumbra black plague, where you're in the vent and the floor is collapsed and if you walk on it, then it will break and you fall down.

How do I do that, can I do that or is there no such thing to make that? because I've seen people do it in there custom stories, but I forgot what the custom stories where called Sad and I can't find a single way to do that, i can't find a code similar to that or anything. I'm lost help pls
In the most simplest way possible, if you set it up correctly, really all you would need to do is use the SetEntityActive code. HOWEVER, it will look heavily unrealistic. To fix that, you would need to add particle systems, sound effects, broken bits of wood which will fall, etc.
Should I make a script box on the entity that I want it to fall, or I give it a name and then put the setentity active on the script?
You can try using the script SetPropHealth("planks", 0); and it will kill the planks. This only works with entities that have a broken model attached in the entity itself (like doors, the wall passage, boxes). It might work with these planks.
actually I don't know if there are wooden planks that can break in amnesia, about do you think it will look realistic with the player walking on doors and then it crashes. while I think of it, I think it is, maybe I can make a collapsed door on the ground and when the player walks on it, it will break.
Put the planks on the top of the hole, rotate them and use this script.

PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player""PlanksArea_FromLevelEditor""function_name1"true1);
}

void function_name1(string &in asParentstring &in asChildint alState)
{
SetPropHealth("planks_name"0);
PlaySoundAtEntity("""break_wood.snt""Player"0true);

But I don't even know if there are even planks in the amnesia level editor. is there something else to use if there aren't any planks.
Entities>Gameplay>Wooden_boards