Galactic Almanac OXZ - Full Version 0.92 - Now on the Expansion Pack Manager (Updated 12.08.23)

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4574
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Galactic Almanac OXZ - Full Version 0.92 - Now on the Expansion Pack Manager (Updated 12.08.23)

Post by phkb »

Another minor bug:
If you dock with a station in interstellar space, it generates this error:

Code: Select all

10:22:30.602 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (RandomStationNames 0.92): TypeError: system.sun is null
10:22:30.602 [script.javaScript.exception.unexpectedType]:       ../AddOns/Ambience.oxp/GalacticAlmanac.oxp/Scripts/randomstationnames.js, line 8440.
(ignore the line number - I've been tweaking the code so it probably won't match your code)

This is the code:

Code: Select all

//Code to add the Galactic Almanac to the F4 Screen when docked this any ship, station or hermit in the game or landed on any planet or moon (if PlanetFall is installed)..
this.shipDockedWithStation = function (station) {
    if (system.isInterstellarSpace) this.noalmanac();
    if (system.sun.isGoingNova) this.noalmanac2();
    if (system.sun.hasGoneNova) this.noalmanac3();
    if (!system.sun) this.noalmanac4();
    if (missionVariables.random_station_names_planetengine === "Yes" || missionVariables.random_station_names_spawnmoons === "Yes") {
        if (missionVariables.random_station_names_stranger_populated_system !== "Yes") this.noalmanac5();
    }
    if (missionVariables.random_station_names_planetengine !== "Yes" && missionVariables.random_station_names_spawnmoons !== "Yes") this.almanacinterface();
    if (missionVariables.random_station_names_planetengine === "Yes" || missionVariables.random_station_names_spawnmoons === "Yes") {
        if (missionVariables.random_station_names_stranger_populated_system === "Yes") this.almanacinterface();
    }
    // Closing Bracket for whole function.
};
There are a couple of problems with this code, even outside of interstellar space.
If you are in interstellar space, then there will be no sun. So, the 3 IF statements after the opening one are going to fail.

You have a check for if (!system.sun). However that should precede the two previous IF statements that assume there is a sun of some sort in the system.

If *think* what you need to do is exit the function as soon as one of the conditions is true:

Code: Select all

//Code to add the Galactic Almanac to the F4 Screen when docked this any ship, station or hermit in the game or landed on any planet or moon (if PlanetFall is installed)..
this.shipDockedWithStation = function (station) {
    if (system.isInterstellarSpace) {this.noalmanac(); return;}
    if (!system.sun) {this.noalmanac4(); return;} // need to do this check before the next two
    if (system.sun.isGoingNova) {this.noalmanac2(); return;}
    if (system.sun.hasGoneNova) {this.noalmanac3(); return;}
    if (missionVariables.random_station_names_planetengine !== "Yes" && missionVariables.random_station_names_spawnmoons !== "Yes") {this.almanacinterface(); return;}
    if (missionVariables.random_station_names_planetengine === "Yes" || missionVariables.random_station_names_spawnmoons === "Yes") {
        if (missionVariables.random_station_names_stranger_populated_system === "Yes") {
            this.almanacinterface(); 
        } else {
            this.noalmanac5();
        }
    }
    // Closing Bracket for whole function.
};
You were also doubling up an "IF" statement, which I combined into one.

I'd question whether you need to do a separate check for whether there is a system.sun entity (the second IF statement). The only place that doesn't get a sun is interstellar space, and you're already checking for that. Even in a system that has gone nova, no stations will spawn, so you would never be able to dock with anything, and so this code would never fire.
User avatar
MrFlibble
Dangerous
Dangerous
Posts: 105
Joined: Sun Feb 18, 2024 12:13 pm

Re: Galactic Almanac OXZ - Full Version 0.92 - Now on the Expansion Pack Manager (Updated 12.08.23)

Post by MrFlibble »

For the next preening, these just leapt off the page at me:

From oolite.oxp.LittleBear.GalacticAlmanac.oxz/Scripts/randomstationnames.js in var missiontext4

Change condominiums to condiments.
Change beath to berth.

