Jump to content

Modding questions


Catwalk

Recommended Posts

I'd like to remove the launcher property of the Disruptor Pulse Launcher, is this possible? I'm also interested in turning items into primer-0 grenades so they explode when a soldier is shot, how can I do this? Saw it mentioned elsewhere by NKF. Thanks in advance!
Link to comment
Share on other sites

All you would need to do is untick offset 51 in obdata.dat (aka change it's value to 0) to remove the waypoint feature. You cannot have items with a grenade property auto-prime themselves at the start of a mission. You would need to prime all the items manually. :oh:

 

- Zombie

Link to comment
Share on other sites

No, actually, there may be a way. See the wiki's obdata page: https://www.ufopaedia.org/index.php?title=OBDATA.DAT

 

Look up offset 38 - the ammo quantity field. It supplies the detonation condition if the item is marked as a grenade.

 

Grenades default to 10 (so in theory, after turn 5, it'll explode). However they don't blow up. Here's the caveat: Offset 49 (Is Ammo?) must be set to true.

 

I modified obdata.dat so that the grenade's is-ammo field is set to true. Started a brand new game, launched the Skyranger on the first mission, then had the first soldier drop her grenade. Waited until after turn 5, and sure enough: boom!

 

Funnier still was the fact that the grenades on the soldiers that got killed exploded in sequence as they dropped onto the ground - all the way back along the Skyranger. You don't see chain reactions of 3 or more explosions in UFO often! :oh:

 

You know, this could actually be used to set up a timed scenario with the elerium pods where you must reach them in X amount of turns - or they blow up.

 

Let me just go try that. A 250 HE elerium pod...

 

edit:

 

Woo! It works! Make sure the default timer is greater than 0. 1 or 2 is recommended as minimum.

 

- NKF

Link to comment
Share on other sites

No, actually, there may be a way. See the wiki's obdata page: https://www.ufopaedia.org/index.php?title=OBDATA.DAT

 

Look up offset 38 - the ammo quantity field. It supplies the detonation condition if the item is marked as a grenade.

 

Grenades default to 10 (so in theory, after turn 5, it'll explode). However they don't blow up. Here's the caveat: Offset 49 (Is Ammo?) must be set to true.

 

I modified obdata.dat so that the grenade's is-ammo field is set to true. Started a brand new game, launched the Skyranger on the first mission, then had the first soldier drop her grenade. Waited until after turn 5, and sure enough: boom!

 

Funnier still was the fact that the grenades on the soldiers that got killed exploded in sequence as they dropped onto the ground - all the way back along the Skyranger. You don't see chain reactions of 3 or more explosions in UFO often! ;)

 

You know, this could actually be used to set up a timed scenario with the elerium pods where you must reach them in X amount of turns - or they blow up.

 

Let me just go try that. A 250 HE elerium pod...

 

edit:

 

Woo! It works! Make sure the default timer is greater than 0. 1 or 2 is recommended as minimum.

 

- NKF

This sounds important enough to make it more prominent in the wiki, no? The problem with understanding obdata.dat (at least for me sometimes) are those multi-use variables which have 3 or more inconsistent and disparate uses. (Not to mention those stupid bit fields, but that's a different story). I realize that the programmers were trying to conserve memory space by reallocating a variable, but that is frowned upon in all the programming classes I have took. How much space would an extra two variables consume? :oh:

 

- Zombie

Link to comment
Share on other sites

Can I do this with BB's editor? There is an offset thingy in the weapons editor that I'm afraid of touching. Also, when using XcomUtil would it be safe to delete the .xcu executables it creates (tactical.xcu and geoscape.xcu) to have it generate new ones, or would I lose any data by doing so?
Link to comment
Share on other sites

My obdata.dat file would overwrite (or rather reset) all your other changes so it's better to add the changes yourself. Besides, I tested this in UFO, and if you were wanting to do it in TFTD, you'd have to do it from scratch anyhow. If you have MS-Edit, (just go to a command prompt screen and type edit and hit enter), let me know and I can run you through all the steps you need to go through to apply these changes. It's not a terribly difficult process.

 

Since I started using MS-Edit for most of my hex-editing needs, I haven't made much of us any game editors since. However knowing the amazing stuff BB's tools can do, anything goes.

 

This sounds important enough to make it more prominent in the wiki, no? The problem with understanding obdata.dat (at least for me sometimes) are those multi-use variables which have 3 or more inconsistent and disparate uses. (Not to mention those stupid bit fields, but that's a different story). I realize that the programmers were trying to conserve memory space by reallocating a variable, but that is frowned upon in all the programming classes I have took. How much space would an extra two variables consume? :oh:

 

- Zombie

 

It's actually the notes that are on the wiki's obdata.dat page that reminded me of that. However, due to the very reason of the current trend of discouraging multi-use variables, I honestly don't know what consequence meddling with the is-ammo? flag for non-ammo items will have. ;)

 

- NKF

Link to comment
Share on other sites

Just did a little more testing and I now know one effect of the Is-Ammo? field that might not be overly desireable. Attached to a grenade, it removes your ability to prime the grenade. And for some reason will show the turn detonation condition as 'ammo' for the grenade. Could be useful if you want all the grenades to start as if they're all armed as 0-turn timers or after a certain number of turns.

 

The timed 250 strength elerium pod though is fun! It simply blew apart a medium scout as if I'd shot it down and the game had rolled a really strong pre-explosion! In TFTD this would really rip apart some of the alien subs. In colonies, since the IBA devices are spread out and you do get Zrbite drops scattered around the interior level colony, navigating around the colony could be very hazardous.

 

- NKF

Link to comment
Share on other sites

  • 2 weeks later...

This might help you building your new explosives. Note that the "turn to explode" value is absolute, not relative: If set to 10, it'll explode on turn 10, not ten turns after the item is created.

 

For example, if you set corpses to explode on turn 10, all creatures that die after that turn will explode pretty much right away - not ten turns after their death.

shotBB0000.gif

Link to comment
Share on other sites

I managed to figure out how to do it in hex editing. Yes, real hex editing!! I feel like the world shall lie at my feet before too long now.

 

Thanks for answering the question I was about to ask, as the turn system confused me. I guess for practical purposes, only a value of 0 makes sense as I wouldn't want the number of passed turns to be a gameplay factor in this regard.

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...