Difference between revisions of "Talk:Item Stacking Bug"

From UFOpaedia
Jump to navigation Jump to search
(Effects of different items)
 
 
(14 intermediate revisions by 5 users not shown)
Line 12: Line 12:
  
 
TODO: More testing. -- [[User:NinthRank|NinthRank]] 15:35, 6 November 2007 (PST)
 
TODO: More testing. -- [[User:NinthRank|NinthRank]] 15:35, 6 November 2007 (PST)
 +
 +
-----
 +
 +
I might just point out that [http://www.strategycore.co.uk/files/index.php?dlid=641 my editer] now lets you create an item table ordered however you wish, and also lets you stack as many items as you like. Along with a whole bunch of other item based edits.
 +
 +
Interesting point on the "must stack a weapon" first thing. That's probably got something to do with the [[UNITREF.DAT]] offsets 53 and 54 only handling one item each. - [[User:Bomb Bloke|Bomb Bloke]] 16:45, 6 November 2007 (PST)
 +
 +
----
 +
 +
Thank you very much for that editor; it's a big help! I'm afraid that the stacking/firing order might be a little more complicated than I thought at first. I could not not activate the melee attacks for plasma weapons: if I placed the gun first, it would not shoot, and I got the regular stun attack. If I placed the Stun Rod first, the only option that I got was "Throw." If I placed two plasma weapons on top of each other, Plasma Rifles would get priority (they would fire) over Plasma Pistols, and Heavy Plasmas would get priority over both.
 +
 +
On a related note, a Laser Rifle in melee can usually kill a Floater (modified to 255 health) in one strike. Mutons, on the other hand, never seem to take melee damage. Perhaps this is a Collector's Edition bug? -- [[User:NinthRank|NinthRank]] 20:51, 10 November 2007 (PST)
 +
 +
The problem with plasma weapons not having melee might have something to do with their being listed after Stun Rods. I tested stacking a Stun Rod on an Electroflare (listed just after the Stun Rod in the Sell/Sack screen), and I got the same effect: stun, but not the physical-damage one. Stacking on a Psi-Amp (listed just before the Stun Rod) did activate the Psi-Amp's melee attack. -- [[User:NinthRank|NinthRank]] 21:02, 10 November 2007 (PST)
 +
 +
----
 +
 +
Had a go at this myself. I tried an alien grenade and an alien corpse. Both behaved the same way as the plasma weapons, since they're listed after the stun rod. Those listed before the stun rod worked fine. - [[User:NKF|NKF]] 21:42, 10 November 2007 (PST)
 +
 +
----
 +
 +
That's somewhat annoying - The stun rod is hardcoded as a melee weapon, so it's not like we can move it around the table to get around this. Note that with the exception of the flare, all human designs (including those based on alien tech) come before the rod, and all alien gear comes after (along with corpses and the undefined items).
 +
 +
On the other hand, maybe this can be circumvented by manually tweaking the UnitRef offsets I mentioned before? - [[User:Bomb Bloke|Bomb Bloke]] 22:47, 10 November 2007 (PST)
 +
 +
----
 +
 +
Well, I think that I have solved one mystery anyway. While the human weapons are listed in the order "pistol, rifle, heavy," plasma weapons are listed the other way around. This is consistent with the firing order for plasma weapons. - [[User:NinthRank|NinthRank]] 09:59, 11 November 2007 (PST)
 +
 +
== Possible method to create new melee stacking combinations?==
 +
 +
As I understand it, the problem is that only human items, all of which (except flares) are earlier than the Stun Rod in the item table(s), can be usefully combined with the Stun Rod to create new attacks etc. And also the unique melee properties of the Stun Rod are hard-coded to its usual item table offset.
 +
 +
So, if Bomb Bloke's editor can re-order these item files, wouldn't it be possible to create new combinations, using alien items, by swapping some of the alien item entries into the early part of the list (and moving the replaced human item to the back of the list)?
 +
 +
Of course this relies on there being no other hard coding (such as is known to exist for MedKits for example). It also relies on BB's editor making consistent changes to all affected files, to ensure integrity, otherwise weird bugs will occur. [[User:Spike|Spike]] 12:47, 17 November 2008 (CST)
 +
:Actually I think it would be even easier to just patch a bit: at 0x41D9F4, change 0x75 0x63 into 0x90 0x90 and you're in...[[User:Seb76|Seb76]] 14:07, 17 November 2008 (CST)
 +
 +
Yes that would be much easier. What does that patch do? [[User:Spike|Spike]] 16:07, 17 November 2008 (CST)
 +
:It simply bypasses the check for a stun rod and forces the stun command for all weapons [[User:Seb76|Seb76]] 17:27, 17 November 2008 (CST)
 +
 +
Cool! Could you add that patch as an (experimental) option to the next version of your loader? Please? :) [[User:Spike|Spike]] 12:28, 18 November 2008 (CST)
 +