oolite.oxp.LittleBear.GalacticAlmanac.oxz/Scripts/randomstationnames.js missionVariables.random_station_names_briefingpage2text

Change reproduced to reproduce

oolite.oxp.LittleBear.GalacticAlmanac.oxz/Scripts/randomstationnames.js:missionVariables.random_station_names_briefingpage2text

Change know to known
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4574
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Galactic Almanac OXZ - Full Version 0.92 - Now on the Expansion Pack Manager (Updated 12.08.23)

Post by phkb »

There seems to be a missing step in the "nameplanetandmoons" function.

In the code, you have this comment:

Code: Select all

            // Check the object wasnt already Classified on a previous run of the this.nameplanetsandmoons function.
However, you don't seem to be checking whether the object has been previously named by this function (or if you are, I can't see where it's happening), so it can do it's thing again and you end up with moons named "Leteisan II (Moon) II (Moon) II (Moon)".

Adding this line of code immediately after that comment seems to fix things up:

Code: Select all

            if (oxps[i].displayName && oxps[i].displayName.indexOf(type) >= 0) continue;
User avatar
MrFlibble
Dangerous
Dangerous
Posts: 105
Joined: Sun Feb 18, 2024 12:13 pm

Re: Galactic Almanac OXZ - Full Version 0.92 - Now on the Expansion Pack Manager (Updated 12.08.23)

Post by MrFlibble »

Another typo:
in Scripts/randomstationnames.js:var missiontext10
Change commination to communication, unless the ship has some really dark systems I didn't know about!
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2862
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Re: Galactic Almanac OXZ - Full Version 0.92 - Now on the Expansion Pack Manager (Updated 12.08.23)

Post by LittleBear »

Cheers. Fixed the typos. Tested adding the check for naming on a previous run of the function and whilst the planets and moons were still named, adding it caused the planets and moons not to be added to the ASC. I think (it was quite a while ago I wrote this bit of the oxp) this was why I'd taken the test out (but accidently left the comment in). A check was necessary with a previous version of the code to stop multiple beacons being added to a planet or moon every time the player launched, but in the released version that is prevented by the test with a mission variable which only resets on jumping or loading a new commander.

This bit of the code stops multiple naming as the ASC is only set up once per this.systemwillpopulate and doesn't rerun on each launching.

Code: Select all

// Set Up the ASC. - Only run this on Launching from a saved game and Exiting Hyperspace othewise multiple beacons for the same Planet or Moon would be added.
if (missionVariables.random_station_names_setupASC === "Yes") {
// Exclude some weird invistable objects generated by Planetary Systems OXZ (Detected above).
if (oxps[i].displayName !== "Cosmic String") {
if (type === "(Moon)") this.beacon = system.addVisualEffect("almanacCompass_moon", oxps[i].position); 
if (type !== "(Moon)")  this.beacon = system. addVisualEffect("almanacCompass_planet", oxps[i].position); 
this.beacon.beaconCode = oxps[i].displayName;
this.beacon.beaconLabel = oxps[i].displayName;
}
}};}
return;
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Cholmondely
Archivist
Archivist
Posts: 4933
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Galactic Almanac OXZ - Full Version 0.92 - Now on the Expansion Pack Manager (Updated 12.08.23)

Post by Cholmondely »

With the publication of PlanetFall v.2 and the ability to choose landing sites, I thought I'd indulge in some brainstorming.

The PlanetFall landing site names are taken from The Galactic Almanac OXZ




Musings

What would one expect in terms of the different landing sites on the main planet in a system?

Surely it would depend on the politics, the majority/ruling species and the economy?

Here are some ideas to argue with!



Politics

Corporates: sites at the main corporation factories/headquarters (mostly at cities), leisure centres

Democracies: sites at cities, leisure centres

Confederacies & MultiGoverments: sites at the capital cities of the leading disparate states
eg: Isence: Palace of the Dharinist Dynarchs at the city of Ondaluse (capital of the Djerbitians), city of Vorhusith (capital of the Murasidi, the Boxrhanili and the Loquavirthi), other places (a tea plantation/caravanserai?)
eg: Qutiri: Straits Seminary (Bishopric of the Straits), Conservatoire of Tironos (Empire of Rrowthiessa), Owrosstos (also serves for Qitroomax) (both in the Republic of Maar).

