aliens

Author Topic: floorSprite for items that have a negative weight are not drawn.. (OXC and OXCE)  (Read 774 times)

Offline CrazedHarpooner

  • Captain
  • ***
  • Posts: 90
    • View Profile
I've stumbled upon this bug. Items that have a negative weight and are dropped on the ground during the battlescape are not drawn on the floor.

I started to notice this while testing TWoTS's Bubble item that has -20 weight so the unit can carry more items in exchange of stamina loss. Since some of the units were losing stamina pretty fast I opted to give them a breather by dropping the Bubble and that's when I noticed it was not showing on the floor. Nothing else was dropped on the same tile. They still appeared in the map view as your typical 'item' indicator and in the inventory screen with the corresponding bigSprite.

After checking that changing the weight to 0 or any positive number would make them show up on the floor in OXCE I decided to try OXC with only a custom mod where I tested changing the weight of the starting Pistol and its ammo in New Battle. The same issue appeared and the following results were observed:
- The combined weight of a weapon and its ammo is irrelevant
- Only the defined weight of the actual item being dropped matters
- Negative weights will cause the floorSprite not to be drawn
- Positive or Zero weight items will be drawn without issues.

Offline Yankes

  • Commander
  • *****
  • Posts: 3293
    • View Profile
I do not think that negative numbers should be supported, lot of logic assume positive values, fact that drawing ignore
this items is one example of this where engine logic break down.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11672
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
There is also an item in Piratez which has a negative weight: https://xpedia.netlify.app/##STR_LEVITATOR
So I guess it's a needed feature.

Offline CrazedHarpooner

  • Captain
  • ***
  • Posts: 90
    • View Profile
I do not think that negative numbers should be supported, lot of logic assume positive values, fact that drawing ignore
this items is one example of this where engine logic break down.
I do agree with you, but still felt the need to report it so it is at least known what consequences are when using negative values where they aren't expected.

There is also an item in Piratez which has a negative weight: https://xpedia.netlify.app/##STR_LEVITATOR
So I guess it's a needed feature.
Yeah, perhaps a request for a property that allows to increase the weight capacity of a unit without having to increase their strength is in order. This way, items like these could be defined as weight: 0 and 'extraCarry: 20' for example.