Author Topic: Vehicle impact damage  (Read 601 times)

I think a (simple?) script that gives damage to vehicles when they hit something hard enough would be cool. The harder the vehicle hits something the more damage it gets. And also have it so it only works inside a mini and you can easily turn it of in the minigame setup screen.

I think this might have been requested before, but a long time ago.

You can't yet, theres no onVehicleTouch trigger for bricks.

You can't yet, theres no onVehicleTouch trigger for bricks.
Vehicle::onCollision or ::onImpact can be used for this, as that is recorded when you first hit something. The problem with an onVehicleTouch event is continuous detection, but that isn't necessary for this purpose.

I believe Ephialtes had a basic version of this for his server at one point for the Stunt Plane: it was damaged if you smashed into something at high speed.

Vehicle::onCollision or ::onImpact can be used for this, as that is recorded when you first hit something. The problem with an onVehicleTouch event is continuous detection, but that isn't necessary for this purpose.

I believe Ephialtes had a basic version of this for his server at one point for the Stunt Plane: it was damaged if you smashed into something at high speed.

That is exactly what I want. Except it would be a script that would detect when any vehicle would impact something, and give more damage to it the harder it hit.

oh I thought onCollision only recorded for non brick objects - k

That is exactly what I want. Except it would be a script that would detect when any vehicle would impact something, and give more damage to it the harder it hit.

You just scale the damage given based on the velocity of the vehicle - As far as I remember onImpact is used for interior/terrain vehicle collisions while onCollision is for player/staticshape/other vehicle collisions. You have to change minImpactSpeed and minGroundImpactSpeed (or something along those lines) in the vehicle datablock.