Author Topic: Funny quirk; 0 hitpoint turrets don't fire  (Read 1723 times)

0 Members and 1 Guest are viewing this topic.

Offline T-Man

  • 210
  • I came... I saw... I had a cuppa!
Funny quirk; 0 hitpoint turrets don't fire
While working on a ship with un-targetable turrets (a version of BPs Custos-X for AI use, to be exact) I appear to have found a quirk that isn't mentioned in the wiki; it seems if you give a turret 0 hitpoints in it's table entry (thus making it invulnerable, ala fighterbays, which I wanted to negate the need for guardian SEXPs every time the ship is used) it wont fire any guns connected to it (I assume because it sees the subsystem as destroyed). It seems to be what's causing the non-firing; I checked by restoring hitpoints without making any other change and the turrets started firing again. Was this intentional?

Has anyone else ever tried 0-hitpoint turrets? If so, do you know of any workarounds for getting the gun's working? I could give the turrets ludicrous hitpoints of course, but I was wondering if there's alternative like a flag I've missed?

Cheers
Also goes by 'Murasaki-Tatsu' outside of Hard-Light

UEF fanboy. Rabid Imagination.

 

Offline Kobrar44

  • On Suspended Sentence
  • 29
  • Let me tilerape it for you!
    • Steam
Re: Funny quirk; 0 hitpoint turrets don't fire
Like invincible armor in armor.tbl?
Oh guys, use that [ url ][ img ][ /img ][ /url ] :/

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Funny quirk; 0 hitpoint turrets don't fire
Hmmm, there actually isn't any subsystem flag that grants outright immunity to damage. Should be easy to add one though.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Funny quirk; 0 hitpoint turrets don't fire
Subsystem armor is probably the way to do this.

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Funny quirk; 0 hitpoint turrets don't fire
That's the way to do this at the moment, yes. But I can see a dedicated subsys flag to be of use (this whole "make invulnerable by setting to 0 hitpoints" thing is too far into the realm of undocumented behaviour for my tastes)
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline T-Man

  • 210
  • I came... I saw... I had a cuppa!
Re: Funny quirk; 0 hitpoint turrets don't fire
Aye, cheers to Kobrar and Batt I had forgotten subsystem armour was possible, and from what I remember of the Armour table it should be relatively easy to implement (add a new armour class, set all the multiplication values to 0, add subsystem armour in ship entry). I shall give that a go. :) And Thanks for the implementation offer E; such a flag may be of use in other ways so may be worth doing.

Cheers people.

OT: ha funny random thought... if a damage entry for an armour had a negative multiplication for damage (so made it a negative number)... would it repair damage? :lol:
Also goes by 'Murasaki-Tatsu' outside of Hard-Light

UEF fanboy. Rabid Imagination.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Funny quirk; 0 hitpoint turrets don't fire
I don't recall off the top of my head whether shockwaves damage subsystems, but you should be sure that your subsystem armor includes shockwave and debris as damage types.

 

Offline T-Man

  • 210
  • I came... I saw... I had a cuppa!
Re: Funny quirk; 0 hitpoint turrets don't fire
Ah, cheers for the info; that's probably why they stopped working at one point in a test (I had basic-guardianed the ship and was throwing dual Sledgehammers at it).

Am I right assuming adding "Debris" to my list will handle Debris damage? (I can't seem to find any information on what damage types are accepted; I found the shockwave ones in BP's tbm though).
Also goes by 'Murasaki-Tatsu' outside of Hard-Light

UEF fanboy. Rabid Imagination.

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: Funny quirk; 0 hitpoint turrets don't fire
I don't recall off the top of my head whether shockwaves damage subsystems, but you should be sure that your subsystem armor includes shockwave and debris as damage types.
For larger ships, they always do, and for smaller ones, it's an option in the AI Profiles. IIRC, it was implemented for FSPort, since in FS1, shockwaves always damaged subsystems.

  

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Funny quirk; 0 hitpoint turrets don't fire
For what it's worth, the bug is easy to fix. There's two checks for if (ss->current_hits <= 0.0f) in aiturret.cpp, and changing those to if (ss->current_hits <= 0.0f && ss->max_hits > 0.0f) instead would very likely do the trick.

EDIT: I believe no subsystem without hitpoints can currently "do" anything, such as rotate, and this would fix that as well.