Hard Light Productions Forums
Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: T-Man on March 05, 2014, 09:26:42 am
-
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
-
Like invincible armor in armor.tbl?
-
Hmmm, there actually isn't any subsystem flag that grants outright immunity to damage. Should be easy to add one though.
-
Subsystem armor is probably the way to do this.
-
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)
-
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:
-
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.
-
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).
-
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.
-
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.