Forum

Please or Register to create posts and topics.

Join Ops Revision Mod: M1A2 Abrams

Page 1 of 2Next

Decided to just revise the tank altogether. So, I found this beautiful low poly M1 Abrams model on TurboSquid for 10 bucks. I've never processed a new vehicle in OED, so it was a challenge. The main thing was trying to get the tracks to react to the suspension in a realistic way. IDK how novalogic did it with their model, but if anyone knows, please share.

 

I'm trying to find a way to use the coax machinegun on the turret a long with the main gun. This is what I have so far, but there's a few bugs I'm trying to work out. If anyone knows a good way to do this, let me know please.

 

Share your thoughts!

 

TBH i don't know the answer your after but i will look into it out of curiosity and so i know for text time 🙂

Give me a day or so and i will get back to you m8, been busy with work atm which is great but less time for fun...

On a side note i think it's fantastic you have gone from scratch to a working in game model, well done!

oscarmike_247 has reacted to this post.
oscarmike_247
Quote from 2DNED on April 6, 2022, 5:47 pm

TBH i don't know the answer your after but i will look into it out of curiosity and so i know for text time 🙂

Give me a day or so and i will get back to you m8, been busy with work atm which is great but less time for fun...

On a side note i think it's fantastic you have gone from scratch to a working in game model, well done!

Well it wasn't completely from scratch. At the time I was not aware of the Joint ops objects to .max files available on this site. I was using the JO objects to .OBJ found on NovaHQ. Which I've heard are far older and less quality than what is available now. (Side note: I can't seem to download the files on this site, it says I'm not allowed?) But the m1a1 .obj gave me enough of an idea on how to set it up. Then using the naming conventions and info from the OED manual to do the part animations. From there it was just a matter of figuring out the wheel and suspension control registers.

Currently, the version in the video is simply scaling the tracks individually on the z axis to basically 'smoosh' them down, so to speak, with the wheel suspension. Which looks decent for the most part, but it gets out of alignment sometimes as the wheels each move independently with the terrain, where as the bottom of the track can only stay flat as it moves up and down.

I was chatting with DH and he mentioned that Nova used bones to do their tank tracks. I'm experimenting with that now.

 

As for the Coax machinegun, I currently have it set up much like the apache helicopter in order to achieve the ability to switch to the MG while on the main gun.

It works for the most part. The bullet and muzzle flash user points are actually on the tank hull model, not the turret. On the hull model, I have a no mesh object set up as the turret with control registers to YAW with the turret (VEHICLE_GUNYAW). This is needed to keep the top mounted 50 in place anyway.

attached to the turret no mesh object is another no mesh object that is positioned at the barrel center point so that it can also pitch with the main gun pitch. This is the object that the coax bullet and mflash user points are attached to.

So in the items.def, I have the M1A1 set up to have a primary weapon of the Coax MG weapon script. the main gun uses "addewepG" which gives you the ability to right click and use the primary weapon of the vehicle (IE the coaxMG).

 

Here's the issues I've run into.

  1. the "ai_function cveh" used on the tank, does not allow you to switch to the vehicle primary weapon from the main gun. It will switch and even switch camera positions. but will not allow you to fire the weapon or sight in. To get around this, I changed it to "ai_function chel". which doesn't seem to affect the behavior of the tank at all, but it does allow you to right click and switch to the vehicle primary gun.
  2. If you attach to the driver position, you can still fire the coax MG from the driver position, which will fire where ever the turret is pointing. While that is cool, it's not realistic.
  3. if you attach to the driver position, then switch to the main gun, you can switch to the coax, but it will not fire until you switch to the top mounted 50, and then switch back to the main gun. (weird)
  4. sometimes if you switch to the driver position from the main gun while using the coax, it will cause a glitch that will not allow you to change position or exit the tank. leaving you only option to kill yourself and respawn.
  5. The "VEHICLE_GUNPITCH" Control register seems to not work in the game, while the VEHICLE_GUNYAW) does. So initially, the coax would yaw side to side with the turret, but would not pitch with it. So to get around this, I assigned the pitch of the coax to the "EWEAP_GUNPITCH" control register, and voila it worked! the gun would yaw and pitch with the main turret.... That is until you have an AI controlling another tank (or possibly any emplaced weapon) on the map. In which case, your coax mg on the turret seems to be globally controlled by the AI on any other emplacement. So if an AI pitched their gun up or down, it will move yours. -_-

 

Those last two are the two main issues I want to work out. The last one would be fixed if only the "VEHICLE_GUNPITCH" control register was working. I'm not sure why it's not.

 

Thanks for any info! If I can get the tracks working better I may try to throw together a tutorial.

Ok im just having a look at the files i have atm...

See if i can work some of it out,
number #5 with AI check the id number in items.def isn't already used for another item, can cause this. I assume something is used else where with the same name/id.

