Destroying interact_objects
Moderator: Moderators
Destroying interact_objects
I'm wondering if there is any way to make, for example, the shot glass, model/miscobj/shotglass.tik shatter when shot at, similar to a window breaking. All the ways i try usually make the map crash.
On your MOHradiant screen, right click and select func_crate from the list. Take that block and press "N". Give it a model of model/miscobj/shotglass.tik Then, give it a key "health" and value (whatever amount of health you want.) Try not to exceed 100, as that is what it takes to kill a player
The makx health is something like 999.
using func_crate gets me the same results as using func_window. map crashes when trying to load, takes me back to the main menu. opened console, says:
"ERROR: func_crate::setSolidType : SOLID_BSP entity at x180.00 y776.00 z-902.00 with no BSP model"
I've since set up a trigger multiple around the shotglass. I found the glass shatter sound in the ubersound.scr, but i dont know where to find the animation of glass shattering, or how to insert it into the script. my current script is as follows:
My trigger is as follows:
"ERROR: func_crate::setSolidType : SOLID_BSP entity at x180.00 y776.00 z-902.00 with no BSP model"
I've since set up a trigger multiple around the shotglass. I found the glass shatter sound in the ubersound.scr, but i dont know where to find the animation of glass shattering, or how to insert it into the script. my current script is as follows:
This makes the shot glass disappear when shot.// PUB
// ARCHITECTURE: WELLS
// SCRIPTING: WELLS
main:
level waittill prespawn
//*** Precache Dm Stuff
exec global/DMprecache.scr
exec global/door_locked.scr::lock
level.script = maps/dm/hotel.scr
exec global/ambient.scr mohdm7
thread pub_shotglass_1
level waittill spawn
end
//------------------------------------------
// Pub Shot Glass 1
//------------------------------------------
pub_shotglass_1:
$pub_shotglass_1_trigger waittill trigger
$pub_shotglass_1 remove
end
My trigger is as follows:
Because i dont know how to script the sound/explosion of glass. I've inserted a glass clip over the trigger to give the right effect. I'd like to know how to properly script it, so i dont need unnessecary brushes.classname trigger_multiple
cnt 1
health 5
setthread pub_shotglass_1
spawnflags 144
targetname pub_shotglass_1_trigger
K, I ran a test and this does actually work.
Change this:
classname trigger_multiple
$targetname pub_shotglass_1_trigger
cnt 1
health 5
In your radiant window (for the trigger), check the box that says damage. If you fail to do so, touching the trigger with your player or AI will cause it to remove.
You should not be using setthread with this trigger if you are threading it from the script. Might be the reason for the crash. Just leave setthread off the trigger and let the script refer to the trigger's targetname.
Make sure that the glass has a $targetname of pub_shotglass_1 or the script cannot remove that entity. Also, against what I said earlier, just leave it a model. Making it a crate might be part of the problem. Sorry bout that.
In addition to the shotglass, make a brush with the texture of glass. You can get it in the common textures folder, should be all blue and say glass in white.
Give it the same targetname as your shotglass and make it about the same size as the glass. The glass will be invisible, be solid, and make a glass sound if bullets pass through them. When the trigger removes targets with the name pub_shotglass_1, the glass texture will go with it.
Change this:
To this:classname trigger_multiple
cnt 1
health 5
setthread pub_shotglass_1
spawnflags 144
targetname pub_shotglass_1_trigger
classname trigger_multiple
$targetname pub_shotglass_1_trigger
cnt 1
health 5
In your radiant window (for the trigger), check the box that says damage. If you fail to do so, touching the trigger with your player or AI will cause it to remove.
You should not be using setthread with this trigger if you are threading it from the script. Might be the reason for the crash. Just leave setthread off the trigger and let the script refer to the trigger's targetname.
Make sure that the glass has a $targetname of pub_shotglass_1 or the script cannot remove that entity. Also, against what I said earlier, just leave it a model. Making it a crate might be part of the problem. Sorry bout that.
In addition to the shotglass, make a brush with the texture of glass. You can get it in the common textures folder, should be all blue and say glass in white.
Give it the same targetname as your shotglass and make it about the same size as the glass. The glass will be invisible, be solid, and make a glass sound if bullets pass through them. When the trigger removes targets with the name pub_shotglass_1, the glass texture will go with it.