Author Topic: Shattering Windows  (Read 1646 times)

Windows that shatter when you shoot them with RocketL, RPG, etc. Good?

Saying Good? at the end of your post is some serious attention wanting. And your "Popularity" post.


On-Topic, Nvmd I'm too tired.

Most bricks will be destroyed by large projectiles like rockets anyway, up to about the size of the Window brick. (1x4x5)

The Bedroom windows are shattered by a fast impact or by tank shells - look at how that works?

With the onProjectileHit function it's possible to make a window breakable by any projectile (with a suitable sound), but there's no way currently to detect what projectile hit something.

Yes good.
I believe it is possible, because the windows in the bedroom shatter.
Also it would be cool if when you shot at it with a gun or a shotgun etc. you could see the bullet hole, and the window would crack, then with a second shot would break.



Saying Good? at the end of your post is some serious attention wanting. And your "Popularity" post.
He just wants an opinion so STFU.



Most bricks will be destroyed by large projectiles like rockets anyway, up to about the size of the Window brick. (1x4x5)

The Bedroom windows are shattered by a fast impact or by tank shells - look at how that works?

With the onProjectileHit function it's possible to make a window breakable by any projectile (with a suitable sound), but there's no way currently to detect what projectile hit something.
Damn.  Would it be possible to put something in the code of the weapon that tells the server which projectile hit the brick?

Yes good.
I believe it is possible, because the windows in the bedroom shatter.
Also it would be cool if when you shot at it with a gun or a shotgun etc. you could see the bullet hole, and the window would crack, then with a second shot would break.


He just wants an opinion so STFU.


Damn.  Would it be possible to put something in the code of the weapon that tells the server which projectile hit the brick?
Finally, a kind post! Thanks Ethan.

Quote
He just wants an opinion so STFU.

I'm not flaming, just telling him to just let things flow. I guess saying good at the end of something isnt bad but...
Finally, a kind post! Thanks Ethan.

:No comment:

Jk

The problem is that no input events have "Options" you can set: If I wanted to be able to detect when a Pong Ball (and nothing else) hit my reciever, I'd have to write code for these events:

onProjectileHit (generally)
onGunBulletHit
onAkimboBulletHit
onRocketHit
onTankShellHit
onArrowHit
....
onRadioWaveHit
onPongBallHit
onPinBallHit
...

You'd have to make about 20 new input events...

It's currently impossible, but I think it would be better to have some way to set an option like this:
« Last Edit: August 19, 2008, 03:42:08 AM by Space Guy »

The problem is that no input events have "Options" you can set: If I wanted to be able to detect when a Pong Ball (and nothing else) hit my reciever, I'd have to write code for these events:

onProjectileHit (generally)
onGunBulletHit
onAkimboBulletHit
onRocketHit
onTankShellHit
onArrowHit
....
onRadioWaveHit
onPongBallHit
onPinBallHit
...

You'd have to make about 20 new input events...
I'm not discussing Events, just an Add-on.

Here's how to make shattering glass.

1: Make Window
2: Events:
Code: [Select]
0 onProjectileHit Self playSound glassBreak.wav
0 onProjectileHit Self fakeKillBrick 0 0 0 5
5000 onProjectileHit Self respawn
3: Shoot it
4: ?
5: Profit

It doesn't make it shatter though, it only makes it fall through the ground.

And shattering a brick like that isn't possible without some new crap for different breaking parts coming off it instead of 1 falling brick.

I originally made one of these on the assumption that an explosion would cause it, so you couldn't see it actually breaking.

here is how i would do it.

window's events
onprojectilehit :-: self :-: playsound :-: glassbreak
[100]onprjectilehit :-: self :-: killbrick
onprojectilehit :-: self :-: setemitter :-: pongdelete
onrelay :-: setemitter :-: none
onprojectilehit :-: self :-: firerelayUP

put 1 brick on top of the window
Bricks Events
Onrelay :-: FireRelayDown

so basically, the window dies after 100 millesonds, and in that time the window emitts pongdelete emitter which is a few white squares that might make it looklike debris, and it fires relay up, and then the brick on top fires relay back down, which will stop the emitter.

window's events
onprojectilehit :-: self :-: playsound :-: glassbreak
[100]onprjectilehit :-: self :-: killbrick
onprojectilehit :-: self :-: setemitter :-: pongdelete
onrelay :-: setemitter :-: none
onprojectilehit :-: self :-: firerelayUP
if the brick is dead, then how can it relay?


[100]onprjectilehit :-: self :-: killbrick


it is delayed by just a little while so the relay can get through. i tested it and only 1 whtie square comes out, and there really is no good shatter emitter, so thats the best i can do so far.

Why does it even need the relays? Can't you a delay of about 30-50 to make it remove the emitter very quickly or spawnExplosion to spawn a single "Pong Ball Explosion"?

Also, I'd use fake kill brick instead of killbrick so you can respawn it later. (e.g. minigame end/reset)