Wikis / Unreal Wiki / Legacy:Mod Ideas/Advanced Vehicle Damage

What this mod should allow you to do is destroy parts of vehicles without destroying the vehicle itself. Let's take a Scorpion for example. Currently, you can only destroy the blades seperately. Why not have the same for the wheels & turret? I believe that the wheels & turrets are mounted by "bones". A simple "if" statement applied to the bones might work-if not, I can try editing the turrets & wheels instead. Keep in mind that I just finished my DVD Edition's VTMs, so I may not understand everything.

To-Do List:

  • Destroyable Turrets-They seem to work fine.
  • Destroyable Weapons-I haven't found a way to make them work yet. I remember being able to destroy the Goliath cannon in my past exploits, but the code has since been lost.
  • Destroyable Wheels-I haven't found a way to make them work, and it's much more difficult than the other two.

Current Code

AVDONSPRV

//-----------------------------------------------------------
// Advanced Vehicle Damage HellBender
//-----------------------------------------------------------
class AVDONSPRV extends ONSPRV;
 
DefaultProperties
{
	PassengerWeapons(1)=(WeaponPawnClass=class'AVD.AVDONSPRVRearGunPawn',WeaponBone=Dummy02);
}

AVDONSPRVRearGunPawn

//-----------------------------------------------------------
// Advanced Vehicle Damage HellBender Rear Turret
//-----------------------------------------------------------
class AVDONSPRVRearGunPawn extends ONSPRVRearGunPawn;
 
DefaultProperties
	bHasOwnHealth=True
	bCollideActors=True
	bCollideWorld=True
	bBlockActors=True
	bProjTarget=True
	Health=300
	HealthMax=300

Foxpaw: Hmm, this would be simpler with UT2003's vehicle code, but may still be plausable with UT2004's vehicle code. The wheels and turrets aren't "attached" by bones - they ARE bones. Basically, the entire vehicle is one mesh, simulated by Karma. Basically, a ragdoll with it's own internal forces and stuff acting on it's "body parts." It should be possible to remove parts of it similar to how limbs are "gibbed" from a player when they become a ragdoll, however, I don't know how accessible the vehicle's turret code, etc. is and so I don't know if you could plausably remove the functionality of turrets and wheels and stuff.

NamelessPlayer: I found a bHasOwnHealth variable in the ONSWeapon class. I experimented with it, and while the rear turret of a Hellbender had 100 health instead of 600, no damage was taken when the turret was shot. I was on the same team that it was set, so I added some bots & let them take it. A driver got in, later to be joined by a side gunner. I shot the turret to no avail-it destroyed the Hellbender, and a Manta too! :) I might have to set up a health system for this to work, but I'll try it after I test it when it's fully manned.

NamelessPlayer 5/4/2004: I don't think it's working. I have to either check the hitbox or do smoe more coding to get the turrets to work. Speaking of which, how do I edit hitboxes?

Foxpaw: There's a discussion on the collision info for Skeletal Meshes on SVehicle, though I don't know if you can edit the hitboxes after importing the mesh or if it must be done in the 3D modelling program.

NamelessPlayer: Been a while since I checked back, but I have it to the point where the Hellbender rear turret can be destroyed with a shot from any weapon. I didn't have to do any hitbox editing. I have problems setting the health, though, and you'll get 3 "Accessed None"s in your log when you enter it, shoot it, or switch to the rear turret seat when it's destroyed. I was mainly updating in the Atari Forums...

NamelessPlayer: Setting the health to 300 through DefaultProperties does NOTHING as far as the 1-shot-kill goes. I fired a Shock Rifle beam at it...damage recorded as 45, but the turret is destroyed anyway! A HellBender turret has to withstand more damage than THAT...

NamelessPlayer: Well, whaddaya know? I set it to destroy when Health >1...when it should be <1! I don't have time to test, because I don't usually get PC time on Mondays or Thursdays, so I'll have to wait 'til tomorrow to test this...

NamelessPlayer (5/7/2004): That didn't help. I'll try putting spaces at the beginning & the end in-between the parentheses.

NamelessPlayer: That STILL doesn't work. I made it so that it logs health as well. Apparently, when shot, health is NOT deducted! It also only starts taking damage after it's entered. Maybe I turned on something that wasn't neccesary?