Commies: cities, economic sites, Commie shrines
eg: Laenin: Massive Mausoleum of the Maker (Commie shrine), Peoplesville (capital), Utopia (major city)

Dictatorships (Imperial & Juntas): cities, military bases, factories or agricultural export warehouses

Feudals: Cities, religious shrines, factories or agricultural export warehouses
Note that the Feudal States OXP states are divided by language (or, in G7/8, by species).
See here for Digebiti and Tibecea

Anarchies: Cities, factories or agricultural export warehouses



Species

Humanoids: as humans? But perhaps some are aquatic

Avian/Birds: massive Nesting Grounds?

Batrachians/Frogs: massive Spawning Pools? occasional Hibernation Dormitories? Partially aquatic.

Felines/Cats: Hibernation Dormitories?

Insectoid/Insects: Hives? Some are aquatic.

Lizards/Reptiles: Skin-shedding sites? Some are aquatic.

Lobstoid/Lobsters: Aquatic: Ocean depths (see cim on Lerequ in "City structure shapes - Lobstoid,Insect,Feline et al.")

Rodents/Rats: Competitive Breeding Stadia (Redspear's addition!), Warrens



Economy

Some of these "economy landing sites" might well be located in cities.

Agricultural: Agricultural Warehouses in easy reach of major farms/orchards etc for fast transport before mould sets in!

Industrial: Factory sites

Mining (SW Economy): Storehouses close to the major mines/open pit mines (heavy goods with high transport costs).



References:
*[EliteWiki] Species - has Links
*City structure shapes - Lobstoid,Insect,Feline et al. Lots of ideas
*LitF - station variations - see bottom of post for Species



Sources of individual planet names
Rough Guide to the Universe (on wiki)
Galactic Catalogue Entries (Goat soup!)
Famous Planets OXP (mostly G1 & G2)
The Assassins Guild OXP (G7)
Iron Raven OXP (G8)
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2862
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Re: Galactic Almanac OXZ - Full Version 0.92 - Now on the Expansion Pack Manager (Updated 12.08.23)

Post by LittleBear »

The assignment of different types of landing sites is done by Planetfall itself. Some types of landing sites can only appear on the capital planet, others only on OXZ moons or planets and some can only appear at particular tech levels or government types. The Almanac's code just reads to see if the station (as the landing sites are stations in code) has one of the one of the roles for the types of landing site in planetfall. The Almanac's code generates names from different look-up tables in the descriptions file by reading the role for the type of landing site. So military bases have military style names, farms have rustic names and so on. If you want the almanac to add a name then you can add the role with zero probability to the shipdata entry for the planetfall 2 version. For example if you wanted it to be named in the Leisure Centre style, giving it the role planetFall_mainSurface_leisureComplex would cause it to be detected and named in the Leisure Centre style. If it doesn't have a role in the list below, then it wouldn't be named by the Almanac, although you could add a custom pool of names to planetfall 2 and read off from that list. You'd only need to do that for new types of landing types as all the existing ones would be named by the Almanac.

Code: Select all

// Planet Fall Landing Sites. As there are a lot of these they are bracketed off from the main station naming script with the common role check.
if(ship.hasRole("planetFall_surface")) {
// Set Up the Display Names for Planetfall OXP Landing Points..
// PlanetFall simulates a Landing by Spawning an invisible docking slit very close to the planet / moon's surface.
// The code below detects which type of Landing Site the player has landed at and gives it an appropriate name.
// The Landing Sites generated by Planet Fall are random each time the player lands, so a check for constancy is not needed (as the landing sites are not persistent anyway).
// For this type of 'station' only therefore, names are generated on the fly directly from the Descriptions File, but with a different style for each of PlanetFalls Landing sites.
// Capital Cities
if(ship.hasRole("planetFall_mainSurface_capitalCity")) ship.displayName = ""+expandDescription("[named_stations_planetFall_mainSurface_capitalCity_name]");
// Shipyards - Main Planet Version 
if(ship.hasRole("planetFall_mainSurface_shipYard")) ship.displayName = ""+expandDescription("[named_stations_planetFall_mainSurface_shipYard_name]");
// Shipyards - OXP Planet Version
if(ship.hasRole("planetFall_subSurface_shipYard")) ship.displayName = ""+expandDescription("[named_stations_planetFall_subSurface_shipYard_name]");
// Military Bases - Main Planet Version
if(ship.hasRole("planetFall_mainSurface_militaryBase")) ship.displayName = ""+expandDescription("[named_stations_planetFall_mainSurface_militaryBase_name]");
// Military Bases - OXP Planet Version 
if(ship.hasRole("planetFall_subSurface_militaryBase")) ship.displayName = ""+expandDescription("[named_stations_planetFall_subSurface_militaryBase_name]");
// Surface Based Royal Hunting Lodges (only added to the Main Planet in Feudal Systems with a Tech Level of 7+ and only if Feudal States and Planetfall are installed)
if(ship.hasRole("planetFall_mainSurface_FSRoyalCourt")) ship.displayName = ""+expandDescription("[named_stations_planetFall_mainSurface_FSRoyalCourt_name]");
// Surface Based Black Monk Stations. These can only appear if you have all three of Black Monks, Planet Fall and the Black Monks Add On to PlanetFall installed.
// PlanetFall rolls its own dice from all the templates it uses, so even if you meet the installed OXP requirements, there is only a 1 in 20 to 1 in 25 chance that you
// land at a Surface Based Black Monk Station. Ground based Monk Stations are however named in a different style and from a different pool to Orbital Monk Stations.
// If both an orbital and ground based Monk Station are present in the same system they do therefore always have different names in different styles.
if(ship.hasRole("planetFall_mainSurface_blackMonks")) ship.displayName = ""+expandDescription("[planetFall_Surface_blackMonks_name]");
if(ship.hasRole("planetFall_subSurface_blackMonks")) ship.displayName = ""+expandDescription("[planetFall_Surface_blackMonks_name]");
if(ship.hasRole("planetFall_moonSurface_blackMonks")) ship.displayName = ""+expandDescription("[planetFall_Surface_blackMonks_name]");
// Surface Based HoOpy Casinos. These appear under the same circumstances as Black Monk Surface Stations above and so are handled the same way.
// You must have HoOpy Casino, PlanetFalll and the HoOpy Casino PlanetFall AddOn installed for these Landing Sites to appear.
// As with Black Monks, the ground based Casinos are named from a different pool and in a different style to orbital HoOpy Casinos.
if(ship.hasRole("planetFall_mainSurface_hoopyCasino")) ship.displayName = ""+expandDescription("[planetFall_Surface_hoopy_name]");
if(ship.hasRole("planetFall_subSurface_hoopyCasino")) ship.displayName = ""+expandDescription("[planetFall_Surface_hoopy_name]");
if(ship.hasRole("planetFall_moonSurface_hoopyCasino")) ship.displayName = ""+expandDescription("[planetFall_Surface_hoopy_name]");
// Seedy Space Bars - Main Planet, OXP Planet and Moon Versions 
// Same Method. A different pool of Bar Names though is used for the Main Planet, OXP Planet and Moon Versions.
// Names are selected from a different pool of names to the ones included in Random Hits.
// Ground Based Space Bars always have different names therefore to the Orbital versions.
if(ship.hasRole("planetFall_mainSurface_seedyBar")) this.barName = expandDescription('[named_stations_planetFall_mainSurface_seedyBar_name]');
if(ship.hasRole("planetFall_subSurface_seedyBar")) this.barName = expandDescription('[named_stations_planetFall_mainSurface_seedyBar_name]');
if(ship.hasRole("planetFall_moonSurface_seedyBar")) this.barName = expandDescription('[named_stationsplanetFall_moonSurface_seedyBar_name]');
if(ship.hasRole("planetFall_mainSurface_seedyBar")) ship.displayName = ""+barName;
if(ship.hasRole("planetFall_subSurface_seedyBar")) ship.displayName = ""+barName;
if(ship.hasRole("planetFall_moonSurface_seedyBar")) ship.displayName = ""+barName;
// Leisure Complexes
if(ship.hasRole("planetFall_mainSurface_leisureComplex")) ship.displayName = ""+expandDescription("[named_stations_planetFall_mainSurface_leisureComplex_name]");
if(ship.hasRole("planetFall_subSurface_leisureComplex")) ship.displayName = ""+expandDescription("[named_stations_planetFall_mainSurface_leisureComplex_name]");
if(ship.hasRole("planetFall_moonSurface_leisureDome")) ship.displayName = ""+expandDescription("[named_stations_planetFall_mainSurface_leisureComplex_name]");
// Factories 
if(ship.hasRole("planetFall_mainSurface_factory")) ship.displayName = ""+expandDescription("[named_stations_planetFall_mainSurface_factory_name]");
if(ship.hasRole("planetFall_subSurface_factory")) ship.displayName = ""+expandDescription("[named_stations_planetFall_mainSurface_factory_name]");
// Farms
if(ship.hasRole("planetFall_mainSurface_farm")) ship.displayName = ""+expandDescription("[named_stations_planetFall_mainSurface_farm_name]");
if(ship.hasRole("planetFall_subSurface_farm")) ship.displayName = ""+expandDescription("[named_stations_planetFall_mainSurface_farm_name]");
// Fields
if(ship.hasRole("planetFall_mainSurface_fields")) ship.displayName = ""+expandDescription("[named_stations_planetFall_mainSurface_fields_name]");
if(ship.hasRole("planetFall_subSurface_fields")) ship.displayName = ""+expandDescription("[named_stations_planetFall_mainSurface_fields_name]");
// Rubbish Dumps
if(ship.hasRole("planetFall_subSurface_dump")) ship.displayName = ""+expandDescription("[named_stations_planetFall_subSurface_dump_name]");
if(ship.hasRole("planetFall_subSurface_dump")) ship.displayName = ""+expandDescription("[named_stations_planetFall_subSurface_dump_name]");
// OO-Haul Distribution Centre
if(ship.hasRole("planetFall_mainSurface_oohaul")) ship.displayName = ""+expandDescription("[named_stations_planetFall_mainSurface_oohaul_name]");
// Colonies
if(ship.hasRole("planetFall_subSurface_colony")) ship.displayName = ""+expandDescription("[named_stations_planetFall_subSurface_colony_name]");
// Luna Domes.
if(ship.hasRole("planetFall_moonSurface_dome")) ship.displayName = ""+expandDescription("[named_stations_planetFall_moonSurface_dome_name]");
// Luna Mines 
if(ship.hasRole("planetFall_moonSurface_mine")) ship.displayName = ""+expandDescription("[named_stations_planetFall_moonSurface_mine_name]");
// Luna Prisons
if(ship.hasRole("planetFall_moonSurface_prison")) ship.displayName = ""+expandDescription("[named_stations_planetFall_moonSurface_prison_name]");
// Luna Research Complexs
if(ship.hasRole("planetFall_moonSurface_researchComplex")) ship.displayName = ""+expandDescription("[named_stations_planetFall_moonSurface_researchComplex_name]");
// Luna Robot Factories
if(ship.hasRole("planetFall_moonSurface_factory")) ship.displayName = ""+expandDescription("[named_stations_planetFall_moonSurface_factory_name]");
// Luna Wastland
if(ship.hasRole("planetFall_moonSurface_wasteLand")) ship.displayName = ""+expandDescription("[named_stations_planetFall_moonSurface_wasteLand_name]");
// Closing sub-bracket for Planetfall Landing Sites.
}
Edit: As Thargoids original gives a lot of different types of landing site, you could script the appearance of landing types, for example more fields on agricultural world more Luna Prisons in dictatorships etc. You could then attach a script to your version of the landing site so that commodity prices may be different for different types of landing sites. The planet fall script is set up to let you create a clone of a landing side template and then if you like add scripts to it to make it more like it's description.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
Post Reply