Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: HLD_Prophecy on February 14, 2017, 09:08:00 am

Title: How to clear the default five weapons from the tech database?
Post by: HLD_Prophecy on February 14, 2017, 09:08:00 am
Hey all!

So I'm trying to set the default five weapons that appear in the tech database to be invisible by default. These are the Subach, Mekhu, Akheton SDG, Rockeye, and Tempest.

I tried adding entries like these into my wep.tbm:

Code: [Select]
$Name: Subach HL-7
$Flags: ("player allowed" "stream")

$Name: Mekhu HL-7
$Flags: ("player allowed" "stream")

I would have thought that removing the "in tech database" flag would have worked, but the entries still show up. I also tried this, as it worked for clearing ship entries:

Code: [Select]
$Name: Subach HL-7
+nocreate
$Flags: ("player allowed" "stream")

But that didn't work either.


Any help, please?
Title: Re: How to clear the default five weapons from the tech database?
Post by: The E on February 14, 2017, 09:25:26 am
You're already most of the way there. You just need to add "+override" after the new flag list, this will cause the old flag list to be replaced by the one you specify.

See also: http://www.hard-light.net/wiki/index.php/Weapons.tbl#.24Flags:
Title: Re: How to clear the default five weapons from the tech database?
Post by: HLD_Prophecy on February 15, 2017, 08:20:21 am
You're already most of the way there. You just need to add "+override" after the new flag list, this will cause the old flag list to be replaced by the one you specify.

See also: http://www.hard-light.net/wiki/index.php/Weapons.tbl#.24Flags:

Thanks!

Is +nocreate necessary or not?
Title: Re: How to clear the default five weapons from the tech database?
Post by: The E on February 15, 2017, 08:37:31 am
+nocreate is necessary for any table entry whose only purpose is to modify an existing weapon or ship.
Title: Re: How to clear the default five weapons from the tech database?
Post by: AdmiralRalwood on February 15, 2017, 02:41:04 pm
+nocreate is necessary for any table entry whose only purpose is to modify an existing weapon or ship.
This is untrue; +nocreate is only necessary if there is a possibility that the original entry may not exist.
Title: Re: How to clear the default five weapons from the tech database?
Post by: xenocartographer on February 15, 2017, 09:10:22 pm
Not to get too far off-topic, but I've never understood +nocreate. It seems like it's just suppressing useful errors and, if a valid entry with the same name gets loaded later, potentially hiding any trace of the problem until someone happens to notice the incorrect values (not easy if it's, say, some special-case flag or something). In that case, I'd rather have the parser yell at me. What gives?
Title: Re: How to clear the default five weapons from the tech database?
Post by: AdmiralRalwood on February 15, 2017, 09:32:29 pm
Not to get too far off-topic, but I've never understood +nocreate.
The MediaVPs are meant to be used even with mods that may not include the full set of ships/weapons as retail; they thus use +nocreate so their changes only apply if the thing exists in the first place (rather than creating a new entry missing most if not all of the data it needs to be usable and potentially pushing a mod over the ship/weapon limit despite not using those ships/weapons at all).

For anyone developing their own mod that is not meant to be used similarly to the MediaVPs, +nocreate serves absolutely no purpose.
Title: Re: How to clear the default five weapons from the tech database?
Post by: xenocartographer on February 16, 2017, 10:01:45 am
Huh, I'd never thought about someone using the MediaVPs that way, but that makes sense. Thanks!
Title: Re: How to clear the default five weapons from the tech database?
Post by: HLD_Prophecy on February 16, 2017, 08:10:13 pm
Adding +override worked, thanks a bunch guys!

And thanks for the explanation, AdmiralRalwood :)
Title: Re: How to clear the default five weapons from the tech database?
Post by: z64555 on February 19, 2017, 11:12:55 pm
There are also flags that you can set in FRED at the start of a campaign which affect the weapon's visibility.
Title: Re: How to clear the default five weapons from the tech database?
Post by: HLD_Prophecy on February 20, 2017, 09:04:46 pm
There are also flags that you can set in FRED at the start of a campaign which affect the weapon's visibility.

Thanks for the tip. :)