* Didn't realise you re registered, I moved the user so can download and use site properly again.

 

 

Good thinking. Ill take a look at it.

Also the weapon.def. ill look at the weapon ids. There's no new entry in the items def for the coax mg. Its just a weapon script which is linked in the items def by the tank entry as its primary weapon.

 

Thanks to DareHacker sending me the original abrams model in 3ds max, i was able to figure out how to achieve the track suspension effects to near perfection using bones and exporting as a skinned mesh. So now the track will bend and move with each wheel But there's an issue getting the user point for the top mounted 50 cal to follow the turret rotation. As soon as i get that figured out ill try to make a tutorial on making one from scratch.

 

Thanks for the info. Let me know if you figure anything out.

Cheers

Could you post the items.def for the tank?

The items is a puzzle you have to follow lol, see which weapon is used and follow it back. I would say there is another gun 50cal or such which use the same files.

But there's an issue getting the user point for the top mounted 50 cal to follow the turret rotation

At a quess i would say the player isn't positioned properly but hard to say with out the files...
UPG01 ctrlx24 or what ever seating your using, check the points point forward not up. You can see this in the SuperOED it will have a green line pointing up or forward. If pointing up just needs to be rotated in 3dmax, if pointing forward it's not that issue.

 

 

oscarmike_247 has reacted to this post.
oscarmike_247

Ok so here is the items.def

 

begin "Drivable M1A1 Tank"   //m1
  id 100164
  type vehicle
  sid Dm1a1 
  graphic Dm1a1

  Virtualdisplay tankdrvr  camera
  input_function tank				// also specifies camera computation information 

  attrib: AIData neutral NoScar PlayerControl  forceasset DynamicShadow UseVK exp1 HasTurret
  ai_function cveh
  move_function ctank    //was catv
   turn_rate 30		//was 40
  turn_rate2 15		//was 25
    acceleration 8
    deceleration 20
    slip_speed 0		//traction/slip/skid on land (0 = off, bigger = better traction)
    player_speed 68		//real speed 80kph ( ungoverned combat speed on road )
  water_speed 20		//tanks don't float
    slip_slope	70		//was 40
    max_slope	70		//was 50 
    torque   7
    mass 135		//was 28
    physics     1
  spring 6
    spring_comp 35
  shock 2
    minai		1
    lean 0
    lean_velocity 0
    pitch 0
    pitch_velocity 0
    bob 0
    flip 15
  particlefx Effect_heloHeat1 FX00
  particlefxw1 Effect_DirtWake_T FX01 FX_DirtWake_T_SN
  particlefxw2 fx_tank_dch FX02 fx_tank_dch_SN
  	particlefxw3 fx_sml_wk FX01
  particlefxw4 fx_sml_wk_f FX01
  particlefxs Effect_DirtWakeS FX01 FX_DirtWakeS_SN
  render_function tank
  default_aip d_5ton
  shadow shadow6.tga   4.0  11.0  0.0  -0.15
  husk Dm1a1X
  husk_sub_part_types 01_HULL 02_CHUNK_M 03_CHUNK_M 04_CHUNKNP_M 05_CHUNK_M 06_CHUNK_M 07_CHUNK_M 08_CHUNK_M 09_CHUNK_M 10_CHUNK_M 11_CHUNK_M 12_CHUNK_M 13_CHUNK_M 14_CHUNK_M 15_CHUNK_M 16_CHUNK_M
  unit_type 2
  hp 30000			//was 26000
  damage_reduc_pp 0.15  0.30
  armor 80 80
  criticalhp 7001	//was 5001
  criticaldrain 100	//was 200
  score 20
  heatsig  1000
  radarsig 500
  particledeath fx_tank_Exp_M
  particleh2odeath Effect_H2OVeExp
  particlefinale Effect_VehDrtPuf
  addeweap ewep01 100166
  addeweapC ewep02 100182
  sound_profile SP_M1A1 
end

 

The last few lines tell us it is using item ID 100166 and 100182

addeweap ewep01 100166
addeweapC ewep02 100182

If we go to those items in the list

10166 = "Turret for M1A1"
10182 = "Gun for M1A1" = graphic M150cal. So we know it uses a 50cal

 

 

 

 

oscarmike_247 has reacted to this post.
oscarmike_247

Thanks for the reply. So I have figured out the conundrum, sort of.

There's a lot to un pack here, so I'll try to make it an organized read. lol

I know you know a lot of what I'm about to go on about, but this will get anyone else up to speed on what I've found so far in my experimenting. So maybe they can use the info.

 

Just to be sure that we're on the same page. When I say coax, I'm referring to the small M240 machinegun that sticks out just to the right side of the main cannon barrel. Not the top mounted 50.

