Jump to content
XCOMUFO & Xenocide

Is It Possible To Limit A Weapon's Range?


Empyrean

Recommended Posts

I was wondering if it were possible to limit a weapon's range. Since every weapon in X-Com UFO is either melee or infinite range I'd guess not, but I figured I'd ask anyway. Also, is it possible to give weapons an arcing trajectory like grenades have? I'd love to make a shotgun for close quarters work and blowing away Chryssalids, and a grenade launcher with an arcing trajectory (instead of a heavy/auto cannon with HE) would be useful too.
Link to comment
Share on other sites

If you went into the game code and started moving things around i'm sure you could give HE shells a trajectory, but the problem would be infinite range, and the fact that you'd probably have to chance HE shells into grenades, whuch would end up crashing the game if you put them into a gun. So i'd say probably not

the shotgun effect could be mimicked but it'd make it too weak anyway, so i'd say no on that one too

Link to comment
Share on other sites

Mostly with a shotgun I was looking for a limited range shot, rather than a spray effect. I just want something that is good at close range but can't be used for shooting at stuff across the map. If I could limit the range of a projectile, I could also make a flamethrower. :)

 

I'm also trying to turn Electro-flares into incendiary grenades, but despite changing all the relevant data in obdata.dat, it doesn't give me the option to prime them. More specifically, I copied all the values from the regular human grenade except for those that I already understood, such as the graphic pointers. I know what just about all the values do (thanks to Ufopaedia's obdata.dat page) but no luck. Is there another file I need to change?

Link to comment
Share on other sites

All weapons in X-COM have an infinite range and therefore:

  1. You cannot edit in a distance limiter because there are no weapons with a limited range to begin with.
  2. There isn't even a field in obdata.dat to edit.

If either of these were present, we'd be in luck. :wink1:

 

I tried to get incendiary grenades before and came up empty-handed. Not sure about going with the electroflare approach as using with a "true" damage producing thrown weapon seems like a better choice. However, editing a normal grenade to have I instead of HE damage only produces a HE explosion with no fire. Bummer. I'm afraid you are out of luck, soldier. :D

 

- Zombie

Link to comment
Share on other sites

Thanks for the replies. I decided to try using flares instead of other grenades since I wanted to keep the other grenade types.

 

Oh well. I successfully edited flares to be a weak incendiary ammunition that works with the pistol, so I can still get fire and illumination on demand. Plus, hey, a flare gun! I like using it in wheat fields. Shooting at aliens who have freaked out and dropped their weapons is fun too. I have yet to test it out on Chryssalid zombies, but it might be really useful if it does enough damage. If what I've read about fire damage triggering every time an incendiary is fired anywhere on the map, it could add up quickly.

Link to comment
Share on other sites

And, if you drop it, it flares up. This is hard coded in the executable so no matter what you turn it into, it'll provide light. Hmm. If... no, never mind.

 

I've got this amusing idea of making a mod call the nuclear lantern. 2x2 in size, heavy and does slightly lesser damage than the high explosive - plus it lights up. Brilliant!

 

- NKF

Link to comment
Share on other sites

Good luck getting it to work. Unless you can find a way to make the Flare blow up (I couldn't) or find out how to make another object glow, I don't think the nuke lantern will ever see (be?) the light of day.
Link to comment
Share on other sites

Oh it has. I've done it. I just never got round to getting an image drawn for it. ;)

 

You have to set the proper object flags to turn it into a grenade. If you look at the data for each object, look at how there are a bunch of 1's and 0's at the end of each entry. These flags are the object properties.

 

Look at what's common amongst the grenades, ammo, weapons, one-handed vs. two-handed weapons, etc. You'll soon spot a pattern. The easiest way to to convert something into a grenade is to set the flags so that they are identical to the grenade's flags, set the damage type to HE and the item's power.

 

You could turn corpses into exploding devices too... Imagine having a soldier walk over to a dead/unconcious soldier wearing power armour and arming the self-destruct mechanism.

 

- NKF

Link to comment
Share on other sites

If you're talking about OBDATA.DAT, using "edit.com" to open the file in binary with a line width of 54 will show all the relevant fields in an organized fashion, starting with the name of the object on the left. The 23rd column contains the damage done, the 32nd column holds the damage type, the 45th column shows the type of grenade (regular, proxy, smoke). If you've found a way to make a flare work as a grenade, by all means share it. What seems more likely to me is that you're just guessing it can be done because you know what flags indicate the different properties of a weapon. Unfortunately, there's a little more to it than that when you actually try to implement the changes. For example, changing the damage type of a grenade still results in an HE explosion, and even if you make the Electro-Flare's tags an identical copy of the Grenade, it still doesn't blow up. The data for that behavior is probably in the main executable someplace, but since we don't really know what the values to control that behavior would look like in the first place, finding them would be a serious undertaking. We probably wouldn't recognize it if we saw it, as the executable tends to be a whole lot harder to read than the supplemental .DAT files and we wouldn't have any familiar values from in-game observation to let us know what we were looking at.

 

If you've successfully turned a Flare into a grenade and had it function properly in-game, if you could post the binary data that you used I could compare it with my own attempt at accomplishing the same thing. I'd be pretty surprised if you got it to work just by changing the OBDATA.DAT values without tweaking something in the executable. I get the feeling that if you were able to do that, the data we'd need to change for incendiary grenades to work properly would probably be somewhere close by. This could be pretty big.

Edited by Empyrean
Link to comment
Share on other sites

It's nothing spectacular. I'll run you through what I've done.

 

Open up obdata.dat in MS-Edit, 54 columns, as per usual. Scroll down to the row for the electro flare. Go to column 45, enter overwrite mode, ctrl+p+a (for 0x01 - the trigger for standard HE grenade types), then go to column 23 and enter a power level. Just type in a lower case 'd' in overwrite mode to enter a value of 100. Save. Now load up the game, bring in some flares, and prime away. The flare should now behave just like a grenade with 100 HE power.

 

I've just tested this myself and have just blown up a reaper with a flare. As it was dark, the area where the flare was dropped was lit up until the moment it blew up. This means it's working exactly as I intended it to.

 

Going on from here, for my nuclear lantern to be complete - if I wanted to complete it - all I would do is edit the weight field to something heavy, like 6 or 12, the dimensions to 2x2, and replace the inventory and battlescape images with something more apropriate. Maybe a bucket with a radiation symbol on it or somesuch.

 

Don't misunderstand, the nuclear lantern was never intended to explode with light. It's just converting a pre-existing item into something else, and retaining the old items unique abilities.

 

The same thing would happen if you were to turn the stun-rod into a grenade. Because the stun-rod is the only item in the object list that has direct access to the melee attack, it will be able to function as both a melee weapon and a grenade. At least, the stun rod is the only object with access to the melee attack for now.

 

I'm quite sure there are tables with flags somewhere in the executables that detail the special behaviours of the various objects (like the object's default bullet image). Knowing what to look for in the executable helps.

 

- NKF

Edited by NKF
Link to comment
Share on other sites

Open up obdata.dat in MS-Edit, 54 columns, as per usual. Scroll down to the row for the electro flare. Go to column 45, enter overwrite mode, ctrl+p+a (for 0x01 - the trigger for standard HE grenade types), then go to column 23 and enter a power level. Just type in a lower case 'd' in overwrite mode to enter a value of 100. Save. Now load up the game, bring in some flares, and prime away. The flare should now behave just like a grenade with 100 HE power.

I've done this exact thing, but it didn't give me an option to prime the flare in-game. I double checked all the fields too, especially column 45. I'm using the X-Com: UFO Defense Gold Edition with xcomutil installed.

Link to comment
Share on other sites

I'm using that exact setup as well. UFO CE - with XComutil as a wrapper for the video fixes.

 

I'll grab some screenshots of my efforts.

 

For some reason, since the forum upgrade, the file upload permissions seem to have reset. Had to put them up on my webpage. While I was rattling around the dusty files, I found another goodie along the similar lines as my nuclear lantern. The Zap Rod. It's the stun rod set up to mimic the TFTD vibroblade's attack, plus it can explode. Only added that last bit in because it was funny and because it was possible.

 

- NKF

 

P. S: Check the weapon stats of the unused slots under the flare. They are 3 almost identical weapon sets for some sort of laser weapon, with the only difference being the weight of the first item is 1 strength point while the others are around 20+ strength points. Except for the incomplete weapon flags to the end of the weapon set, try plugging the firing accuracies, speeds and weapon damage into the heavy laser. What you end up with is a weapon that's weaker than the laser pistol, but take a close look at the auto-fire stats. It appears there was going to be some sort of gatling laser, but was dropped. I've tried it. Useless against sectopods, but otherwise a totally brilliant weapon.

Edited by NKF
Link to comment
Share on other sites

  • 2 years later...
Could you use the Celatid's attack but attached to a weapon? Per the wiki it arcs, which limits it's range. Not quite the same, but it is a place to start at assuming you can somehow attach the alien attack to useable weapons.
Link to comment
Share on other sites

Well, you could set the damage type of a weapon in obdata.dat to a value of 7 which should make the type acid spit like the Celated. That weapon would have an unlimited range.

 

If you are talking about extending a Celatid's attack range by giving it a different weapon to use, well, it's sort of possible I guess. It's certainly possible to give a Celatid a handheld weapon in the executable. But as of yet, we still do not know where the Celatid's integrated weapon is assigned to it. We'd need to know this in order to turn this attack off and force it to use it's new handheld counterpart. Hope this makes sense. :)

 

- Zombie

Link to comment
Share on other sites

More of what I was talking about was turning some other weapon (say auto cannon) into the celatid attack. Since in the Wiki it says the celatid attack is arched (like a grenade throw) and thus has a limited range. If there was a way to change the damage from acid to HE and then assigne that style of attack to a weapon I was thinking that might allow him to make the grenade launcher. So it would be an Auto Cannon that shoots like a celatid but does HE damage instead of acid. Though I don't know thats possible, it was merely a suggestion as to a possible way to make a grenade launcher
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...