Jump to content


Photo

Is It Possible To Limit A Weapon's Range?


  • Please log in to reply
14 replies to this topic

#1 Empyrean

Empyrean

    Sergeant

  • Forum Members
  • PipPipPip
  • 47 posts

Posted 11 July 2006 - 11:52 PM

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.

#2 Blehm 98

Blehm 98

    Colonel

  • [Global Moderators]
  • PipPipPipPipPip
  • 2,626 posts

Posted 12 July 2006 - 08:12 AM

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
Top Secret Xenocide Status report

BF2 Hackers =5SF= have busted
]sD[ Engageo <-- couldn't get him banned though, no screenshot of him ingame
]sD[Nomisser
an AK guy
The anti-logarithm of the logarithm of X plus the logarithm of Y equals X times Y, or 10^(logX + logY) = XY
Posted Image
I hate spider solitaire...

#3 Empyrean

Empyrean

    Sergeant

  • Forum Members
  • PipPipPip
  • 47 posts

Posted 12 July 2006 - 04:55 PM

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?

#4 Zombie

Zombie

    Colonel

  • Xenocide Creative-Text Departmen
  • 2,947 posts

Posted 12 July 2006 - 06:16 PM

All weapons in X-COM have an infinite range and therefore:
  • You cannot edit in a distance limiter because there are no weapons with a limited range to begin with.
  • 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
The Mr. Grognard of X-COM

Zombie: Empirical data's your only man, when formulating a research plan.
A soldier's death is never in vain if it makes the formula more plain.
A few dozen make a better case for refining that third decimal place.
They call me Zombie because I don't sleep, as I slowly struggle to climb this heap,
of corpses, data points, and trials, but from the top - I'll see for miles!


#5 Empyrean

Empyrean

    Sergeant

  • Forum Members
  • PipPipPip
  • 47 posts

Posted 12 July 2006 - 07:48 PM

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.

#6 NKF

NKF

    Commander

  • [Global Moderators]
  • PipPipPipPipPipPip
  • 4,798 posts

Posted 12 July 2006 - 11:36 PM

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
Lord High Generalissimo Ruler Supreme of Norm's Anti Pedant Society (NAPS).

Number of members: 1

#7 Empyrean

Empyrean

    Sergeant

  • Forum Members
  • PipPipPip
  • 47 posts

Posted 13 July 2006 - 03:42 PM

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.

#8 NKF

NKF

    Commander

  • [Global Moderators]
  • PipPipPipPipPipPip
  • 4,798 posts

Posted 14 July 2006 - 04:49 AM

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
Lord High Generalissimo Ruler Supreme of Norm's Anti Pedant Society (NAPS).

Number of members: 1

#9 Empyrean

Empyrean

    Sergeant

  • Forum Members
  • PipPipPip
  • 47 posts

Posted 14 July 2006 - 05:34 AM

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, 14 July 2006 - 05:35 AM.


#10 NKF

NKF

    Commander

  • [Global Moderators]
  • PipPipPipPipPipPip
  • 4,798 posts

Posted 14 July 2006 - 08:01 AM

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, 14 July 2006 - 08:43 AM.

Lord High Generalissimo Ruler Supreme of Norm's Anti Pedant Society (NAPS).

Number of members: 1

#11 Empyrean

Empyrean

    Sergeant

  • Forum Members
  • PipPipPip
  • 47 posts

Posted 14 July 2006 - 03:41 PM

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.

#12 NKF

NKF

    Commander

  • [Global Moderators]
  • PipPipPipPipPipPip
  • 4,798 posts

Posted 14 July 2006 - 06:53 PM

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, 14 July 2006 - 07:17 PM.

Lord High Generalissimo Ruler Supreme of Norm's Anti Pedant Society (NAPS).

Number of members: 1

#13 Aknazer

Aknazer

    Squaddie

  • Forum Members
  • PipPip
  • 8 posts

Posted 28 May 2009 - 08:15 AM

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.

#14 Zombie

Zombie

    Colonel

  • Xenocide Creative-Text Departmen
  • 2,947 posts

Posted 28 May 2009 - 08:07 PM

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
The Mr. Grognard of X-COM

Zombie: Empirical data's your only man, when formulating a research plan.
A soldier's death is never in vain if it makes the formula more plain.
A few dozen make a better case for refining that third decimal place.
They call me Zombie because I don't sleep, as I slowly struggle to climb this heap,
of corpses, data points, and trials, but from the top - I'll see for miles!


#15 Aknazer

Aknazer

    Squaddie

  • Forum Members
  • PipPip
  • 8 posts

Posted 31 May 2009 - 12:04 AM

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