The idea is to make a way for the player to be able to control the main cannon, and the coax mg from the main gun's position.

 

About the top mounted 50

So far, the top mounted 50 is not an issue. The only issue I'm having with it, is to get it to rotate with the main turret on the bone mesh version of my tank hull. I have it working fine on my original non skin mesh hull. But not for the bone mesh version, I think it has something to do with the game recognizing object 01 (Aka BN01) as the actual vehicle entity. So the UP for the 50 cal attach must be named UPG01 in order for it to be associated with the vehicle entity and be controlled by the proper control register. At least this is my theory. But that's going to require me to re do my bone structure, I'll experiment with that later.

Right now, I have a bone just for the turret by itself (still part of the same tree, it just doesn't influence any skinned mesh or other bones.) positioned at the main turret attach point. then there is the UPG for Ewep02 (50 cal). I have the "turret" bone set to rotate with control register "Vehicle_GunYaw". which should make the userpoint move with the turret (aka the turret bone that moves with the turret emplacement) the 50 cal works fine in the game, but it does not rotate with the turret. it just floats above the hull.

 

About the coaxial MG

After playing around with the weapon.def, ranks, id's, categories, subclass scripts....etc  I determined that you cannot create a subclass for emplaced weapons like you would for auto to semi auto for hand held guns . Nor can you assign two weapon scripts to the same emplacement and magically be able to switch between the two. Bummer...

To get around this, I set it up like the apache. Which has a primary weapon script assigned to it (not an emplaced weapon built in the items.def, just a weapon script). The apache's gunner which uses an emplaced cannon, has the ability to switch between the heli's primary weapon rockets and the front cannon. So, I figured, why couldn't this work for a tank?

This requires that the tank have a primary_weapon in the items.def script for it's coax mg, and the model as a vehicle to have User points for muzzle flash, bullet, bcasing...etc. but also, these user points need to rotate and pitch with the turret.

Easy, I already had a no mesh sub object on the tank hull with a control register to yaw with the main gun yaw using vehicle_gunyaw. So I just needed to set my coax weapons user points to attach to it (02 turret) using ~02 a, b, c...etc. but, I needed the user points for the coax to pitch without pitching the whole turret sub object 02 (which would cause the 50 cal user point to pitch as well). So, I attached another sub object to '02 turret' with a center point in the same place as where the barrel pitch pivot would be, named '03 coax'.

the idea was to have sub object 03 pitch up an down with the barrel of the main gun emplacement using 'vehicle_gunpitch', and it would yaw with object 02, thus moving the coax bullet and mflash userpoints attached to sub object 03, allowing the player to aim the coax along with the turrets main cannon.

The problem is that the vehicle_gunpitch control register did not seem to work. the coax would follow the main guns yaw movement, but not pitch. So I thought maybe it was an issue with the user point numbers for the coax. Perhaps the game has to associate the user points with the root parent object (01) on order to register it as the vehicle's "gun pitch". So I played around with the turret sub object names and how they attached to one another as well as their user point numbers. Didn't work.

I then changed the pitch control register for the coax to "eweap_gunpitch" and it worked! but for some reason, the pitch was globally influenced by the movement of any bot on any emplaced weapon...

As you suggested, I looked at all of my id entries that I had created in the items def (especially anything associated with the tank), but they were all unique with no conflicts. I checked the weapon.def to make sure the weapon id's were unique.

I think the reason this is happening is because you are telling the gun to pitch as an emplaced weapon on a vehicle, which is not an emplaced weapon. It just has an emplaced weapon attached to it, which is technically a separate entity. I'm not sure...

 

The solution to the gun pitch AI control issue, and a few others

I was unable to find any reason why the coaxial MG pitch control for the player was influenced by bots using "Eweap_gunpitch". But, I did get the "vehicle_gunpitch" control register to work, which solved the AI issue.

I started looking into the AI profile of the apache and M1 (which by default is d_5ton) because I found that if you change the IA profile of the M1 to anything "Helo" in the MED, it would cause the gun pitch to work with 'vehicle_gunpitch'.

So, I edited the d_5ton.aip file and changed the "Type" from "Ground" to "Helo".

And presto, it works. And as far as I can tell, it has not changed anything as far as how the tank handles, or it's behavior when controlled by an AI.

It also seems to have fixed the bug where switching from the driver seat to the main gun would cause you to not be able to fire the coax until you switched to the 50 cal. As well as the getting stuck in the tank bug. It still does this if you try to shoot immediately after switching position. but not nearly as bad as it was. And if that happens, you just have to switch seats to fix it. Not a huge deal. You just have to wait like half a second after switching to the main gun before you shoot the coax.

 

 

I'm very close to making this work well enough. I cleared up the three major bugs for the most part. It won't be perfect, but it's interesting to see it work in game. And I think it will work well enough to be able to use it and have fun, even if you have to put up with a few quirks.

 

Here's my script from the items.def. It's a bit sloppy with some random stuff from experiments.

 

begin "Drivable M1A1 Tank"
id 100164
type vehicle
unit_type 3
sid Dm1a1
graphic Dm1a1

Virtualdisplay tankdrvr camera
input_function tank

attrib: neutral NoScarl PlayerControl forceasset DynamicShadow exp1 HasTurret EWeap AIData UseVK //pilotonly Missile
ai_function chel
move_function ctank
//disk_function helo
turn_rate 40
turn_rate2 80
acceleration 10
deceleration 20
slip_speed 50
player_speed 68
slip_slope 70
max_slope 70
torque 7
mass 60
physics 1
spring 6
spring_comp 35
shock 2
minai 1
lean 0
lean_velocity 0
pitch 0
pitch_velocity 0
bob 5
flip 15
particlefx Effect_heloHeat1 FX00
particlefxw1 Effect_DirtWake_T FX01
particlefxw2 fx_tank_dch FX02
particlefxw3 fx_sml_wk FX01
particlefxw4 fx_sml_wk_f FX01
particlefxs Effect_DirtWakeS FX01
render_function tank
default_aip d_5ton
shadow shadow6.tga 4.0 11.0 0.0 -0.15
husk Dm1a1X
husk_sub_part_types 01_HULL 02_CHUNK_M 03_CHUNK_M 04_CHUNKNP_M 05_CHUNK_M 06_CHUNK_M 07_CHUNK_M 08_CHUNK_M 09_CHUNK_M 10_CHUNK_M 11_CHUNK_M 12_CHUNK_M 13_CHUNK_M 14_CHUNK_M 15_CHUNK_M 16_CHUNK_M
unit_type 2
hp 26000
damage_reduc_pp 0.15 0.30
armor 80 80
criticalhp 5001
criticaldrain 100
score 20
radarsig 500
particledeath fx_tank_Exp_M
particleh2odeath Effect_H2OVeExp
particlefinale Effect_VehDrtPuf
addeweapg ewep01 100166
addeweap ewep02 107002 //15 20 180 180 <down angle> <up angle> <right angle> <left angle>
sound_profile SP_M1A1

attrib: EWeap
primary_weapon WPN_M1TURRET_MG
weaplbup bullet03
weaplmup mflash03
weaplcup mflash03
weaprbup bullet03
weaprmup mflash03
weaprcup mflash03
end

 

Short video on how it's looking.

Changed the muzzled flash effects a bit. Such as decreasing the time the flash is seen, adding some heat distortion/pressure wave, and the smoke puff after firing seen on the real tank. You can now operate the Coaxial M240B from the main gun position, mostly bug free now. only a few minor quirks.

 

Here's the issues I've run into.

  1. the "ai_function cveh" used on the tank, does not allow you to switch to the vehicle primary weapon from the main gun. It will switch and even switch camera positions. but will not allow you to fire the weapon or sight in. To get around this, I changed it to "ai_function chel". which doesn't seem to affect the behavior of the tank at all, but it does allow you to right click and switch to the vehicle primary gun.
  2. If you attach to the driver position, you can still fire the coax MG from the driver position, which will fire where ever the turret is pointing. While that is cool, it's not realistic.
  3. if you attach to the driver position, then switch to the main gun, you can switch to the coax, but it will not fire until you switch to the top mounted 50, and then switch back to the main gun. (weird)
  4. sometimes if you switch to the driver position from the main gun while using the coax, it will cause a glitch that will not allow you to change position or exit the tank. leaving you only option to kill yourself and respawn.
  5. The "VEHICLE_GUNPITCH" Control register seems to not work in the game, while the VEHICLE_GUNYAW) does. So initially, the coax would yaw side to side with the turret, but would not pitch with it. So to get around this, I assigned the pitch of the coax to the "EWEAP_GUNPITCH" control register, and voila it worked! the gun would yaw and pitch with the main turret.... That is until you have an AI controlling another tank (or possibly any emplaced weapon) on the map. In which case, your coax mg on the turret seems to be globally controlled by the AI on any other emplacement. So if an AI pitched their gun up or down, it will move yours. -_-

 

So I think I've got all the kinks worked out.

I ran into some other bugs with switching between the main turret and the driver position. Again, you could still shoot the coax as a driver, when switching from driver to the turret, it wouldn't allow you to shoot the coax until you switched back to driver then back to the turret, and also, switching to the driver position from the turret while in coax mode would cause a sysdump.

All of that was solved by renaming the user point for the driver seat from "UPG01 CTRLx25" to "UPG01 DRVRx25".

So I think we've got it. A fully functional coaxial machine gun on the main turret that you can control along with the cannon by right clicking. It seems to be working flawlessly now!

Page 1 of 2Next