Hard Light Productions Forums
Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: 0rph3u5 on September 21, 2010, 01:09:07 pm
-
I'm using the following modular table to edit the turret-arament of our beloved NTF Iceni:
tlg-shp.tbm -------------------------------
$Name: NTF Iceni
+nocreate
$Subsystem: turret01a,0.833,1.0
$Default PBanks: ( "Terran Turret" "Terran Turret" )
$Subsystem: turret02,0.833,1.0
$Default PBanks: ( "TerSlash" )
$Subsystem: turret03,0.833,1.0
$Default pBanks: ( "AAAf" )
$Subsystem: turret04,0.833,1.0
$Default PBanks: ( "AAAf" )
$Subsystem: turret05,0.833,1.0
$Default pBanks: ( )
$Default sBanks: ( "Piranha" )
$Subsystem: turret06,0.833,1.0
$Default PBanks: ( "Standard Flak" )
$Subsystem: turret07,0.833,1.0
$Default PBanks: ( "BGreen" )
$Subsystem: turret08,0.833,1.0
$Default PBanks: ( "TerSlash" )
$Subsystem: turret09,0.833,1.0
$Default PBanks: ( "BGreen" )
$Subsystem: turret10,0.833,1.0
$Default PBanks: ( "Standard Flak" )
$Subsystem: turret11a,0.833,1.0
$Default PBanks: ( "Terran Turret" "Terran Turret" )
$Subsystem: turret12,0.833,1.0
$Default PBanks: ( "TerSlash" )
$Subsystem: turret13,0.833,1.0
$Default PBanks: ( "AAAf" )
$Subsystem: turret14,0.833,1.0
$Default PBanks: ( "Standard Flak" )
$Subsystem: turret15,0.833,1.0
$Default PBanks: ( "AAAf" )
$Subsystem: turret16,0.833,1.0
$Default pBanks: ( "TerSlash" )
$Default SBanks: ( )
$Subsystem: turret17,0.833,1.0
$Default PBanks: ( "AAAf" )
$Subsystem: turret18,0.833,1.0
$Default sBanks: ( "Piranha" )
$Subsystem: turret19,0.833,1.0
$Default PBanks: ( "Terran Turret" "Terran Turret" )
$Subsystem: turret20,0.833,1.0
$Default PBanks: ( "Standard Flak" )
$Default SBanks: ( )
$Subsystem: turret21a,0.833,1.0
$Default PBanks: ( "Terran Huge Turret" "Terran Huge Turret" "Terran Huge Turret" )
$Subsystem: turret22a,0.833,1.0
$Default PBanks: ( "Terran Huge Turret" "Terran Huge Turret" "Terran Huge Turret" )
$Subsystem: turret23a,0.833,1.0
$Default PBanks: ( "Terran Turret" "Terran Turret" )
$Subsystem: turret24a,0.833,1.0
$Default PBanks: ( "Terran Turret" "Terran Turret" )
$Subsystem: turret25a,0.833,1.0
$Default PBanks: ( "Terran Turret" "Terran Turret" )
$Default SBanks: ( )
...but for the turrets 5, 16, 20 and 25a I'm getting a mixed arament between retail table and tbm (like in the following picture) instead of a replacement of the retail setup...
(http://i1020.photobucket.com/albums/af321/0rph3u5/FS%20Open/turret-problem.jpg)
WTF am I missing here?
FRED build in use is 3.6.12 INF (release)...
-
I think I can see what's going on here, and it looks like an error or oversight in the way tbms like that are parsed. Basically, since this is a "+nocreate" entry, old data is only overwritten, not recreated from scratch. In this case, the previous SBanks entry was not discarded when your altered weapons layout was read in. Gonna have to bump this over to the SCP.
In the meantime, the only workaround would be to copy the entire Iceni entry and not using +nocreate, so that your new entry replaces the old one completely.
-
Try adding an empty Default SBanks to 25a?
-
Doesn't matter whether he uses +nocreate or not, the end result is same. And it's not a bug, but feature.
To "fix" it, you need to set it as follows:
$Subsystem: turret25a,0.833,1.0
$Default PBanks: ( "Terran Turret" "Terran Turret" )
$Default SBanks: ( "" )
Pardon me for any errors, I did not debug it.
-
Don't use ( "" ), because it would crash the game, use ( ) instead.
-
Neither one of the solutions works ... I still have hybrid turrets...
(updated tbm in first post)
-
Then just get rid of the missiles in FRED, there can't be that many of them.
-
Neither one of the solutions works ... I still have hybrid turrets...
(updated tbm in first post)
Have you tried replacing the entire Iceni entry?
-
Yeah that's what I thought was meant by not using +nocreate, I don't know how that wouldn't work.
-
tlg-shp.tbm -------------------------------
$Name: NTF Iceni
$Short name: RCorvette
$Species: Terran
$POF file: corvette2r-01.pof
$Detail distance: (0, 2000, 8000, 20000)
$ND: 251 248 167
$ND: 255 253 196
$ND: 239 234 134
$ND: 216 212 122
$Show damage: YES
$Density: 1
$Damp: 0.2
$Rotdamp: 2.0
$Max Velocity: 0.0, 0.0, 35.0
$Rotation time: 100.0, 100.0, 80.0
$Rear Velocity: 0.0
$Forward accel: 8.0
$Forward decel: 4.0
$Slide accel: 0.0
$Slide decel: 0.0
$Expl inner rad: 150.0
$Expl outer rad: 750.0
$Expl damage: 200.0
$Expl blast: 12500.0
$Expl Propagates: YES ;; If set to Yes, then when the ship dies, the explosion propagates through it.
$Shockwave Speed: 400.0 ;; speed shockwave expands at, 0 means no shockwave
$Shockwave Count: 3
$Default PBanks: ()
$Default SBanks: ()
$SBank Capacity: ()
$Shields: 0
$Power Output: 100.0
$Max Oclk Speed: 60.0
$Max Weapon Eng: 100.0
$Hitpoints: 90000
$Flags: ( "corvette" "big damage" )
$AI Class: Captain
$Afterburner: NO
$Countermeasures: 0
$Scan time: 2000
$EngineSnd: 128 ;; Engine sound of ship
$Closeup_pos: 0.0, 0.0, -1300
$Closeup_zoom: 0.5
$Score: 300
$Subsystem: turret01a,0.833,1.0
$Default PBanks: ( "Terran Turret" "Terran Turret" )
$Subsystem: turret02,0.833,1.0
$Default PBanks: ( "TerSlash" )
$Subsystem: turret03,0.833,1.0
$Default pBanks: ( "AAAf" )
$Subsystem: turret04,0.833,1.0
$Default PBanks: ( "AAAf" )
$Subsystem: turret05,0.833,1.0
$Default pBanks: ( )
$Default sBanks: ( "Piranha" )
$Subsystem: turret06,0.833,1.0
$Default PBanks: ( "Standard Flak" )
$Subsystem: turret07,0.833,1.0
$Default PBanks: ( "BGreen" )
$Subsystem: turret08,0.833,1.0
$Default PBanks: ( "TerSlash" )
$Subsystem: turret09,0.833,1.0
$Default PBanks: ( "BGreen" )
$Subsystem: turret10,0.833,1.0
$Default PBanks: ( "Standard Flak" )
$Subsystem: turret11a,0.833,1.0
$Default PBanks: ( "Terran Turret" "Terran Turret" )
$Subsystem: turret12,0.833,1.0
$Default PBanks: ( "TerSlash" )
$Subsystem: turret13,0.833,1.0
$Default PBanks: ( "AAAf" )
$Subsystem: turret14,0.833,1.0
$Default PBanks: ( "Standard Flak" )
$Subsystem: turret15,0.833,1.0
$Default PBanks: ( "AAAf" )
$Subsystem: turret16,0.833,1.0
$Default pBanks: ( "TerSlash" )
$Default SBanks: ( )
$Subsystem: turret17,0.833,1.0
$Default PBanks: ( "AAAf" )
$Subsystem: turret18,0.833,1.0
$Default sBanks: ( "Piranha" )
$Subsystem: turret19,0.833,1.0
$Default PBanks: ( "Terran Turret" "Terran Turret" )
$Subsystem: turret20,0.833,1.0
$Default PBanks: ( "Standard Flak" )
$Default SBanks: ( )
$Subsystem: turret21a,0.833,1.0
$Default PBanks: ( "Terran Huge Turret" "Terran Huge Turret" "Terran Huge Turret" )
$Subsystem: turret22a,0.833,1.0
$Default PBanks: ( "Terran Huge Turret" "Terran Huge Turret" "Terran Huge Turret" )
$Subsystem: turret23a,0.833,1.0
$Default PBanks: ( "Terran Turret" "Terran Turret" )
$Subsystem: turret24a,0.833,1.0
$Default PBanks: ( "Terran Turret" "Terran Turret" )
$Subsystem: turret25a,0.833,1.0
$Default PBanks: ( "Terran Turret" "Terran Turret" )
$Default SBanks: ( )
$Subsystem: communications, 5,0.0
$Subsystem: sensors, 5,0.0
$Subsystem: navigation, 5,0.0
$Subsystem: weapons, 5,0.0
Like this? - Same as before....
That's why I think this is so wierd...
-
Name the ship Iceni#New and use that.
It should solve the problem.
-
Name the ship Iceni#New and use that.
It should solve the problem.
Did that... but it still doesn't solve the underlying "problem" - just got me rid of it...
-
In the new table entry, try specifying either Pbanks or Sbanks for a turret, but not both. Remove empty entries like "$Default SBanks: ( )"
-
$Default SBanks: ( "" ) worked when I used it on the Faustus.
-
Yeah that's what I thought was meant by not using +nocreate, I don't know how that wouldn't work.
It doesn't.
TBM's never replace entire table entry regardless of whether you use +nocreate or not. +nocreate only allows you to get away without having to set up full table entry if required data already exists in another tbm or tbl.
So for example, if you have a tbl that contains ship A that has secondary banks in turret 1. You add primary banks in a tbm, which means turret 1 now has both primaries and secondaries regardless of whether +nocreate is used or not.
It is not (currently) possible to fully replace a ship or weapons table entry with a tbm, data from all tbm's and tbl is always parsed and applied. There are cumbersome methods to override certain flags, mostly weapons though, but that's it.
Seems like people have misunderstood how +nocreate actually works and what it's used for.
$Default SBanks: ( "" ) worked when I used it on the Faustus.
As it should.
-
TBM's never replace entire table entry regardless of whether you use +nocreate or not.
[...]
It is not (currently) possible to fully replace a ship or weapons table entry with a tbm, data from all tbm's and tbl is always parsed and applied.
That's the part I was missing... I was thinking that my tbm would over-rule the same data from the tbl and not just be added to it....
Thanks for enlightening me...
-
So if a ship that doesn't have +nocreate in a tbm has the same name as a ship in a tbl, and this doesn't fully overwrite the existing ship in the tbl, what is the point of +nocreate? It seems like the default should be, delete the first go, and start over from the entry in the tbm.
-
Umm, no.
I don't know how to explain it properly, but let me try.
Perhaps easier method of explaining this is to think of tbl like it is a tbm. If you have two tbm files, both containing almost identical table entries of same ship or weapon. The first tbm loaded overwrites everything the second one has in it, except for lines that does not exist in the first tbm. Whatever was missing in the first tbm is added from the second one. Same happens if the second file happens to be tbl.
In short, if you have full tbl entry in a tbm, the weapon or ship is created right then and there. But then tbl file that is loaded and parsed afterwards works like a tbm file and adds anything the tbm doesn't have. In this Iceni-case, missile turrets.
If you want to alter this behavior, you need to create a new argument for it, like +replace or something. But I'm not sure you should do that, because you can't be sure whether modders want to fully overwrite tbl only, or both tbl and tbm. For example, you have a mod that relies on mediavps and you use +replace argument, does modder want to parse mediavps tbm data or not?
-
So then, it sounds like the difference between +nocreate and not +nocreate, is that without it, it needs to be a full ship definition in the tbm, and doesn't need a previous entry, but they treat the previous ship entry (if there is one) the same? Hope that was clear enough to follow...
-
Indeed. Whatever is missing in first parsed entry, is added from any subsequently parsed tbl or tbm files, regardless of whether any of those entries are full or partial or whether file is tbm or tbl.
I hope this is enough to clear misunderstandings revolving around use of full tbl entries in tbm files without +nocreate.
-
It is, and now I think the behavior is silly :P
Do we need a +destroy flag then as well? Would be the easiest way to know you're on a clean slate. If optional entries in the original tbl entry can't be overridden then we have a problem it sounds like.
-
There has been discussions on #scp about having an argument that can remove specified flags, but not original tbl entry. I don't even know if it would be possible to differentiate original tbl entry from tbm entries. You'd probably end up ignoring all tbl and other tbm entries, not just original tbl entry.
So for example, you have a ships.tbl entry you want to ignore, how would you not ignore a tbm containing a cockpit for the ship, or perhaps newtonian flight model for the ship, or any other additions like that? I don't think it'd be easy to code something like that. And then you'd get people who not only want to ignore original entry, but all other tbm's too that are loaded after. Seems more trouble than its worth.
Per-flag based ignore or remove option would be better. At least FUBAR and IssMneur have engaged in such discussion before on #scp.
-
Does the tbm have the "#ship classes" at the top and "#end" at the bottom? I suspect that's a silly question (i'm a complete n00b with tbms to boot) but i noticed they arn't on the bit you uploaded.
-
yes they do
-
If I want to _completely_ ignore all previous entries up to that point in parsing, I should be able to. I can't believe we've gone this long without that being an option. I don't care if cockpits or whatever were previously defined, that would be the risk involved. Per-option could prove useful as well for certain flags of course, but a full override would also be very useful I think. It seems that only certain optional flags have really caused an issue though, such as $Flags and SBanks/PBanks. So handling those separately might not be a bad idea after all.
-
How about an option to overwrite on a per-line basis? Add a +replace_line, then the next entry will be completely overwritten. If you want to erase an entry, for example have the $Default PBanks: line erased, just leave all the info from the line, basically everything you'd put in after the ":", blank. Under this proposed code, it would let the computer know to completely erase the $Default PBanks: line. On the other hand, if you're worried about the ship flags, the +replace_line use would let the game know to dump all previously present flags, and use ONLY the ones listed in the tbm.