AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Making entities damage breakable objects (https://forums.alliedmods.net/showthread.php?t=9556)

KCE 01-23-2005 02:21

Making entities damage breakable objects
 
How do I make an entity be able to damage/destroy a breakable object?
i.e. glass

Votorx 01-25-2005 12:08

It matters what you want to do, the simpliest thing to do is just to use fakedamage() on the entity you want to destroy. If you want to specify between which ent you want to do the damage and which want you want to take the damage you need to be a bit more specific. Once you know which ents what to do this action you'll have to use a combination of fake_touch(), which will stimulate the 2 ents touchin each other, then pfn_touch(), which is a function that will be called when the 2 ents touch each other, then that happens your going to want to use the fake_damage() to apply the damage to the ent you want destroyed which in your case would be the glass.

How to specify which ents are glass is a completely different and harder process though.

Twilight Suzuka 01-26-2005 15:23

actually its easy. You can do it by classname

Votorx 01-26-2005 18:50

Or you can do that, I was thinkin more about DispatchKeyValue() for some reason :?

KCE 01-26-2005 19:34

Actually I tried by classname. Didn't work. I found any enities with class name "func_breakable" and set damage to it with fakedamage, but didn't work

Votorx 01-27-2005 07:15

You should post your plugin, if you did it correctly it should work.

Twilight Suzuka 01-27-2005 12:39

Not nessasarily. fake damage isnt exactly the best way to go.

Votorx 01-27-2005 13:04

Alrighty then, instead of just sayin that and leavin it there why don't you give an example of a better way of doin it?


All times are GMT -4. The time now is 19:21.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.