Tried that. Latest Log is not reporting any errors in my script and the black monk station is being spawned as latest log is showing
But no name added to station.
I'm pretty sure its the role check that's wrong as it must be returning false otherwise the station would have been named. But I'm stumped as to whats wrong with it.
If anyone fancies given this a test, I've put the code for the whole script file below. The OXP is just the script file so if you c&p it and put it in a Script Folder it'll run as it is currently running for me.
To keep the length of this post down, only Galaxy 1 main stations will be named if you run the script below (but I know that bit works). It should also name all black monk stations in all galaxys. But that's where I;m stuck.
Code: Select all
use strict";
this.name = "RandomStationNames";
this.author = "LittleBear";
this.copyright = "2021 LittleBear";
this.description = "World Script for Random Station Names OXP";
this.version = "1.00";
this.licence = "CC BY-NC-SA 4.0";
// Version 1.0. Released XX January 2021.
// On Start Up name the Main Station for the system the player is in.
// Also name any OXP stations present.
this.startUpComplete = function ()
{
this.$renameMainStation(); // Names all the Main Stations in the game.
this.$renameMonkStations(); // If Black Monks is installed and the player is in a system where a Black Monk station is then the Station is named. If not then the function does nothing.
}
// On making a hyperspace or galatic hyperspace jump name the Main Station for the System the player has just entered.
// Also name any OXP stations present.
this.shipExitedWitchspace = function ()
{
this.$renameMainStation();
this.$renameMonkStations(); // If Black Monks is installed and the player is in a system where a Black Monk station is then the Station is named. If not then the function does nothing.
}
// All stations except the Main Station are classified as 'ships', If the player has no OXP stations installed then none of the OXP station naming functions are run.
// Each type of OXP station is checked to see if it is present. If it is then it is given a name from the array associated with that station.
// So if Black Monks is installed (for example) and the player is in a system where a Black Monk Station is present it will be assigned a name from the array called "monkpool".
// All OXP stations are checked for (as of the release date).
// For OXPs released after the Random Station Names OXP, the Random Station names OXP can name your station if you would like it to.
// The last entry checks for any station which includes as a role "random_station_names_name_this_station".
// If you include that role in your list of roles in the Shipdata file for your station, then it will be named by Random Station Names from the array called "generalpool".
// If however your OXP Station is not on the list of specific stations and you don't include the role "random_station_names_name_this_station" in your shipdata.plist then Random Station Names will not name it.
// Whenever an OXP station is spawned name it.
this.shipSpawned = function(ship)
{
if(ship.hasRole === "blackmonk_monastery") ship.displayName = ship.name+""+monkpool[system.ID&255];
}
this.$renameMainStation = function $renameMainStation ()
{
// This Function names all the 2,048 Main Stations in the game using the Array called main. (Number of Names in Array: 2,048)
// The array is read by System Number, which is advanced by 256 per Galaxy so that all the names are used without repetition..
// The names are all stored in one array, but enties 1 to 256 are used for Galaxy 1, 257 to 512 for Galaxy 2 and so on.
// Only the name for the main station of the system the player is currently in is loaded, so only a few K of memory is actually used.
var main = ["Hand of Glory", "Technological Magic", "Petrified Cockatrice", "Bear Market", "Vestigial Flame", "Code of Honour", "Fire Storm", "Avalonia Avenged", "Arc of Descent", "Rough Diamond", "Unbreakable Oath", "Wild Rosemary", "The Mad Hatter", "Surfing Bird", "Pit Viper", "Scales of Justice", "Balance of Power", "Knight's Bridge", "Eye of Newt", "Smoke Weaver", "Arsenal of Freedom", "Symbiotic Relationship", "The Qin Shi Hyang", "Shades of Gray", "Vailed Shadow", "Rags to Riches", "Future Tense", "Cunning Plan", "Displacement Tactic", "Primeval Moonlight", "Proving Ground", "Ultimate Finesse","Scarborough Fair", "State of Flux", "Lore Master", "Justice for All", "Halls of Valhalla", "Notre Dame", "Matter of Perspective", "Vogon Poetry", "Wind Walker", "Sacred Flame", "Prime Factor", "The Hasan Ibn Ali", "Obsidian Order", "Rule of Law", "The Red Baron", "Riddling Sphinx", "Timely Intervention", "Fareie Fire", "Gnostic Ascension", "Slanted Moonbeam", "Pale Nova", "Sleep of the Just'", "Bearded Devil", "Sitting Duck", "Dark Mantle", "The Kublai Khan", "Dutch Auction", "Quality of Life" , "Last Laugh", "Rallying Call", "Alcyonia Lacus", "Old Faithful","Light Bringer", "Pillars of Creation", "Just In Time", "Silver Blaze", "Angular Momentum", "Spoils of War", "Sweet Sorrow", "Star Fox", "Galactica Actual", "Twinkling Star", "Sacred Ground", "Alter Ego", "Voodoo Child", "Human Nature", "Rolling Thunder", "Worst Case Scenario", "Silver Cocoon", "Rising Storm ", "Random Thoughts", "Better than Life", "Mortal Coil", "Eleventh Hour", "The Nelson Mandela", "Deadly Poet", "Social Inertia", "Zodiacal Light ", "Pale Captain", "Waking Moments", "Absolution Day", "Ghost of Winter", "Star Shepheard", "Veiled Lady","Galactic Prince", "Queen of Shadows", "Fiscal Policy", "Out of Time", "Anger Management", "Infinite Regress", "Phaseolus Lunatus", "Latent Image", "Farewell to Arms", "Dark Nebula", "Truculent Tachyon", "Morning Star", "The Grigori Rasputin", "Soul of Discretion", "Shades of Morality", "Gregarious Gecko", "Fair Haven", "Waxing Power", "Consumer Confidence", "Incandescent Aurora", "Standing Vigil", "Sympathetic Devil", "Welsh Dragon", "Natural Law", "Nine Dancers", "Deadly Goat", "Emperor of Dust", "Travelling Hopefully", "Danse Macabre", "Beyond a Joke", "Flawed Logic", "Terran Goddess","Equitable Exchange", "Nostalgia for Infinity", "Trojan Horse", "Cooler King", "Dramatis Personae", "Promised Land", "Kindness of Strangers", "Rules of Acquisition", "Wakeful Dormouse", "Reluctant Dragon ", "Eternal Sceptic", "Tranquillity Base", "Oracle of Delphi", "Loss Adjuster", "Second Sight", "Snickering Hyena", "Golden Comet", "Total Perspective", "Small Mercies", "Dark Moon", "Return to Grace", "Cultured Jester", "Babylon Rising", "Dawn of Time", "Android Mother", "Force of Nature", "Quick Thinking", "Avenging Hellfire", "Quantum of Eden", "Eye of the Beholder", "Scorpion Departing", "Break from Reality","First Strike Policy", "Perfect Sphere", "Glint of Laser Light", "Paradise Lost", "All Good Things", "Band of Gold", "Unvarnished Truth", "Lone Star", "Business as Usual", "Call to Arms", "Furious Purpose", "Stone Medusa", "Utopia Reclaimed", "Corporate Subterfuge", "Cunning Plan", "Hidden Funds", "Black Rain", "Highland Mist", "Rings of Saturn", "Angel of Islington", "The Alex Ryder", "Transfigured Night", "Virtuous Vulture", "Crimson Quasar", "Statistical Probability", "Errand of Mercy", "The Kofi Annan", "Blue Giant", "Eye of Jupiter", "Ascent of Man", "Troubadour in Impiety", "Change of Heart","Merchant of Venice", "General Relativity", "Shadow of Doubt", "Sea of Tranquillity", "Blue Moon", "Taj Mahal", "Pale Moonlight", "Handsome Devil", "Troublesome Truth", "Field of Fire", "Mercurial Jewel", "Jealous God", "Trick or Treat", "Forgotten Glory", "Honoured Dead", "Wolf in the Fold", "Tapestry of Fate", "Motionless Marionette", "Jack of the Lantern", "Red October", "Hopeless Romantic", "Gentleman's Agreement", "Piece of the Action", "Mischief Night", "Handful of Stardust", "Awkward Moment", "Wink of an Eye", "Doppler Effect", "Azure Star", "Puff Adder", "Undying Hope", "Weeping Angel","Drowned God", "Edible Goat", "The John Christopher", "Iron Curtain", "Risen Sun", "The Joseph Brant", "Reformed Devil", "Silent Running", "Disposable Income", "The Drew Wagar", "Beyond the Pale", "Fractured Sanity", "Earth Mother", "Iron Lady", "Forbidden City", "Darting Viper", "Garden of Bones", "Dark Queen", "Prudent King", "Coiled Cobra", "Baron Greenback", "Soaring Condor", "Frontier Justice", "The Red Baron", "Argent Moon", "Magnum Opus", "Mind Flayer", "Summer Rain", "Occam's Razor", "Thin Ice", "The Harry Houdini", "Serpentine Queen",
// The Name below is unused but is included for De-Bugging purposes (See the Readme File for Details).
"Sanity Check"];
// Code to read the main array and add the names to all Main Stations.
var ms = system.mainStation; // Checks that a Main Station is actually present. The only time it wouldn't be is on a mis-jump where the player is in Intersteller Space.
if (!ms || !ms.isValid) return; // If there is no Main Station present then don't run the function.
// Checks for Galaxy so the correct part of the array to name the stations in that Galaxy is read.
if (galaxyNumber === 0) var mainGrid = Math.floor(system.ID+0);
// Names the Main Station with the name for that station contained in the array.
// Numbering for system.ID starts at 0 so the last name in the array is number 2047 rather than 2048.
ms.shipUniqueName = ms.shipUniqueName+""+main[mainGrid&2047];
}
this.$renameMonkStations = function $renameMonkStations ()
{
// This Function sets up the array for naming all the Black Monk Stations in the game, using the Array called monkpool. (Number of Names in Array: 256 )
// For Stations such as Black Monks which are Galaxy wide but only appear at certain systems it is simpler to just use a pool of 256 names as then every Black station in the 8 Galaxies is assigned a consitent name from the pool.
// Doing it this way means I only have to check for the station being present in the system rather than having to work out where they all are and have a load of conditions to test which system of the 2048 the player is in.
// Except for Stations added by the Extra Stations for Extra Planets OXP (due to the huge number of these a different method is used) all the OXP stations are named with the same method, but each type of station is named from a different pool.
var monkpool = ["Clerical Mace", "Tome of Debt", "Debtor's Rosary", "Joy of Debt", "Purity of Poverty", "Piety of Penury", "Flail of Repayment", "Abbot of Avarice", "Exorcism of Solvency", "Negative Equity", "Tome of Armaments", "Pontiff of Destitution", "Cardinal of Credit", "Rector of Repayment", "Verger of Vengeance", "Altar of Accounting", "Patriarch of Poverty", "Prayer for Solvency", "Defaulter's Pyre", "Credit Control", "Cowl of Receivership", "Sin of Liquidity", "Abbot of Accounting", "Deacon of Piety", "Tabard of Debt", "Sacrament of Mammon", "Pound of Flesh", "Bankrupt Bishop", "Blessedly Insolvent", "State of Debt", "Bliss of Bankruptcy", "Compound Interest",
"Day of Reckoning", "Nave of Receivership", "Sacrament of Debt", "Chapple of Affluence", "Indebted Sinner", "Papal Currency", "Abbot of Austerity", "Repayment or Revenge", "Curse of Liquidity", "Temptation of Solvency", "In Debt We Trust", "Austere Fellowship", "Matriarch of Insolvency", "Psalm of Debt", "Chant of Mammon", "Repenting Sinner", "Vow of Poverty", "Lamb of Loans", "Defaulter's Bane", "Patriarch of Loans", "Mace of Repentance", "Cleric of Currency", "Sin of Equity", "Mortgage of Mammon", "Monastic Inquisition", "Reaper of Sin", "Missionary of Lending", "Curate of Credit", "Vicar of Vengeance", "Reverent of Revenge", "Monetary Miracle", "Manifestation of Mammon",
"Graven Image", "Bankrupt Matriarch", "Tome of Liquidation", "Chosen of Mammon", "Joyous Bankruptcy", "Sanctity of Capital", "Adept of Insolvency", "Hymn of Debt", "Temple of Insolvency", "Cathedral of Mammon", "Righteous Repayment", "Sin of Solvency", "Accountant of Woe", "Pope of Penury", "Destitute Debtor", "Repentance for Repayment", "Stocks of Debt", "Defaulter's Penance", "Sack Cloth", "Missionary of Debt", "Mass for Insolvency", "Papal Blessing", "Gospel of Mammon", "Pawnbroker's Bible", "Pain of Solvency", "Crusade for Currency", "Prayer of Destitution", "Fellowship of Penury", "Communion of Debt", "Bible of Avarice", "Incarnation of Insolvency", "Minister of Poverty",
"Sinner's Lamentation", "Repentance for Solvency", "Joy of Servitude", "Vow of Repayment", "Crusader of Mammon", "Monastic Moneylender", "Cathedral of Credit", "Vestments of Bankruptcy", "Scythe of Default", "Mace of Mammon", "Purification of Sin", "Saviour of Solvency", "Hymn of Vengeance", "Nave of Bankruptcy", "Temple of Ruin", "Avenger of Default", "Communion of Mammon", "Cathedral of Debt", "Scourge of Default", "Flail of Sin", "Cleric of Credit", "Mace of Vengeance", "Cassock of Insolvency", "Monastic Communion ", "Abbot of Ruin", "Crusading Bishop", "Chant of Mammon", "Gospel of Debt", "Vestments of Vengeance", "Bliss of Insolvency", "Purge of Default", "Debtor's Prayer",
"Impecunious Pontiff", "Lash of Default", "Rapture of Debt", "Vengeful Pope", "Vicar of Woe", "Monastic Accounting", "Vestments of Repossession", "Puritanical Avenger", "Joyous Repayment", "Blessed Servitude", "Curate of Capital", "Altar of Mammon", "Clerical Coffers", "Bible of Vengeance", "Destitute Sinner", "Monastic Avenger", "Bejewelled Bishop", "Nave of Servitude", "Indentured Debtor", "Collection Plate", "Monetarised Fealty", "Cowl of Mammon", "Purge of Sin", "Sacrament of Repayment", "Miracle of Foreclosure", "Merciless Pursuit", "Pitiless Pope", "Prayer of Foreclosure", "Papal Coffer", "Affluent Abbott", "Nave of Avarice", "Fellowship of Debt",
"Temple of Woe", "Debt Collector", "Beatific Bailiff ", "Avenging Vicar", "Cathedral of Avarice", "Austere Matriarch", "Monastic Capital", "Vow of Poverty", "Crusading Patriarch", "Altar of Bankruptcy", "Tome of Debt", "Robe of Revenge", "Crooke of Collection", "Psalm of Mammon", "Avenging Verger", "Hymn of Pain", "Miraculous Repossession", "Credit Reaper", "Direct Debit", "Cathedral of Servitude", "Monastic Foreclosure", "Puritanical Curate", "Vestments of Piety", "Habit of Pain", "Robe of Mammon", "Lamb of Debt", "Worship of Avarice", "Nave of Piety", "Curse of Solvency", "Avaricious Avenger", "Temple of Ruin", "Robe of Insolvency",
"Deacon of Doom", "Molly’s Wimple", "Spanish Inquisition", "Cowl of Vengeance", "Cassock of Penury", "Financial Inquisitor", "Agony of Default", "Nave of Destitution", "Flail of Finance", "Hymn of Repossession", "Cowl of Austerity", "Financial Audit", "Chant of Debt", "Cassock of Servitude", "Cassock of Credit", "Tome of Default", "Chant of Foreclosure", "Crusading Curate", "Temple of Temptation", "Goblet of Mammon", "Habit of Repentance", "Sacrament of Bankruptcy", "Reaper's Cowl", "Cassock of Finance", "Fiscal Review", "Purging Day", "Tabard of Woe", "Rector of Revenge", "Deacon of Debt", "Scythe of Piety", "Gospel of Finance", "Robe of Penury",
"Beatific Bishop", "Rapturous Debtor", "Sanctity of Repayment", "Penniless Friar", "Curate of Servitude", "Destitute Deacon", "Austere Friar", "Archbishop of Austerity", "Repentant Sinner", "Pyre of Agony", "Vestments of Poverty", "Fearsome Friar", "Venomous Vicar", "Chaotic Cleric", "Psalm of Repentance", "Vicious Verger", "Habit of Penury", "Mendacious Missionary", "Curate of Cruelty", "Liquidator's Cowl", "Cassock of Receivership", "Tabard of Lending", "Blessed Bailiff", "Sacrament of Receivership", "Robe of Repentance", "Fiscal Missionary", "Hymn of Finance", "Archbishop of Receivership", "Affluent Avenger", "Merciless Missionary", "Dastardly Deacon", "Pope of Piety",
// The Name below is unused but is included for De-Bugging purposes (See the Readme File for Details).
"Sanity Check"];
}
// End of File.
// Version 1.0 Released XX/01/21.