OpenXcom Forum

OpenXcom => Troubleshooting => Topic started by: pkrcel on September 29, 2014, 12:58:38 am

Title: Bugs in Custom HWP
Post by: pkrcel 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?

Title: Re: Crash at end of UFO Recovery
Post by: Yankes on September 29, 2014, 01:03:09 am
update basic ruleset. You probably have old one that dont have all data from new one.
Title: Re: Crash at end of UFO Recovery
Post by: Warboy1982 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.
Title: Re: Crash at end of UFO Recovery
Post by: pkrcel 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.
Title: Re: Crash at end of UFO Recovery
Post by: pkrcel 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...




 
Title: Re: Crash at end of UFO Recovery
Post by: Warboy1982 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
Title: Re: Crash at end of UFO Recovery
Post by: pkrcel 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.





Title: Re: Crash at end of UFO Recovery
Post by: Falko on September 29, 2014, 11:46:01 pm
thats the downside of using nightlies sometimes things break
Title: Re: Crash at end of UFO Recovery
Post by: redv 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
Title: Re: Crash at end of UFO Recovery
Post by: pkrcel 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.

Title: Re: Crash at end of UFO Recovery
Post by: Yankes 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.
Title: Re: Bugs in Custom HWP
Post by: pkrcel 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?


Title: Re: Bugs in Custom HWP
Post by: redv on October 01, 2014, 12:45:49 pm
Your ruleset is ok. All works well.
Title: Re: Bugs in Custom HWP
Post by: pkrcel on October 01, 2014, 02:12:58 pm
So I should blame the code for the Tank not firing Auto shots?

Title: Re: Bugs in Custom HWP
Post by: redv on October 01, 2014, 02:43:08 pm
I don't know. Latest nightie works well.
Title: Re: Bugs in Custom HWP
Post by: HelmetHair on October 01, 2014, 05:40:55 pm
Gents,

What about the Chryssalid bug in one square tanks? anyone found a solution so my scout drone doesn't suddenly turn into a zombie after a bug hug?
I've seen this problem pop up randomly on the forum and heard whispers of a solution...Is there one?

thanks!

-HH
Title: Re: Bugs in Custom HWP
Post by: redv on October 01, 2014, 07:19:26 pm
It's not a bug it's by design:)

Solution:
You can use OpenXcom Extended: https://www.openxcom.com/mod/openxcom-extended
Need to add strings for armor of your one square tank:
Code: [Select]
armors:
  -type: STR_YOUR_ONE_SQUARE_TANK_ARMOR
    zombiImmune: true
Title: Re: Bugs in Custom HWP
Post by: pkrcel on October 01, 2014, 07:29:53 pm
I don't know. Latest nightie works well.
I compile it myself....I'll try to pull the code as of today and see if it works.

BTW you mean my ruleset works as intended on your OXC?
Title: Re: Bugs in Custom HWP
Post by: redv on October 01, 2014, 07:34:57 pm
BTW you mean my ruleset works as intended on your OXC?

Yes
Title: Re: Bugs in Custom HWP
Post by: HelmetHair on October 01, 2014, 08:01:13 pm
Sweet. I'll point this to KingMob4313 for equalterms x.x for the one square HWPs he wants to implement.

thanks redv


-HH
Title: Re: Bugs in Custom HWP
Post by: pkrcel on October 01, 2014, 10:47:55 pm
I compile it myself....I'll try to pull the code as of today and see if it works.


Well, done that and it works now....strange, the only commit I see from (my) last build do not involve explosions or autoshot...at a first glance.

Well, that's okay...thanks rev for having tried the simple ruleset and general help.