Author Topic: Armored vehicles  (Read 670 times)

I'm looking for a way to simulate armored vehicles, like the Tank.

The idea is to subtract a given value from the DirectDamage from projectiles, so only the most powerful weapons will do anything at all. Also, I'd like to implement immunity to radius damage from HEGrenade, Rocket Launcher, etc.

EDIT: On second thought, this would make the Sniper Rifle very effective against vehicles... Any ideas?
« Last Edit: December 15, 2008, 10:28:01 AM by Jorgur »

Something like, if radiusDamage is higher then a certain amount, then the weapon can damage the vehicle.

But, you also add in the No Radius Damage script and substract damage from the direct damage. Guns usually don't come with radius damage and it kind of makes sense too. Sniper should no longer hurt armored vehicles with this.

Give them a large amount of health and make them explode spectacularly.

I believe that the addDamageType function lets you specify a different damage ratio for players and vehicles - try fiddling with this to make the Sniper Rifle do about a tenth of the damage against vehicles or enough so it acts exactly like a Gun bullet.

For the main question, try packaging Vehicle::damage and subtracting an amount in the datablock (e.g. vehicleArmorAmount) from each damage, mininum being zero.

It was easier than I thought. Seems the two last parameters are factors for Vehicle and Player damage, respectively.

However, I don't know much about this damage function/variable. Could you give me a hint on what to do?

EDIT: Note that the reduction must happen after the AddDamageType multiplication to be of any use.

EDIT2: Never mind, Iban helped me out.
« Last Edit: December 18, 2008, 09:00:56 PM by Jorgur »