Citizens of the Imperium

Citizens of the Imperium (
-   Software Solutions (
-   -   How To Make .sec Files? (

a strange aeon July 31st, 2009 12:15 PM

How To Make .sec Files?
Hello, I paged through most of this forum but I couldn't find an answer to my question.

Right now, I have a Ruby script that can generate worlds, sub-sectors, and sectors using Mongoose Traveller, and then map them out using Rmagick. There's a lot of neat features, and the maps that are created have a lot of cool additions to the basic ones presented in the Core Book, like the UWP actually listed in the system hex, colored planets representing atmosphere type, and different sized planets.

It also has the ability to map an already created sector from a .sec file. My problem is I really just want to map a particular sub-sector I already created. In theory, if I had the ability to create a .sec file, which only consisted of the one filled out sub-sector and 15 voids, I'd be able to get a good map of the sub-sector I created.

However, I don't understand how to make a .sec file. The Traveller wikia leads me to believe that .sec is just a certain kind of formatting, not an actual distinct file type. So I thought maybe I could just name a .txt file .sec, but that didn't work.

Basically, I'm looking for a way to input my own sub-sector data and save it as a .sec file. I'd imagine this is possible to do, I just can't figure out how to do it!


coliver988 July 31st, 2009 03:52 PM

it is just a fixed length text file with specific columns. There are some varients but does have the basic formatting.

If you search this forum you can find the regex expressions to handle the variants and from what I understand Ruby does well with regex.

aramis July 31st, 2009 05:30 PM

It is vital to use only spaces, not tabs, in your sec files. Most common mistake made for 10+ years...

a strange aeon July 31st, 2009 05:42 PM

Hmm, I'm not sure what Regex is?

Here's what the Ruby script documentation says (I'm not very good at programming or script writing or anything) about .sec files:

--secfile [file] -f[file] : read the worlds from the file, which is in SEC format. Note that this script doesn't actually write SEC format
# so it's not actually possible to feed it's own output back to it as input

That's the command I'd like to use--so it would read a .sec file (if I can figure out how to make one) and map out my specific sub-sector.

It gives an example later on as to how to use it:

# This will map the Spinward Marches from a SEC file, correctly naming all the subsectors:
# ruby worldgen.rb -S1 -f 'spinward.sec' -N 'Spinward Marches' -n 'Cronor','Jewell','Regina','Aramis','Querion','Vil is','Lanth','Rhylanor','Darrian','Sword Worlds','Lunion','Mora','Five Sisters','District 268','Glisten','Trins Veil' -m

My problem is how to actually create a .sec file; I have all the UWP codes for the sector I've created, but when I save a text file with the codes it's in .txt form or .rtf, not .sec format. Saving from Textedit into .sec doesn't seem to be an option.

I'm sure there's a really easy solution, but, for instance, when I copy and paste the Sec data from the Wikia page, so I have a file on my computer, I can't save it as .sec, only as some kind of text file.

If I have the UWPs for the sub-sector already, is there someone who could turn that into a .sec file format?

aramis July 31st, 2009 05:48 PM

In TextEdit on MacOS X:

cmd-shift-t (make plain text)
cmd-opt-s (save as)
use the .sec extension in place of the .txt

And yes, I can.

a strange aeon July 31st, 2009 05:57 PM

Oh, that's good news!

I'm going to try to save it as a .sec file the way you suggested, but if I can't get it to work, I might just post the UWPs--if I just post them to this thread, would that be alright?

And thank you so much for the quick responses!

a strange aeon July 31st, 2009 06:07 PM

Okay, I managed to save it as a .sec file, but I must have the formatting wrong because it won't read it.

Here's part of the the sub-sector listing--I think if I can see it in the right format, I can easily add the rest of the UWP codes and then I'll know how to do it!

Brist 0102 C689499-8 Ni A
David 0105 C84A9D9-12 S Hi Ht In A
Donoden 0107 E250516-5 De Lt Ni Po
Oshara 0108 A360862-9 N,T De Ri
Calemiir 0109 E363200-5 Lo Lt A
Rosanyen 0110 B589121-9 N,S,T Lo

Dorussi 0202 E486553-4 Ag Lt Ni
Corrongon 0204 A79A213-12 R Ht Lo
Jaranor 0206 C695794-3 T Ag Ga Lt
Savene 0207 C673401-9 S Ni A
Tatmuet 0209 C590724-6 R De

Tyrella 0301 C767887-6 S Ga Ri
Herodotus 0305 C000359-10 As Lo Va A
Ushnish 0307 D6436A9-3 Lt Ni Po A

I'm not sure how this works, exactly, but if you can PM me the .sec file, I will see if I can make it work and add the rest of them.

Thanks again for the help!

aramis July 31st, 2009 07:08 PM

What you sent:

Brist                            0102      C689499-8                        Ni                      A
David                          0105      C84A9D9-12      S            Hi Ht In              A
Donoden                      0107      E250516-5                        De Lt Ni Po
Oshara                        0108      A360862-9        N,T          De Ri
Calemiir                      0109      E363200-5                        Lo Lt                  A
Rosanyen                    0110      B589121-9        N,S,T      Lo

Dorussi                        0202      E486553-4                        Ag Lt Ni
Corrongon                    0204      A79A213-12      R            Ht Lo
Jaranor                        0206      C695794-3        T            Ag Ga Lt
Savene                        0207      C673401-9        S            Ni                        A
Tatmuet                      0209      C590724-6        R            De

Tyrella                        0301      C767887-6        S            Ga Ri
Herodotus                    0305    C000359-10                      As Lo Va              A
Ushnish                      0307    D6436A9-3                      Lt Ni Po                A

what it should look like.

                  1    2        3 4              5
# N Navy
# T ??
# u N & T
# V NS&T
# 1-14: Name
# 15-18: HexNbr
# 20-28: UWP
# 31: Bases
# 33-47: Trade Codes & Comments
# 49: Zone
# 52-54: PBG
# 56-57: Allegiance
# 59-74: Stellar Data
# ..+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
# 345678901234567890123456789012345678901234567890123456789012345678901234567890
Brist        0102 C689499-8    Ni              A
David        0105 C84A9D9-C  S Hi Ht In        A
Donoden      0107 E250516-5    De Lt Ni Po
Oshara        0108 A360862-9  U De Ri
Calemiir      0109 E363200-5    Lo Lt          A
Rosanyen      0110 B589121-9  V Lo
Dorussi      0202 E486553-4    Ag Lt Ni
Corrongon    0204 A79A213-C  R Ht Lo
Jaranor      0206 C695794-3  T Ag Ga Lt
Savene        0207 C673401-9  S Ni              A
Tatmuet      0209 C590724-6  R De
Tyrella      0301 C767887-6  S Ga Ri
Herodotus    0305 C000359-A    As Lo Va        A
Ushnish      0307 D6436A9-3    Lt Ni Po        A

Copy it, then paste it into Text Edit.

In Sec Files, TL always has to be coded; TL's 10 to 33 are always letters.
the actual space needs to be correct; note how they all line up in a monospaced font.
When posting monospaced stuff on the BBS, you need to use [code][/code] tags around it.

a strange aeon August 1st, 2009 12:47 AM

Thanks! I see how it formats now!

Sadly, even with that, the script didn't work--but that may be because it needs some kind of input for the sub-sectors I assumed it would read as "void" or due to the script itself--regardless, knowing how to make a .sec file is extremely useful!

Thanks so much! I e-mailed the author of the script and explained the situation, so he might have some input on why it didn't read my .sec file.

All times are GMT -4. The time now is 05:21 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright (c) 2010-2013, Far Future Enterprises. All Rights Reserved.