:That would actually require something a bit more elaborate: in the current state, even grenades might have the stun command (I didn't check though). Also it would require some modding of the weapons' stats because the damage dealt in hand-to-hand may not have been set properly for all weapons (or not at all?). I don't want to provide modified DAT files because it may create conflicts between different mods. Maybe I can set a default damage based only on the soldier's strength? Apart from that, I see no problem having it added for the next version. [[User:Seb76|Seb76]] 12:54, 18 November 2008 (CST)
 +
 +
Agreed, you don't want to have to mess with DAT files. Reportedly the melee values of many non-melee objects are pretty random, crazy even. How about two different options:
 +
 +
# Experimental melee mode: no safeguards coded, objects pick up whatever crazy value is in the DAT file.
 +
# Safe melee mode: melee damage (except for Stun Rods) is coded according to a formula. Perhaps something like: Average of (Object Weight, Soldier Strength).
 +
:I updated my mod to enable the stun command for all shooting weapons. I only used the weapon class (pistol, rifle, etc.) to tweak the damage though. [[User:Seb76|Seb76]] 07:11, 23 November 2008 (CST)
 +
 +
It would great to be able to bludgeon a Sectoid into unconsciousness with an empty Heavy Cannon! [[User:Spike|Spike]] 14:27, 18 November 2008 (CST)

Latest revision as of 13:11, 23 November 2008

Effects of different items

I have not tested many combinations yet, but here are some initial observations:

1) Stacking two objects in one hand counts as one object for purposes of accuracy calculations. (Tested with Heavy Laser/Psi-Amp.)

2) To be able to use an item (Stun Rod, Psi-Amp) and a weapon, the weapon must be placed first.

3) If stacking two weapons, the one that will be used seems to be the first one in the item list. (I tried stacking a Pistol and a Heavy Laser in both possible orders; the pistol fired in both cases.)

4) If the total number of available actions exceeds five, then the game crashes. (I think that this is true, because a Laser Rifle/Psi-Amp crashes [Throw, Panic, MC, Snap, Auto, Aimed = 6], but Heavy Laser/Psi-Amp does not [Throw, Panic, MC, Snap, Aimed = 5]).

TODO: More testing. -- NinthRank 15:35, 6 November 2007 (PST)


I might just point out that my editer now lets you create an item table ordered however you wish, and also lets you stack as many items as you like. Along with a whole bunch of other item based edits.

Interesting point on the "must stack a weapon" first thing. That's probably got something to do with the UNITREF.DAT offsets 53 and 54 only handling one item each. - Bomb Bloke 16:45, 6 November 2007 (PST)


Thank you very much for that editor; it's a big help! I'm afraid that the stacking/firing order might be a little more complicated than I thought at first. I could not not activate the melee attacks for plasma weapons: if I placed the gun first, it would not shoot, and I got the regular stun attack. If I placed the Stun Rod first, the only option that I got was "Throw." If I placed two plasma weapons on top of each other, Plasma Rifles would get priority (they would fire) over Plasma Pistols, and Heavy Plasmas would get priority over both.

