Page 1 of 1
Easy Breakable Glass / Wood
Posted: August 22nd, 2009, 5:07 pm
by Scorpion
Hello
Im looking for an easy way to make Glass and Wood Breakable (When Shot).
I just want them to disapear when they have been Shot.
Does anybody know any easy way of Doing this?
Thanks
Re: Easy Breakable Glass / Wood
Posted: August 22nd, 2009, 5:46 pm
by waywaaaard
Make your window a script_brushmodel and the destroyed glass, well if there should be something left after shooting too and make it a script_brushmodel tool. Now make at the window a trigger_damage.
and script like that
Code: Select all
main(){
maps\mp\_load::main();
level.addDamage=0;
}
window(){
trig = getent ("window_trigger", "targetname");
model = getent ("window_brushmodel", "targetname");
destroymodel = getent("window_destroymodel", "targetname");
destroymodel hide();
while(1){
trig waittill ("damage", idamage);
level.addDamage += idamage;
if(level.addDamagevent > 300){
model hide();
model notsolid();
destroymodel show();
break;
}
}
}
Re: Easy Breakable Glass / Wood
Posted: August 22nd, 2009, 5:53 pm
by Scorpion
Hello
Is there not a way of not using a Trigger?
I have about 500 Glass Peices =]
Im sure there must be a way
Thanks
Re: Easy Breakable Glass / Wood
Posted: August 22nd, 2009, 6:24 pm
by Scorpion
Dunno
I remember someone telling me how to do it Before.
It was you Sam or KILL3R.
I gave it Targetnames and i think i might of made it a script_brushmodel.
Then i just added something into my GSC File.

Re: Easy Breakable Glass / Wood
Posted: August 22nd, 2009, 7:01 pm
by Scorpion
Dont Know
Would i have to keep making differnt targetnames for the following code?
Code: Select all
main(){
maps\mp\_load::main();
level.addDamage=0;
}
window(){
trig = getent ("window_trigger", "targetname");
model = getent ("window_brushmodel", "targetname");
destroymodel = getent("window_destroymodel", "targetname");
destroymodel hide();
while(1){
trig waittill ("damage", idamage);
level.addDamage += idamage;
if(level.addDamagevent > 300){
model hide();
model notsolid();
destroymodel show();
break;
}
}
}
Re: Easy Breakable Glass / Wood
Posted: August 22nd, 2009, 10:56 pm
by Nightmare
Code: Select all
main(){
maps\mp\_load::main();
window = getEntArray("window","targetname");
windowTrig = getEntArray("windowTrigger","targetname");
windowDamaged = getEntArray("windowDestroyModel","targetname");
for(i=0;i<window.size;i++)
windowTrig[i] thread checkWindow(window[i],windowDamaged[i]);
}
checkWindow(window,windowDamaged){
windowDamaged hide();
self waittill("trigger");
window delete();
windowDamaged show();
}
Here is a cleaned up version of the script which is made to work with an array of the following:
window: Window script_brushmodel
windowTrigger: Can be any trigger.
windowDestroyModel: script_brushmodel/script_model to show after destroyed
Re: Easy Breakable Glass / Wood
Posted: August 23rd, 2009, 1:34 am
by Drofder2004
Simplify the script further using "target"
i.e
fixeddoor = entity
doortrigger = entity.target
brokendoor = entity.target
brokendoor = brokendoor.target
Now you need only one array.
Maybe tomorrow I will create a quick prefab, if you do not understand it.
there is also possibly a command to do all this without triggers. I used it on one of my major projects... that flatlined

Re: Easy Breakable Glass / Wood
Posted: August 23rd, 2009, 9:11 am
by waywaaaard
Ok I remembered that I've read this tutorial what is exactly what you WANT!
http://www.modsonline.com/Tutorials-read-117.html
Re: Easy Breakable Glass / Wood
Posted: August 23rd, 2009, 11:41 pm
by Drofder2004
<Mapping section - No Spam!>
And that was what I remember using, saves me some hassle.
(although exactly what he wanted was no trigger)