Author Topic: How to clear the default five weapons from the tech database?  (Read 2539 times)

0 Members and 1 Guest are viewing this topic.

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
How to clear the default five weapons from the tech database?
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?

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: How to clear the default five weapons from the tech database?
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:
« Last Edit: February 14, 2017, 09:30:38 am by The E »
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 HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Re: How to clear the default five weapons from the tech database?
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?

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: How to clear the default five weapons from the tech database?
+nocreate is necessary for any table entry whose only purpose is to modify an existing weapon or ship.
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 AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: How to clear the default five weapons from the tech database?
+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.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 
Re: How to clear the default five weapons from the tech database?
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?

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: How to clear the default five weapons from the tech database?
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.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 
Re: How to clear the default five weapons from the tech database?
Huh, I'd never thought about someone using the MediaVPs that way, but that makes sense. Thanks!

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Re: How to clear the default five weapons from the tech database?
Adding +override worked, thanks a bunch guys!

And thanks for the explanation, AdmiralRalwood :)

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: How to clear the default five weapons from the tech database?
There are also flags that you can set in FRED at the start of a campaign which affect the weapon's visibility.
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Re: How to clear the default five weapons from the tech database?
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. :)