NamelessPlayer: I posted the code above. As you can see, it didn't change much. Adding the Died function simply prevents the rear turret from taking ANY damage, and removing it will enable you to destroy the turret-with one shot, regardless of health!

NamelessPlayer (5/9/2004): It was actually MUCH simpler than expected-all I had to do was set some default properties & modify TakeDamage so that Health -= Damage! It works almost perfectly now-the only problem is, it ignores Friendly fire settings. But right now, I'm moving on to the other things.

NamelessPlayer: DOES ANYBODY ACTUALLY SEE THIS? Okay, I edited the weapons to be destroyed as well. The only thing left to do is add code to make wheels destroyable, but I can't compile my own subclass of SVehicleWheel. Maybe I'm not doing something right.

NamelessPlayer: Doesn't seem right when I'm mostly talking to myself here...

Okay, when I said the turrets were done, I got the Hellbender rear turret to act the way I wanted, but OTHER turrets get destroyed with one shot! Also, the Leviathan weapons don't seem to have any collision detection. I wonder what causes this...

WheatPuppet: I'm definitely paying attention to this. I'm defining the basics of creating a simple Battlezone mod for UT2k4 and sectored damage is an intersesting possibility to me. My guess (and it's just that) for why leviathan turrets don't have collision detection is becuause they weren't designed to take invividual damage (although neither was the hellbender's...). I don't know how plausible it would be to rewrite the Levi's collision code *shrug*.

NamelessPlayer: VERY BAD NEWS-MY UT 2004 INSTALLATION IS SCREWED! First, I started crashing when in windowed mode(a real pain in the ass when you're trying to use the log), then I tried un-installing & re-installing-but in the middle of installation, I get a BLUE ERROR SCREEN TELLING ME TO RESTART! I've only had this game for a little over a month! Any clue to what's going on?

Mosquito: Upgrade to XP or 2000, tbh, just pirate it, microsoft is a company that can do without your money.

NamelessPlayer: I've been having XP. My UT 2004 installation is back, but the problem that I tried to fix by re-installing is still there-the windowed crash bug! It's annoying when you need to check your log on a detailed map, mainly because the engine has to re-load all the textures & stuff before you can start playing again. Now, I've been having this strange bug-only the Hellbender rear turret seens to have its health working the way I want it to. I used the same code for pretty much everything-for weapons, I added "var int Health", and the Goliath turret works fine, but everything else is destroyed with one shot, and the Leviathan weapons don't collide with anything.

NamelessPlayer: Okay, the log problem is gone. However, I still have yet to figure out a way to make ALL of the turrets & weapons work properly!

Syntax Error: You should check in unreal ed if there are collision boxes for the leviathon turrets. to see the box, load the mesh and click view -> collison

NamelessPlayer (8/19/2005): It's been a long time since I've got back to this. I've borrowed the TakeDamage code from class Vehicle, and it works fine as far as the HellBender rear turret is concerned-but it DOES take up a bit of space just to fit all of the TakeDamage code in. I've tried condensing the code to a simple "event Destroyed()" with the "if (Health <1), destroy()", but I get an "infinite script recursion" error if I do it that way when the rear turret is destroyed. The code posted is the working code for a destroyable HellBender rear turret.

MythOpus: You're getting an infinite recursion because you're calling the 'Destroy()' function inside the 'destroyed' function. So... because it's health is lower than 1, it will keep calling itself over and over and over and over and over... and then you have an infinite recursion.

NamelessPlayer (8/20/2005): I can't believe I didn't notice this earlier. All I had to do was enter the DefaultProperties settings & I'm done-no functions/events needed! Now all I have to do is find out how to destroy weapons & wheels-I also want to find a way to not entirely remove the vehicle seat if I, say, destroyed the HellBender's side turret.

Page Information

2022-11-18T09:55:05.432350Z 2005-08-20T22:09:16Z Pcp0010138454pcs.dallas01.ga.comcast.net * https://wiki.beyondunreal.com/Legacy:Mod Ideas/Advanced Vehicle Damage Attribution-NonCommercial-ShareAlike 3.0