Author Topic: Bugs in Custom HWP  (Read 11390 times)

Offline pkrcel

  • Colonel
  • ****
  • Posts: 192
    • View Profile
Bugs in Custom HWP
« on: September 29, 2014, 12:58:38 am »
Yo openxcom'ers.

As the thread title says, I get a crash at the end of UFO recovery.

I just upgraded to the latest git (or at least I am on commit e81af6f66a52b3c7c7bf859a19d0f13d8d910302).

I already had several mission went okay, this was a terror ship which I barely managed to not get FUBAR.

Debugging the application, I find out that the program blurts out at line 913 of Debriefingstate.cpp , during Preparedebriefing() method.

Code: [Select]
https:// alien alloys recovery values are divided by 10 or divided by 150 in case of an alien base
if ((*i)->item == _recoveryStats[ALIEN_ALLOYS]->name)
{
(*i)->qty = (*i)->qty / aadivider;
(*i)->score = (*i)->score / aadivider;
}

actually, the _recoveryStats[ALIEN_ALLOYS] map member seems not to be there, since the operator== gets an unvalid RHS reference.

This is quite strange, since I already have a ton of Alloys and the mods (Equal Terms Beta and Terrain Pack from Hobbes) have not been upraded and always worked fine.

What I should check for being wrong?

« Last Edit: September 30, 2014, 11:02:32 pm by pkrcel »

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Crash at end of UFO Recovery
« Reply #1 on: September 29, 2014, 01:03:09 am »
update basic ruleset. You probably have old one that dont have all data from new one.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Crash at end of UFO Recovery
« Reply #2 on: September 29, 2014, 02:48:38 am »
i'm inclined to agree with yankes on this one, sounds like you have an outdated ruleset. make sure you extract the data folder from the nightly builds to wherever your data is stored.

Offline pkrcel

  • Colonel
  • ****
  • Posts: 192
    • View Profile
Re: Crash at end of UFO Recovery
« Reply #3 on: September 29, 2014, 07:15:48 am »
Yep, I figured out already looking at a diff. Redeploying the data folder (due to mods I have a couple different ones...) fixed the issue.


Thanks for the prompt answers.

Offline pkrcel

  • Colonel
  • ****
  • Posts: 192
    • View Profile
Re: Crash at end of UFO Recovery
« Reply #4 on: September 29, 2014, 11:04:37 pm »
Dang, I can't be arsed to finish one mission w/o problems it seems.

I am now in an Muton UFO recovery mission.

If I fire an HE bullet with my enhanced tank the explosion causes a game crash.

I inspected the code and it's line 1170 of Map.cpp, the tmpsurface returned by _res->getsurfacesets("X1.PCK")->getFrame() is NULL, but I can't tell why....the PCK is there and seems uncorrupted.

Yesterday after the previous "fix" I was able to fire rockets no prob.

I will try a "fresh" install mods included...

EDIT: a clean install does not solve the problem.... :-[

EDIT2: seems it has to do with my modified HWP Cannon Shells which I made HE....firing from another HE weapon such as the rocket launcher does not crash the game.

I'm clueless on how to deug the thing....besides, this has always word fine until recently since I have upgraded fetch & merging the latest git...




 
« Last Edit: September 29, 2014, 11:35:16 pm by pkrcel »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Crash at end of UFO Recovery
« Reply #5 on: September 29, 2014, 11:36:04 pm »
you'll need to modify the tank's rocket launcher ammo to have hitAnimation:0 like in the main ruleset

Offline pkrcel

  • Colonel
  • ****
  • Posts: 192
    • View Profile
Re: Crash at end of UFO Recovery
« Reply #6 on: September 29, 2014, 11:43:33 pm »
Is this something introduced later than commit 3505774... ?

Because I've always been able to use the tank with no problems until the recent pull.

EDIT: nevermind....got it.






Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Crash at end of UFO Recovery
« Reply #7 on: September 29, 2014, 11:46:01 pm »
thats the downside of using nightlies sometimes things break

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: Crash at end of UFO Recovery
« Reply #8 on: September 30, 2014, 12:00:04 am »
If your tank has two weapons;
If left-hand weapon has limited ammunition;
then you always will get crash after mission because of this issue: https://github.com/SupSuper/OpenXcom/pull/956
« Last Edit: September 30, 2014, 12:02:02 am by redv »

Offline pkrcel

  • Colonel
  • ****
  • Posts: 192
    • View Profile
Re: Crash at end of UFO Recovery
« Reply #9 on: September 30, 2014, 07:26:15 am »
thats the downside of using nightlies sometimes things break
Actually I'm compiling Openxcom myself, but oftentimes I'm unable to correlate the commits to the new behaviour

By the way my tank simply fired HE rounds instead of AP, explosions where making the game crash instantaneously....I should have opened a new *proper* topic.


Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Crash at end of UFO Recovery
« Reply #10 on: September 30, 2014, 08:07:50 pm »
This working as "intended", HE damage can now have different graphic, if you leave invalid value (its use same value like single target effect) you crash game.

Offline pkrcel

  • Colonel
  • ****
  • Posts: 192
    • View Profile
Re: Bugs in Custom HWP
« Reply #11 on: September 30, 2014, 11:14:57 pm »
Well damn, I changed the Topic tile to update for my NEW problem.  ;D

Okay I've set the animation as Warboy said....explosions are now fine and do not crash but....

my custom Tank basically was an "Autocannon Tank", with sats similar to such Weapon:

Code: [Select]
items:
  - type: STR_TANK_CANNON
    size: 6
    costBuy: 420000
    costSell: 340000
    transferTime: 96
    weight: 1
    bigSprite: 43
    floorSprite: 0
    handSprite: 0
    bulletSprite: 4
    fireSound: 12
    compatibleAmmo:
      - STR_HWP_CANNON_SHELLS
    accuracyAuto: 45
    accuracySnap: 60
    accuracyAimed: 90
    tuAuto: 40
    tuSnap: 33
    tuAimed: 80
    autoShots: 3
    battleType: 1
    fixedWeapon: true
    invWidth: 2
    invHeight: 3
    turretType: 0
  - type: STR_HWP_CANNON_SHELLS
    size: 0.1
    costBuy: 200
    costSell: 100
    transferTime: 48
    weight: 1
    bigSprite: -1
    floorSprite: 12
    hitSound: 13
    hitAnimation: 0
    power: 44
    damageType: 3 # HE - was AP(1)
    clipSize: 20 # was 30
    battleType: 2
    invWidth: 2
    invHeight: 1

A crappy weapon but useful for demolitions (and unusable in base defense, for instance), since I am using (Awesome) Equal Terms mod which does not sport the Autocannon :P

Well, before update it fired 3 shots as requested....now even spending the auto TUs it only fire one shell  :o

Is there anything in the ruleset I'd have to change or...is this code?



Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: Bugs in Custom HWP
« Reply #12 on: October 01, 2014, 12:45:49 pm »
Your ruleset is ok. All works well.

Offline pkrcel

  • Colonel
  • ****
  • Posts: 192
    • View Profile
Re: Bugs in Custom HWP
« Reply #13 on: October 01, 2014, 02:12:58 pm »
So I should blame the code for the Tank not firing Auto shots?


Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: Bugs in Custom HWP
« Reply #14 on: October 01, 2014, 02:43:08 pm »
I don't know. Latest nightie works well.