Poll

Good Idea? (Please read the first post)

Yes
No
It's Ok
It can't be done
Useless

Author Topic: ifProjectile... Events  (Read 1523 times)

So I had this idea when I was trying to make something that would determine a projectile's strength, velocity, and so on, to make the process of testing weapon add-ons a lot easier.  I tried using bots to calculate damage, normal bricks, targets, etc to make this work, but every time I tried it I hit a block.
So I figured, if there's an ifProjectile event that can tell what the projectile is, why can't there be others, too?
ifProjectile Events would include:
ifProjectileVelocity
ifProjectileDamage
ifProjectileSpread (For explosives)

I not only find this useful for my idea, but it's also good to add some realism to DMs and such, where windows can only be broken by projectiles that deal enough damage, and where only the stronger projectiles like sniper bullets can break walls, etc.

If you're gonna use this and make the events, please give credit to my in-game name: Niliscro.
« Last Edit: May 06, 2009, 06:26:55 PM by nick18337 »

I actually really like the idea, though I don't quite understand the ifProjectileSpread event... Explosion size?

Yeah, the splash damage, range, and whatnot.

Bump.
Really want this.

Why would we need this? We can already see how fast our projectile will go in two ways, through code and in game, we don't need events to measure that. Second, we should know how much our own add on does damage wise by looking through code, and that third one might actually be ok because I don't know how to measure radius in whatever unit torque uses.

They aren't for measuring.
Also, 1 horizontal stud = 0.5 Torque units, and 1 vertical stud (a plate) = 0.2 units.

But what this would be used for, is something like... only a powerful weapon could destroy a certain brick, or a fast projectile will break a certain brick, while a slower one will bounce off.

Exactly, Chrono, and I'm sure after a little while some other uses can be found.
I, personally, would like it because I usually make labs that measure projectile speed and such.
The only current way there is to find projectile speed using events without changing the timescale is to use a "sonar" method, where you have one brick with ray casting only, and onProjectileHit it reroutes the projectile with the same energy in the same direction over 10 horizontal studs, and then hits another brick at the end.  The time measured between these hits can be used to calculate the speed, but it's pretty inaccurate and hard to judge.
As far as practical uses go, however, what I mentioned in the OP is the only one I can really think of right now.

You could use onProjectileHit -> Projectile -> Bounce 1.0, this will bounce the projectile back at the same speed it came at.

Yeah, that would be more accurate, especially if I used 3 hits to calculate speed.
But still, these events could be pretty useful.  You could do something like:
onProjectileHit } Self } ifProjectile } Arrow
VarTrue } Projectile } Bounce 0.5

That would make arrows deflect off of things they wouldn't normally penetrate.

Also, ifProjectileVelocity could be used for some "puzzle" or escape the building sort of things, if you find a good enough use for it.