Author Topic: [OLD] Old OXCE discussion thread  (Read 663250 times)

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3194
    • View Profile
Re: [OXCE] OpenXcom Extended
« Reply #1380 on: August 16, 2017, 09:13:08 pm »
Fix for a very old merge issue: https://github.com/MeridianOXC/OpenXcom/commit/938c1e772eff2d35fe51da2881438ab79420566b
Thax, I will pull this.

I noticed a curious thing (intended? bug?): the
Code: [Select]
isExplodingInHands: flag is not working for BT: 5 items (proxies). Can this function be added (with explosion delay = 0 if no timer set)?
I do not look to code but I suspect that proxies do not explode until someone step on them.

Found a segfault that I think was introduced with this commit.  When an alien that has previously panicked and dropped their weapon attempts at psi attack, _attackAction->weapon->getAmmoForAction(action) on line 2036 is sometimes called with an incomplete type, leading to a crash.  I'm attaching a save and a zip file containing the mods and options.cfg used in that save; after pressing end turn, when the sectoid leader moves into sight of one of the xcom units, the game will often crash.
Know bug, I will release fix for it soon (today or tomorrow).

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8597
    • View Profile
Re: [OXCE] OpenXcom Extended
« Reply #1381 on: August 20, 2017, 12:18:51 pm »
An issue reported from XComFiles... I would describe more, but I'm not sure which part of this is wrong.

Basically load the attached save, and try to open inventory of the soldier "Rosie Pagram" => crash.

Crash is caused by an item in the inventory having inventorySlot == null.
In the save, the slot is not null (it is STR_QD_SLOT), and it gets loaded as such at first but then it gets overwritten to null in your new multi-ammo code, somewhere after this line: https://github.com/MeridianOXC/OpenXcom/blob/oxce3.5-plus-proto/src/Savegame/SavedBattleGame.cpp#L315

Can you please have a look? I don't understand what's going on exactly there...

Issue is with item #29 (and also with item #15)

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3194
    • View Profile
Re: [OXCE] OpenXcom Extended
« Reply #1382 on: August 20, 2017, 05:57:31 pm »
An issue reported from XComFiles... I would describe more, but I'm not sure which part of this is wrong.

Basically load the attached save, and try to open inventory of the soldier "Rosie Pagram" => crash.

Crash is caused by an item in the inventory having inventorySlot == null.
In the save, the slot is not null (it is STR_QD_SLOT), and it gets loaded as such at first but then it gets overwritten to null in your new multi-ammo code, somewhere after this line: https://github.com/MeridianOXC/OpenXcom/blob/oxce3.5-plus-proto/src/Savegame/SavedBattleGame.cpp#L315

Can you please have a look? I don't understand what's going on exactly there...

Issue is with item #29 (and also with item #15)
Ok I will look on this, if I manage to fix it I will release it with other bug fix today.

I would like to use the race dependent custom deployment for ufos (meaning I want to give each race their own equipment in their UFOs):

Code: [Select]
ufos:
  - type: STR_UFO_TYPE #default config ...
    raceBonus: #bonus stats per race.
      STR_SECTOID: #name of race that bonus apply.
        craftCustomDeploy: STR_BATTLESHIP_3 #override craft default weapon deploy.


so I tried the following code
Code: [Select]
  - type: STR_LARGE_LIGHTER
    raceBonus:
      STR_GESSERIT:
        craftCustomDeploy: STR_LARGE_LIGHTER_GESSERIT

I defined my custom deployment in the alienDeployment section.

For testing, I tried the new battle option and the custom deployment is used as intended.
However, there is no UFO spawned and the mission became a terror mission which needs custom briefing (see screenshot).

I only wanted to change the equipment for the specific race in a specific UFO and not change the mission type. Is this possible with "craftCustomDeploy"?

EDIT: I did the mission during regular play (shooting down the UFO) and the deployment works fine. However, the mission played with the "new battle" from the main menu is messed up.


I could say that this is not bug, you are using custom deploy directly in new battle game not as part of ufo deploy.
Right now new battle do not use in any way overwriting of deploy that is used in normal game.
I will think for some solution for in in 4.0 version (this mean not bug fix version that I plan release today).

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3194
    • View Profile
Re: [OXCE] OpenXcom Extended
« Reply #1383 on: August 20, 2017, 06:49:48 pm »
@Meridian
loading code look fine, problem is with that this item is loaded in weapon (id 11 or 27) and in unit inventory, I will probably need more info how this clip end up in inventory.
Probably bug is in code that auto fill inventory that use same clip for two different purposes. I will try hunt this but its possible that I will not find cause without some hits to narrow places to search.

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8597
    • View Profile
Re: [OXCE] OpenXcom Extended
« Reply #1384 on: August 20, 2017, 07:32:06 pm »
Well, the special thing about this situation is that it was a 2-stage mission.... maybe something special is done between stage 1 and stage 2?

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3194
    • View Profile
Re: [OXCE] OpenXcom Extended
« Reply #1385 on: August 21, 2017, 03:23:16 am »
New bug fix version is ready.

Well, the special thing about this situation is that it was a 2-stage mission.... maybe something special is done between stage 1 and stage 2?
I probably find cause of this bug, on transition to second stage it grab all items on ground and move it to new start, problems was that loaded ammo was placed on ground too.

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8597
    • View Profile
Re: [OXCE] OpenXcom Extended
« Reply #1386 on: August 22, 2017, 04:29:36 pm »
I probably find cause of this bug, on transition to second stage it grab all items on ground and move it to new start, problems was that loaded ammo was placed on ground too.

