Help with code for AS

Ok, I'm asking for help. I've been trying to figure out the code for weeks and either I just haven't been able to get enough time to figure this out or I'm just bad at figuring out code. I know exactly what I want it to do, its just getting it to do what I want thats hard!

I want all systems/planets with populations greater than 10,000 to have names, and all with less to have numbers. I want subsectors to have different names than planets and systems, and, if possible, suns to have different names (or different name endings) than planets.

Is this possible? Any help or advice would be greatly appreciated!


Danger is my middle name... ;)


  • Have you looked at deck picks?

    Table: Main
    Shuffle: Names
    [when] vPop < 10000 [do] {!vPlanet =={d1000}} [else] vPlanet = [!Names] [end] &
    {$vPlanet}, Population: {$vPop}, Primary: [!Names], System: [!Names], Sub-Sector: [!Names]

    To me this is a bit backwards, you should have multiple systems in a sub-sector, with the possibility of multiple inhabited planets in a system. with a sun of sufficient size, it is possible to have 2 or 3 planets able to support Terran life on them, if you have alien species, this can expand greatly, and since this is a sci-fi game, domes and stations are possibilities as well.

    Also, systems tend to be named after the primary (primaries) of that system, hence, the our 'solar' systems primary is Sol, it could also be called the Sol System. And what says that a planet can't take the name of it's primary? Technically, Earth is Sol-3, the third planet in the Sol System.

    So, I'd go top down:

    Table: Main
    Sub-Sector: [@Name] \n &
    \t [@{3d4-2} System] \n & // 1-10 systems, with 4 being most common (thanks to the bell curve)
    \t \t [@{3d3-2} Planet] //1-7 habitable locations, 3 is most common

    Table: System
    50: [@Name]
    30: [@Name] {1d5000}
    10: [@Name]-[@Name]

    Table: Planet
    10: Planet: [@Name]
    Lunar Colony: [@Name]
    6: Station: [@Name]


    I would also add a (brief) description of each sun and planet, maybe add to the number of 'planets' selected and add resource items (is the planet or system known for anything, etc). Plus you could add facts or generate side-quest plots associated with the system.

    If you have a problem with duplicates, or the generated sub-system doesn't seem right, ignore it; unless more then half of your generated items are worthless, your table is probably fine, it may just need a little tweaking.

Leave a Comment