Frictional Games Forum (read-only)
Spreading Broken Plates - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Spreading Broken Plates (/thread-20921.html)



Spreading Broken Plates - Dominic0904 - 03-25-2013

Hey, I was wondering how would I get the broken plate entity (named plate_broken) to spread out in a room that I made. The room is meant to have a bunch of smashed plates and non smashed plates in it. The only way I've figure out to spread it a tiny bit is to place the plates above an object, so when they drop they break apart.

This doesn't really solve the issue cause I'd want the broken plate bits all over the room and not just were they've fallen onto the objects.

Is there something I can script where they would explode or something and scatter around the room?

Thanks.


RE: Spreading Broken Plates - Akos115 - 03-25-2013

Try using AddPropForce, AddPropImpulse, AddBodyForce or AddBodyImpulse.


RE: Spreading Broken Plates - NaxEla - 03-25-2013

Using SetPropHealth, you can make the plates explode.
Code:
SetPropHealth("NameOfPlate", 0);



RE: Spreading Broken Plates - Dominic0904 - 03-25-2013

(03-25-2013, 07:10 PM)NaxEla Wrote: Using SetPropHealth, you can make the plates explode.
Code:
SetPropHealth("NameOfPlate", 0);

That works great! Is there an easier way to do it for multiple different plates? So I don't have to keep copy and pasting that function and changing the name?

Because I may need to get 20-30+ plates to be smashed in that room.


RE: Spreading Broken Plates - NaxEla - 03-25-2013

Code:
SetPropHealth("plate_*", 0);

By putting the asterisk there, it will break all the plates as long as the names are the same except the number at the end.


RE: Spreading Broken Plates - Dominic0904 - 03-25-2013

(03-25-2013, 07:57 PM)NaxEla Wrote:
Code:
SetPropHealth("plate_*", 0);

By putting the asterisk there, it will break all the plates as long as the names are the same except the number at the end.

You are a god send. Thank you so much!

Just need to figure out how to disable the sound of them breaking, because the player starts within earshot. So the player would always here the plates being smashed when the map is loaded. :S