Command to destroy script_object like a crate, no explosion?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
BirdsofaFeather
Sergeant
Posts: 72
Joined: Sun Aug 24, 2003 3:49 am

Command to destroy script_object like a crate, no explosion?

Post by BirdsofaFeather »

I know how to make a script object explode, but is there a way to make it "explode" like a crate, with no explosion, just the breaking apart effect? I have a wooden structure that I want to break apart like a crate at a certain time in script, and I don't want to have to split it up into segments and run physics to get the effect I want of it falling apart, as it is not very important and the crate effect would be perfect.
Look! Up in the sky! It's a Bird! It's a Plane! It's......oh wait it's a bird.

<Your MOHAA Mapping Friend in the Sky ;)>
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Why don't you make it a func_crate?
Image
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Post by G3mInI »

I think he is spawning this object into an existing map through script, not sure but thats what I think. I also was wondering if you could spawn a func_crate through scripting..

G3mInI
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Yes I think it can be done 8-)
Image
Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

Post by Splaetos »

I have a wooden structure that I want to break apart like a crate at a certain time in script,
I dont think he wants it player destroyable(at least not through random gunfire), but killed by an event instead. He just wants to use the crate breaking animation rather then exploder chunks....

at least thats how i read it =)


umm can you set the health of the crate insanely high? and then do damage to it via the script?
When I am king, you will be first against the wall~
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

well make the crate indestructible until you want it destroyed and deal damage to it.

$crate.spawnflags = 1

when you want that cancelled so it can be destroyed

$crate.spawnflags = 0

unless it's spawned with those flags for the game.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
BirdsofaFeather
Sergeant
Posts: 72
Joined: Sun Aug 24, 2003 3:49 am

Post by BirdsofaFeather »

I dont think he wants it player destroyable(at least not through random gunfire), but killed by an event instead
That is correct, I don't want players to be able to destroy it. I hadn't thought about changing the spawnflags, how would I deal damage to it manually through script?
Look! Up in the sky! It's a Bird! It's a Plane! It's......oh wait it's a bird.

<Your MOHAA Mapping Friend in the Sky ;)>
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Try this

Post by tltrude »

crate_killer:

$mycrate.health = 100000
wait 10
$mycrate kill
iprintln "Boom!"

end
Tom Trude,

Image
Post Reply