Jump to content

Tank Ammo!


Shortstop4313

Recommended Posts

Hello Everyone,

 

Using the handy-dandy executable worksheet, and modifying it for the Windows version with the broke out 'Tactical.exe' I've been doing a lot of work to make HWP a lot more scary for both the Human and the Alien side. I felt this needed to be done, especially with the Reapers, since they are so laughable to fight. They are all but worthless, even on the higher levels of difficulty.

 

However, I've run into a small issue: Ammo for the cannon tank. Does anyone know where the damage and number of shots is stored? I've edited the turret in the Ufo Defense.Exe to change the values, but I'm having problems changing the damage and the number of shots.

 

1) I can't find the number of shots for ammo reliably. It's not in Obdata.dat and I can't seem to find it (searching for just '1e' is like trying to sort hay) in the two EXEs.

2) Changing the damage in the UFO Defense.EXE does not change the damage in the game, seemingly. Testing with Tactical.exe now.

 

Can anyone HBO?

Link to comment
Share on other sites

1) I can't find the number of shots for ammo reliably. It's not in Obdata.dat and I can't seem to find it (searching for just '1e' is like trying to sort hay) in the two EXEs.

It's in the GeoScape EXE segment. Afraid I can't be more specific then that.

 

2) Changing the damage in the UFO Defense.EXE does not change the damage in the game, seemingly. Testing with Tactical.exe now.

It's in the Tactical EXE segment.

 

The original DOS game used two EXEs, one for the GeoScape display, one for the Tactical display.

 

The Windows version (CE) used one single EXE, which handled both the GeoScape and the Tactical systems. This can be "split" into two EXEs like the DOS version. When using the split executables (eg via XcomUtil), you're not using the "combined" EXE at all. Likewise, when using the combined EXE (which is usually called something like "UFO Defense.exe"), you're not using the split executables.

Link to comment
Share on other sites

It's in the GeoScape EXE segment. Afraid I can't be more specific then that.

 

That's good enough, Mr. Bloke. At least I know where to look now.

 

 

 

It's in the Tactical EXE segment.

 

The original DOS game used two EXEs, one for the GeoScape display, one for the Tactical display.

 

The Windows version (CE) used one single EXE, which handled both the GeoScape and the Tactical systems. This can be "split" into two EXEs like the DOS version. When using the split executables (eg via XcomUtil), you're not using the "combined" EXE at all. Likewise, when using the combined EXE (which is usually called something like "UFO Defense.exe"), you're not using the split executables.

 

I've used X-com util in the past, so that makes perfect sense. I appreciate pointing me in the right direction. If I happen to find the offset, I'll pass along info about what I changed and what the bits around it looked like.

Link to comment
Share on other sites

  • 1 year later...
That's good enough, Mr. Bloke. At least I know where to look now.

 

 

 

 

 

I've used X-com util in the past, so that makes perfect sense. I appreciate pointing me in the right direction. If I happen to find the offset, I'll pass along info about what I changed and what the bits around it looked like.

 

The main problem with modifying tank ammo is there are several areas that need to be adjusted in order to avoid inventory problems. There is one field in GEOSCAPE that sets the amount of ammo for the turrent in UNITREF.DAT. Another set of fields check to ensure you have enough ammo to load it onto a plane and then deduct the correct amount from base stores or add that amount to base stores when the tank is unloaded. Yet another field handles the post-battle craft reload which returns all unused ammo to the base and then attempts to re-equip the tank back to the plane. Finally, there is a duplicate set of fields in the same area of code (possibly for a base defense post-battle, but I am not sure on that). As part of this post-battle algorithm, there is a bit-shift that must be adjusted if you exceed 31 for the amout of ammo and adjusted again if you were to go over 63.

 

If you use the DOS version, the code is pretty clear. In the CE version, they obfuscated a lot of the values.

 

You can't adjust the rocket tank without also adjusting the FBL tank at the same time. (Not without adding new code to handle them seperately.)

Link to comment
Share on other sites

  • 3 weeks later...

 

TACTICAL stores the details about the amount of damage, the type of damage, and the TU cost and Accuracy on each attack type for the turrents. It is GEOSCAPE which sets the amount of ammo for each tank in UNITREF.DAT.

In DOS1.4 the addresses are 4ED2A (AP), 4ED30 (rocket and FBL), and 4ED36 (beams). In my version of CE, the address for the cannon ammo is at 44ED27.

 

Changes the areas will change the amount in battlescape but altering ONLY these areas will cause a host of inventory problems as one has to alter the code for adding a subtracting the appropriate amounts from base inventory when adding or removing tanks from crafts and post-combat.

Link to comment
Share on other sites

  • 1 month later...
  • 3 years later...

Feeling like an archeologist digging out almost 4 year old topic but anyway...

 

TACTICAL stores the details about the amount of damage, the type of damage, and the TU cost and Accuracy on each attack type for the turrets.

I want to make some changes to SWS stats mentioned above in my TFTD Windows CE version. I've found the right offsets, made the changes but some of them don't seem to appear in game.

For example "amount of damage" for Displacer P.W.T which I set to 200 (same as Disruptor Pulse Launcher) in Ufopedia is still 140.

It's the same problem as author of the topic found editing UFO Defense:

2) Changing the damage in the UFO Defense.EXE does not change the damage in the game, seemingly. Testing with Tactical.exe now.

 

I've done other changes in TFTD .exe (X-COM subs and USO's stats) and game accepted them without problem. Anyone got an idea why this time it's otherwise??

Link to comment
Share on other sites

Feeling like an archeologist digging out almost 4 year old topic but anyway...

 

 

I want to make some changes to SWS stats mentioned above in my TFTD Windows CE version. I've found the right offsets, made the changes but some of them don't seem to appear in game.

For example "amount of damage" for Displacer P.W.T which I set to 200 (same as Disruptor Pulse Launcher) in Ufopedia is still 140.

It's the same problem as author of the topic found editing UFO Defense:

 

 

I've done other changes in TFTD .exe (X-COM subs and USO's stats) and game accepted them without problem. Anyone got an idea why this time it's otherwise??

 

This is because there is another set of data just used for the in-game UFOpaedia, since the game was originally two separate programs.

Link to comment
Share on other sites

Thanks Tycho! You're the man :-)

 

One more thing. You wrote that when changing the amount of tank turret ammo there are couple of fields in Geoscape.exe / Main .exe (for CE version) that'll need to be changed as well.

These are just specific offsets? Is there any list of them?

Link to comment
Share on other sites

Thanks Tycho! You're the man :-)

 

One more thing. You wrote that when changing the amount of tank turret ammo there are couple of fields in Geoscape.exe / Main .exe (for CE version) that'll need to be changed as well.

These are just specific offsets? Is there any list of them?

 

it's not just a few offsets, you would have to change the checks and then the calculations. The entire routine that handles checking ammo and swapping it between the tank and base is hard coded to the existing values of each turrent. Changing this for just one tank was the biggest problem I had, and that was in EU. I've never looked at that code in TFTD.

Link to comment
Share on other sites

Sounds very complicated to me and my nonexistent coding skills.

it's not just a few offsets, you would have to change the checks and then the calculations. The entire routine that handles checking ammo and swapping it between the tank and base is hard coded to the existing values of each turrent. Changing this for just one tank was the biggest problem I had, and that was in EU. I've never looked at that code in TFTD.

But You've managed overrode that code modding the Gauss Tank in TFTDextender?

BTW, sorry for all those questions but I'm just curious as I admire very much both Your modding skills and amount of work in EU and TFTD.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...