Author Topic: How to clear techroom?  (Read 1256 times)

0 Members and 1 Guest are viewing this topic.

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
  • A Typhon-class destroyer.
How to clear techroom?
Hey all!

So for the mod I'm working on, I'd like to get the techroom clear. I'm using retail ships, but I'd like to only have my custom ships actually in the techroom.

I know that I could import the retail tbl data and remove all the "in tech database" flags, but I'd like to know if there's a simpler way. I'll do it if I have to, but...

Thanks!

 
Re: How to clear techroom?
Name your custom table ships.tbl.
Ah wait, you still want retail ships. Then nvm :warp:
« Last Edit: November 03, 2016, 03:55:54 pm by tomimaki »

 

Offline 0rph3u5

  • 211
  • Reality is the finest flesh...
    • Steam
    • Twitter
Re: How to clear techroom?
Use a -shp.tbm with +nocreate entries for the retail ships. With these entries you can overwrite the $flags-line of ships.tbl without having your own ships.tbl

Be advised however that this might interfere with any mod you are also using that does exactly the same thing...
"When you work with water, you have to know and respect it. When you labour to subdue it, you have to understand that one day it may rise up and turn all your labours into nothing. For what is water, which seeks to make all things level, which has no taste or colour of its own, but a liquid form of Nothing?" - Graham Swift, Waterland

"...because they are not Dragons."

 
Re: How to clear techroom?
On a similar thread, is there any way to reorder the DB with a .tbm that doesn't remove or add any retail ships? I was able to do this with a .tbl by just reordering entries, but the .tbm doesn't handle that because the retail .tbl order is still preserved.

 

Offline 0rph3u5

  • 211
  • Reality is the finest flesh...
    • Steam
    • Twitter
Re: How to clear techroom?
The order in the techdatabase is the same as in the ships.tbl - there is no changing that right now as far as i know
(A coder may contradict me)
"When you work with water, you have to know and respect it. When you labour to subdue it, you have to understand that one day it may rise up and turn all your labours into nothing. For what is water, which seeks to make all things level, which has no taste or colour of its own, but a liquid form of Nothing?" - Graham Swift, Waterland

"...because they are not Dragons."

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
  • A Typhon-class destroyer.
Re: How to clear techroom?
Use a -shp.tbm with +nocreate entries for the retail ships. With these entries you can overwrite the $flags-line of ships.tbl without having your own ships.tbl

Be advised however that this might interfere with any mod you are also using that does exactly the same thing...