On a related note, a Laser Rifle in melee can usually kill a Floater (modified to 255 health) in one strike. Mutons, on the other hand, never seem to take melee damage. Perhaps this is a Collector's Edition bug? -- NinthRank 20:51, 10 November 2007 (PST)

The problem with plasma weapons not having melee might have something to do with their being listed after Stun Rods. I tested stacking a Stun Rod on an Electroflare (listed just after the Stun Rod in the Sell/Sack screen), and I got the same effect: stun, but not the physical-damage one. Stacking on a Psi-Amp (listed just before the Stun Rod) did activate the Psi-Amp's melee attack. -- NinthRank 21:02, 10 November 2007 (PST)


Had a go at this myself. I tried an alien grenade and an alien corpse. Both behaved the same way as the plasma weapons, since they're listed after the stun rod. Those listed before the stun rod worked fine. - NKF 21:42, 10 November 2007 (PST)


That's somewhat annoying - The stun rod is hardcoded as a melee weapon, so it's not like we can move it around the table to get around this. Note that with the exception of the flare, all human designs (including those based on alien tech) come before the rod, and all alien gear comes after (along with corpses and the undefined items).

On the other hand, maybe this can be circumvented by manually tweaking the UnitRef offsets I mentioned before? - Bomb Bloke 22:47, 10 November 2007 (PST)


Well, I think that I have solved one mystery anyway. While the human weapons are listed in the order "pistol, rifle, heavy," plasma weapons are listed the other way around. This is consistent with the firing order for plasma weapons. - NinthRank 09:59, 11 November 2007 (PST)

Possible method to create new melee stacking combinations?

As I understand it, the problem is that only human items, all of which (except flares) are earlier than the Stun Rod in the item table(s), can be usefully combined with the Stun Rod to create new attacks etc. And also the unique melee properties of the Stun Rod are hard-coded to its usual item table offset.

So, if Bomb Bloke's editor can re-order these item files, wouldn't it be possible to create new combinations, using alien items, by swapping some of the alien item entries into the early part of the list (and moving the replaced human item to the back of the list)?

Of course this relies on there being no other hard coding (such as is known to exist for MedKits for example). It also relies on BB's editor making consistent changes to all affected files, to ensure integrity, otherwise weird bugs will occur. Spike 12:47, 17 November 2008 (CST)

Actually I think it would be even easier to just patch a bit: at 0x41D9F4, change 0x75 0x63 into 0x90 0x90 and you're in...Seb76 14:07, 17 November 2008 (CST)

Yes that would be much easier. What does that patch do? Spike 16:07, 17 November 2008 (CST)

It simply bypasses the check for a stun rod and forces the stun command for all weapons Seb76 17:27, 17 November 2008 (CST)

Cool! Could you add that patch as an (experimental) option to the next version of your loader? Please? :) Spike 12:28, 18 November 2008 (CST)

That would actually require something a bit more elaborate: in the current state, even grenades might have the stun command (I didn't check though). Also it would require some modding of the weapons' stats because the damage dealt in hand-to-hand may not have been set properly for all weapons (or not at all?). I don't want to provide modified DAT files because it may create conflicts between different mods. Maybe I can set a default damage based only on the soldier's strength? Apart from that, I see no problem having it added for the next version. Seb76 12:54, 18 November 2008 (CST)

Agreed, you don't want to have to mess with DAT files. Reportedly the melee values of many non-melee objects are pretty random, crazy even. How about two different options:

  1. Experimental melee mode: no safeguards coded, objects pick up whatever crazy value is in the DAT file.
  2. Safe melee mode: melee damage (except for Stun Rods) is coded according to a formula. Perhaps something like: Average of (Object Weight, Soldier Strength).
I updated my mod to enable the stun command for all shooting weapons. I only used the weapon class (pistol, rifle, etc.) to tweak the damage though. Seb76 07:11, 23 November 2008 (CST)

It would great to be able to bludgeon a Sectoid into unconsciousness with an empty Heavy Cannon! Spike 14:27, 18 November 2008 (CST)