Yeah, there is definitely something fishy there.
I tried it in vanilla (Cydonia mission), where all aliens had just 1 clip (in the gun)... but after killing them all, in the second stage I was given 2x more clips than guns.
I'll report to Warboy...

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3194
    • View Profile
Re: [OXCE] OpenXcom Extended
« Reply #1387 on: August 22, 2017, 07:42:38 pm »
Yeah, there is definitely something fishy there.
I tried it in vanilla (Cydonia mission), where all aliens had just 1 clip (in the gun)... but after killing them all, in the second stage I was given 2x more clips than guns.
I'll report to Warboy...
as reference you could use my commit: https://github.com/Yankes/OpenXcom/commit/5e97b199367cedd063f2bef1f7c2010df6c8478f
Probably this is one place where this could go wrong.

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8597
    • View Profile
Re: [OXCE] OpenXcom Extended
« Reply #1388 on: August 22, 2017, 08:36:21 pm »
as reference you could use my commit: https://github.com/Yankes/OpenXcom/commit/5e97b199367cedd063f2bef1f7c2010df6c8478f
Probably this is one place where this could go wrong.

Thanks.
Here's Warboy's variation... most probably equivalent.


But I have one more report for you (I feel really bad mostly bringing bad news here):
https://openxcom.org/forum/index.php/topic,4058.msg87079.html#msg87079

We'll need your help here... might be a code error, might also be a map error.
« Last Edit: August 22, 2017, 10:49:59 pm by Meridian »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [OXCE] OpenXcom Extended
« Reply #1389 on: August 31, 2017, 12:23:15 am »
Hi Yankes, just found a bug with recovering ammo from a fixedWeapon when the weapon is defined on an armor (not unit) by builtInWeapons - any ammunition loaded into such a weapon when the battlescape ends will not be recovered, even if the weapon is never fired.  To reproduce, use my mod and the saves attached to this post, specifically the battlescape save, and just lift off.  The debriefing will give the message for missing HWP Cannon Shells, even though none were fired.  I've written a fix for it - see this commit.

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3194
    • View Profile
Re: [OXCE] OpenXcom Extended
« Reply #1390 on: September 01, 2017, 02:03:18 am »
One question who create this ammo?
https://github.com/ohartenstein23/OpenXcom/blob/oxce3.5-plus-proto/src/Savegame/SavedBattleGame.cpp#L1298
As we can see with your fix you can crate new ammo if it was from fixed too.

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8597
    • View Profile
Re: [OXCE] OpenXcom Extended
« Reply #1391 on: September 01, 2017, 12:06:18 pm »
Hi Yankes, just found a bug with recovering ammo from a fixedWeapon when the weapon is defined on an armor (not unit) by builtInWeapons - any ammunition loaded into such a weapon when the battlescape ends will not be recovered, even if the weapon is never fired.  To reproduce, use my mod and the saves attached to this post, specifically the battlescape save, and just lift off.  The debriefing will give the message for missing HWP Cannon Shells, even though none were fired.  I've written a fix for it - see this commit.

One question who create this ammo?
https://github.com/ohartenstein23/OpenXcom/blob/oxce3.5-plus-proto/src/Savegame/SavedBattleGame.cpp#L1298
As we can see with your fix you can crate new ammo if it was from fixed too.

On top of that, I tried to cherry-pick and test the code, but it always crashes on NPE (with both oharty's saves).
See attached.
« Last Edit: September 01, 2017, 12:08:58 pm by Meridian »

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 8597
    • View Profile
Re: [OXCE] OpenXcom Extended
« Reply #1392 on: September 01, 2017, 12:09:58 pm »
@Yankes:
BA_USE on BT_PSIAMP doesn't work since the last refactoring (sectoid on stairs bug).
Attack always misses (resp. there is no victim).
Test save attached.

Tested with:

Code: [Select]
items:
  - type: STR_PSI_AMP
    accuracyMultiplier:
      flatHundred: 2
    flatRate: true
    psiAttackName: CUSTOM_PSI
    damageType: 1
    damageBonus:
      flatHundred: 1

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [OXCE] OpenXcom Extended
« Reply #1393 on: September 01, 2017, 06:56:30 pm »
One question who create this ammo?
https://github.com/ohartenstein23/OpenXcom/blob/oxce3.5-plus-proto/src/Savegame/SavedBattleGame.cpp#L1298
As we can see with your fix you can crate new ammo if it was from fixed too.

On top of that, I tried to cherry-pick and test the code, but it always crashes on NPE (with both oharty's saves).
See attached.

Need to test more before I propose a fix then, sorry.  I'll rewrite after vacation with a check on whether the ammo is fixed/built-in/recoverable, and take a closer look at why I threw a null pointer for trying to get the unit of the fixed weapon.

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3194
    • View Profile
Re: [OXCE] OpenXcom Extended
« Reply #1394 on: September 02, 2017, 12:22:59 am »
@Yankes:
BA_USE on BT_PSIAMP doesn't work since the last refactoring (sectoid on stairs bug).
Attack always misses (resp. there is no victim).
Test save attached.

Tested with:

Code: [Select]
items:
  - type: STR_PSI_AMP
    accuracyMultiplier:
      flatHundred: 2
    flatRate: true
    psiAttackName: CUSTOM_PSI
    damageType: 1
    damageBonus:
      flatHundred: 1
My bad, I mess one condition here is bug fix commit:
https://github.com/Yankes/OpenXcom/commit/2d6906a8659e23d3353ae796b754df099c1259c5