What would a +nocreate entry look like? Would it just be the Name plus a nocreate flag, or do I have to type out the entire entry?

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: How to clear techroom?
with a +nocreate flag, you only have to have the lines you want to replace in the tbm (in this case, would be just $Flags: )
(´・ω・`)
=============================================================

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
  • A Typhon-class destroyer.
Re: How to clear techroom?
with a +nocreate flag, you only have to have the lines you want to replace in the tbm (in this case, would be just $Flags: )

Great, that's what I had hoped.

Hoo boy, time for some serious typing. This is going to take time.  :p Do they have to be in the same order as the entries in the retail .tbl, or can they be in a different order and still replace the retail ships as long as the names are the same?

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
  • A Typhon-class destroyer.
Re: How to clear techroom?
Wait, does "nocreate" go in the $Flags field, or does "+nocreate" come right after the $Name?

 

Offline niffiwan

  • 211
  • Eluder Class
Re: How to clear techroom?
Code: [Select]
$Name:                  SB Seraphim
+nocreate
$Allowed PBanks:             ( "Subach HL-7" "Subach HL-7" "Subach HL-7")
$Default PBanks:             ( "Subach HL-7" "Subach HL-7" "Subach HL-7" )
$Flags:                 ( "player_ship" "bomber" "dynamic primary linking" )

(from a table I have lying around)
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Linux OBS Packages: FSO 3.7.0 | FSO BP Build | wxLauncher (?) | PCS2 (?) | wxVPView (?)
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
with a +nocreate flag, you only have to have the lines you want to replace in the tbm (in this case, would be just $Flags: )
This is a misconception; no information is actually required for a ship table entry except its name (although attempting to actually do anything with such an entry, like look at it in the F3 lab, will almost certainly result in warnings/errors/crashes). The only thing "+nocreate" does is say that an entry for the ship won't be created if it doesn't already exist; if you can guarantee that it will already exist, it serves no purpose (it's only really useful for things like the MediaVPs, which may be used as a secondary mod for mods that may not use the retail ships.tbl file).

That being said, it's common practice to use "+nocreate" with any entry meant to modify an existing entry "just in case", and/or because of misconceptions that the entry otherwise wouldn't be valid.
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.

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
  • A Typhon-class destroyer.
with a +nocreate flag, you only have to have the lines you want to replace in the tbm (in this case, would be just $Flags: )
This is a misconception; no information is actually required for a ship table entry except its name (although attempting to actually do anything with such an entry, like look at it in the F3 lab, will almost certainly result in warnings/errors/crashes). The only thing "+nocreate" does is say that an entry for the ship won't be created if it doesn't already exist; if you can guarantee that it will already exist, it serves no purpose (it's only really useful for things like the MediaVPs, which may be used as a secondary mod for mods that may not use the retail ships.tbl file).

That being said, it's common practice to use "+nocreate" with any entry meant to modify an existing entry "just in case", and/or because of misconceptions that the entry otherwise wouldn't be valid.




But in this case, an entry does already exist in the retail .tbl. I just want to make all the retail entries disappear from the tech room (unless you hit Ctrl-Shift-S, of course).

You should open the techroom and see nothing but the custom ships that I've added.

This does not work:
Code: [Select]
$Name: GTF Ulysses
+nocreate

The entry is still there.
« Last Edit: November 05, 2016, 01:25:34 pm by PVD_Hope »

 

Offline 0rph3u5

  • 211
  • Reality is the finest flesh...
    • Steam
    • Twitter
with a +nocreate flag, you only have to have the lines you want to replace in the tbm (in this case, would be just $Flags: )
This is a misconception; no information is actually required for a ship table entry except its name (although attempting to actually do anything with such an entry, like look at it in the F3 lab, will almost certainly result in warnings/errors/crashes). The only thing "+nocreate" does is say that an entry for the ship won't be created if it doesn't already exist; if you can guarantee that it will already exist, it serves no purpose (it's only really useful for things like the MediaVPs, which may be used as a secondary mod for mods that may not use the retail ships.tbl file).

That being said, it's common practice to use "+nocreate" with any entry meant to modify an existing entry "just in case", and/or because of misconceptions that the entry otherwise wouldn't be valid.




But in this case, an entry does already exist in the retail .tbl. I just want to make all the retail entries disappear from the tech room (unless you hit Ctrl-Shift-S, of course).

You should open the techroom and see nothing but the custom ships that I've added.

This does not work:
Code: [Select]
$Name: GTF Ulysses
+nocreate

The entry is still there.

Code: [Select]
$Name: GTF Ulysses
+nocreate
$Flags:                         ( "player_ship" "default_player_ship" "fighter" )
should do the trick - at least it does for me
"When you work with water, you have to know and respect it. When you labour to subdue it, you have to understand that one day it may rise up and turn all your labours into nothing. For what is water, which seeks to make all things level, which has no taste or colour of its own, but a liquid form of Nothing?" - Graham Swift, Waterland

"...because they are not Dragons."

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
  • A Typhon-class destroyer.
with a +nocreate flag, you only have to have the lines you want to replace in the tbm (in this case, would be just $Flags: )
This is a misconception; no information is actually required for a ship table entry except its name (although attempting to actually do anything with such an entry, like look at it in the F3 lab, will almost certainly result in warnings/errors/crashes). The only thing "+nocreate" does is say that an entry for the ship won't be created if it doesn't already exist; if you can guarantee that it will already exist, it serves no purpose (it's only really useful for things like the MediaVPs, which may be used as a secondary mod for mods that may not use the retail ships.tbl file).

That being said, it's common practice to use "+nocreate" with any entry meant to modify an existing entry "just in case", and/or because of misconceptions that the entry otherwise wouldn't be valid.




But in this case, an entry does already exist in the retail .tbl. I just want to make all the retail entries disappear from the tech room (unless you hit Ctrl-Shift-S, of course).

You should open the techroom and see nothing but the custom ships that I've added.

This does not work:
Code: [Select]
$Name: GTF Ulysses
+nocreate

The entry is still there.

Code: [Select]
$Name: GTF Ulysses
+nocreate
$Flags:                         ( "player_ship" "default_player_ship" "fighter" )
should do the trick - at least it does for me

Aha, of course! I just need to get rid of the in-tech-database flag. Thanks!

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
with a +nocreate flag, you only have to have the lines you want to replace in the tbm (in this case, would be just $Flags: )
This is a misconception; no information is actually required for a ship table entry except its name (although attempting to actually do anything with such an entry, like look at it in the F3 lab, will almost certainly result in warnings/errors/crashes). The only thing "+nocreate" does is say that an entry for the ship won't be created if it doesn't already exist; if you can guarantee that it will already exist, it serves no purpose (it's only really useful for things like the MediaVPs, which may be used as a secondary mod for mods that may not use the retail ships.tbl file).

That being said, it's common practice to use "+nocreate" with any entry meant to modify an existing entry "just in case", and/or because of misconceptions that the entry otherwise wouldn't be valid.

How is that a misconception? and how is that relevant?  :confused:
He's trying to overwrite a field in an existing ship, and was asking whether he needed to paste the whole entry or just the line to be replaced, in which case the answer is "only the line to be replaced".

Whether +nocreate is necessary or not does not factor in to this.

Your tangent on there not needing to be any actual lines in a ship entry (and not having +nocreate) is neither relevant, and nor useful other than for trivia purposes.
Yes, you don't need +nocreate, but why would you encourage poor practice? Having it there has no downside, even if the entry you are seeking to modify is guaranteed to exist. And can you really guarantee that an entry will always exist? Mods can evolve over time to the point where you may need to expunge certain entries from the base ships.tbl just to reduce clutter, etc. You can bet that if you promote not using it if you can "guarantee* the base entry will exist, someone will forget about that, delete/remove the base entry and wonder why they still have such a ship entry and why it's causing the game to crash (or throw errors).
I would rather just perpetuate this "misconception" because frankly it makes for good practices.
(´・ω・`)
=============================================================

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
How is that a misconception?
...he asks, before demonstrating that he seems quite clear on how it's a misconception. :wtf:

and how is that relevant?  :confused:
He's trying to overwrite a field in an existing ship, and was asking whether he needed to paste the whole entry or just the line to be replaced, in which case the answer is "only the line to be replaced".

Whether +nocreate is necessary or not does not factor in to this.

Your tangent on there not needing to be any actual lines in a ship entry (and not having +nocreate) is neither relevant, and nor useful other than for trivia purposes.
A much better question; it's relevant because that's how the engine works! If you're wondering why that was the only information my post included, it's because it originally included more information but niffiwan ninja'd me in the process, so I removed the redundant parts.

Yes, you don't need +nocreate, but why would you encourage poor practice? Having it there has no downside, even if the entry you are seeking to modify is guaranteed to exist. And can you really guarantee that an entry will always exist? Mods can evolve over time to the point where you may need to expunge certain entries from the base ships.tbl just to reduce clutter, etc. You can bet that if you promote not using it if you can "guarantee* the base entry will exist, someone will forget about that, delete/remove the base entry and wonder why they still have such a ship entry and why it's causing the game to crash (or throw errors).
I would rather just perpetuate this "misconception" because frankly it makes for good practices.
I would argue that modding by voodoo is worse practice than not including a redundant line; as for there being "no downside", the downside is that people get into the habit of adding "+nocreate" to entries that shouldn't have it, and then get confused when FSO complains at them (this has happened before; had someone very confused ask me why "+nocreate" couldn't be used with Ship Templates and it took quite a while for the explanation to sink in because they had a misconception of what "+nocreate" actually did).

Also, "mods can remove the base ship and then have a pointless +nocreate entry lying around" doesn't really strike me as an argument in favour of the behavior you're describing; it sounds like the worst kind of practices to be encouraging.

Lastly, you seem... unusually hostile about this? Aggravated, maybe? Perhaps I'm reading tone where there is none, in which case don't worry about it, but I was really just providing some extra information because I feel like we have enough bad information being passed around (that we later discover has no basis in how the engine actually works) as it is; no need to take it personally.
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.

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
I may have come off a bit hostile about it, yes. Apologies.
Yes, you've explained the general misconception sufficiently well. I was just very confused by the lack of relevance of the post, and how the quoted statement actually referred to the misconception at all?

That and mod debugging triggers me. Probably.
*shudders*
(´・ω・`)
=============================================================

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
  • A Typhon-class destroyer.
Help help everybody's arguing over my innocent question. help.  :p

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Naw im just being dumb
(´・ω・`)
=============================================================