Easy Breakable Glass / Wood

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
Scorpion
CJ Wannabe
CJ Wannabe
Posts: 39
Joined: November 18th, 2007, 9:14 pm
Location: Burnley,United Kingdom

Easy Breakable Glass / Wood

Post by Scorpion » August 22nd, 2009, 5:07 pm

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

User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

Re: Easy Breakable Glass / Wood

Post by waywaaaard » August 22nd, 2009, 5:46 pm

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;
		}
	}
}
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

Scorpion
CJ Wannabe
CJ Wannabe
Posts: 39
Joined: November 18th, 2007, 9:14 pm
Location: Burnley,United Kingdom

Re: Easy Breakable Glass / Wood

Post by Scorpion » August 22nd, 2009, 5:53 pm

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

Scorpion
CJ Wannabe
CJ Wannabe
Posts: 39
Joined: November 18th, 2007, 9:14 pm
Location: Burnley,United Kingdom

Re: Easy Breakable Glass / Wood

Post by Scorpion » August 22nd, 2009, 6:24 pm

Dunno :lol:

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. :?

Scorpion
CJ Wannabe
CJ Wannabe
Posts: 39
Joined: November 18th, 2007, 9:14 pm
Location: Burnley,United Kingdom

Re: Easy Breakable Glass / Wood

Post by Scorpion » August 22nd, 2009, 7:01 pm

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;
      }
   }
}

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: Easy Breakable Glass / Wood

Post by Nightmare » August 22nd, 2009, 10:56 pm

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
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Easy Breakable Glass / Wood

Post by Drofder2004 » August 23rd, 2009, 1:34 am

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 :P
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

Re: Easy Breakable Glass / Wood

Post by waywaaaard » August 23rd, 2009, 9:11 am

Ok I remembered that I've read this tutorial what is exactly what you WANT!

http://www.modsonline.com/Tutorials-read-117.html
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Easy Breakable Glass / Wood

Post by Drofder2004 » August 23rd, 2009, 11:41 pm

<Mapping section - No Spam!>

And that was what I remember using, saves me some hassle.

(although exactly what he wanted was no trigger)
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests