Hints OXZ (Development Thread)

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

Moderators: another_commander, winston

User avatar
Cholmondely
Archivist
Archivist
Posts: 6545
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Education

Post by Cholmondely »

So, I'm a blithering idiot. Wrong titles for GNN.js script and for the descriptions.plist

Bar chatter seems to work fine now. But nothing on the GNN front.

The script loads and that's it. No error messages. None of the debug notices show in the latest.log

Code: Select all

"use strict";
this.name = "Hints_GNN.js";
this.author = "Cholmondely";
this.copyright = "(C) 2022 Littlebear & Phkb";
this.licence = "CC-NC-by-SA 4.0";
this.description = "Code by LittleBear and then Phkb.";
this.version = "0.9.4";

this.education_last = 0; // holds which news item was last published
this.education_max = 9; // hold the maximum number of news items available

this.startUpComplete = function() {
    // check save game for our education_last variable, and read it back in if found
    if (missionVariables.education_last) {
        this.education_last = parseInt(missionVariables.education_last);
    log(this.name, "got here1");
    }
}

this.playerWillSaveGame = function() {
    // make sure our education variable is saved
    missionVariables.education_last = this.education_last;
}

this.shipExitedWitchspace = function() {
    // if we've reach the maximum number of messages, we're done.
    if (this.education_last == this.education_max) return;

    // this is where you'd set up rules to govern how often news items are sent.
    // for the purposes of this exercise, we'll just make it random (1% chance)
    if (Math.random() < 0.01) { 
        var news = new Object;
        news.ID = this.name;
        // get the appropriate news item, based on the education_last variable.
        news.Message = expandDescription("[education_news_" + this.education_last + "]");
        news.Agency = 2;
        news.Priority = 1;
        this.passScreen(news, 1);
        log(this.name, "got here2");
    }
}

// i'm going to assume LittleBear's code here works
this.passScreen = function (news, mode) {
    var a = worldScripts.GNN._insertNews(news);
        log(this.name, "got here3");
    if (!a) {
        if (mode) this.education_last += 1; // If GNN conforms sucess, advance the News Counting variable to the next Broadcast.
        return;
    } else {
        if (a < 0) { // If the buffer was full then the mission variable counting the News Broadcasts wasn't advanced. Once the player has made the required number of jumps Random Station names will check again.
            return;
        }
    }
}

/*

// copy and paste everything between these markers ****** (but not the markers themselves) into descriptions.plist

******
    //• Interview of Chap reaching Elite status and giving manouever he used
    "education_news_1" = "Usge Ceanal has just attained Elite status according to a press release from the Elite Federation. In an interview, Ceanal said that he was an advocate of the Barkanion Bounce (named after the renowned Lave Academician) - swirling in loops towards his opposition whilst varying his speed. This tactic enables a trouble-free approach to one’s targets, and accounted for many hundreds of his kills.";

    //• Rock hermit destroyed in anarchy (a Pirate Cove)
    "education_news_2" = "A pirate-infested Rock Hermit has just been destroyed by a police viper-squad in the rodent-ridden anarchy of Riedquat. A centre for the local slave and narcotics trade, it has finally been shut down, allowing much safer travel in the Old Worlds sector! “The pirate plague has finally been eliminated” claimed the courageous Commander Reed Spar of GalCop, \"the Old Worlds are now as safe as a parentally-patrolled paddling pool!\"";

    //• Pirates nab chap on milk run Ensoreus-Ararus Furs-Computers: turns out to be a millionaire
    "education_news_3" = "Reports are just coming in about Orit Ceedthse, an Ensorean trader was murdered at Ararus yesterday by marauding pirates. It turns out that the feline was phenomenally rich, due to trading in furs and computers between Ensoreus and Ararus. Was she killed for her cargo, her money or for more murky misdemeanours? Truth is, we don’t know!";

    //• Quirium Cascade mishap
    "education_news_4" = "A quirium cascade bomb has been detonated at Qubeen. It caught some 27 ships and a rock hermit as well as the launcher of the bomb, a rodent from nearby Maesin. Inquiries are ongoing into the exact cause of the incident. GalCop is offering handsome rewards for relevant information.";"

    //• Flavour text
    "education_news_5" = "Murgh the Munificent, the Metropolitan of Maduro, in the Middle Oceans of Aronar, has been promoted to be the Sectoral Sacerdote for the Church of Giles the Creator. A devotee of fine wines, he is rumoured to have crepuscular connections in the ship-building industry as well as having links to the \"Cuban Cohort\", a mysterious group of musical mayhem-makers. He has for some time been threatening to lead a crusade against the Witchspace Lobster Worshippers. Watch this space!";

    //•Contracts
    "education_news_9" = "Arquebus the Audacious, the master trader, has finally come a cropper! After years of amassing a fortune trading in furs and computers, he took a time-sensitive contract to deliver wodgets to Ceesxe. Forgetting that fewer long jumps take much more time than many more smaller jumps, he arrived several days too late - and lost well over thirty thousand credits as a result! He is rumoured to have sold his ship in disgust and retired to a life of farming trumbles!";

    //• Flavour text
    "education_news_7" = "Archimandrite Ph'i Ku'ub of the Digebitian antipodes has just published a new commentary on the treatise on Theological Arithmetics by Saint Phibo Nacci. Combined with his earlier analysis of the mystical fourth codicil of the Codex of Giles the Creator, Ph'i Ku'ub claims to prove that the ooniverse was designed through random purposefulness, and show the numerical underpinnings of all that exists. Copies of his masterpiece have been selling like hotcakes! But does anybody actually understand it? Truth is, we don't know - and neither does anyone else!";

    //• Cim's changes to safe systems
    "education_news_8" = "Pirates travelling from their home system to raid another are becoming more of a threat. On the one hand, Police vipers at Diso have fought off another incursion of some several dozen pirates from the local anarchies, Uszaa and Reidquat. The President of Diso has appealed to GalCop for more help in stabilising the local region. On the other hand, Ensoreus has been raided by ravenous hordes from Ararus, Zaalela and Xeesle.";

    //• Pirates have ECM
    "education_news_6" = "The number of pirates armed with Electronic Counter Measures is increasing. Arch-Chandler RedSpear of GalCop's weapons research laboratory at Ceesxe has confirmed that more and more pirates are now using ECM in combat: "Do not fire missiles at pirates grouped in clusters of four or more, or you will waste them. At least one of them will be able to destroy your missiles" he told our reporters this morning.";
******
*/

Edited to add
:

The above is not quite accurate. I finally got a broadcast - but as [education_news_0] - it was at my 10th or greater station visit!

latest.log (showing all mentions of Hints):

Code: Select all

    ~/Library/Application Support/Oolite/AddOns/oolite.oxp.cholmondely.Hints.0.094 everything.oxp
    Hints_GNN.js 0.9.4
    Hints_Station_Bar.js 0.0.94
13:13:24.053 [script.javaScript.warning.ooliteDefined] ReportJSError (OOJavaScriptEngine.m:204): ----- JavaScript warning (Hints_GNN.js 0.9.4): Unknown expansion key [education_news_0] in string.
13:13:24.054 [Hints_GNN.js] GlobalLog (OOJSGlobal.m:266): got here3
13:13:24.054 [Hints_GNN.js] GlobalLog (OOJSGlobal.m:266): got here2
descriptions.plist

Code: Select all

{
// This stuff is mostly Cholmondely's, chunks from Redspear, Cody & Avder, singular snippets from Hiran, Switeck, & the mighty Murgh


//Vanilla game advice
"hints_bar_gossip" = 	(
	//Trade	
	"Bulbous batrachian in flight-suit: 'So what did you do after you graduated from Lave?' 
	\n\n{color:redColor} 
	Orange avian with spectacles and cap: 'Well I found a really good milk-run, Isinor to Qutiri. Both full of water - Isinor is liquid, Qutiri is solid. I made so much money I was able to buy up military lasers for both front and rear.' ",
	"'Ensoreus to Ararus is a top notch milk run!' \n\n{color:redColor} 'No, no, Xexedi to Laenin is better - Laenin is much safer than Ararus.",

	"Burly black feline speaking to a young tailed humanoid: 'Flying a cobra? Well, the Cargo Bay Expansion will help you almost double your profits! Just make sure you save up enough money both to buy it - and to fill it once you have bought it!' ",
	
	"You can get some really good deals at Rock Hermits if you can find them. The real mining hermits sell radioactives, minerals, gold, platinum and gems at super discounts. They don’t buy much - just food and drink and occasional bits of machinery, but if you can load up on cheap platinum, you can then offload it later in much better markets.",
	"Buying fuel and equipment at Rock Hermits is jolly expensive - d’ye know they charge three times the going rate?",
	
	"There is just one problem with using docking computers. They can add up to twenty minutes to docking. Usually it doesn't matter, but if you are running a contract, it might just sink you.",
	"I've never really found that those passenger contracts pay all that much. They give you a nice excuse to travel, but cargo contracts usually end up paying much better",
	"Short woman bedecked in sparkling jewellery speaking to a large yellow rodent: 'I got rich doing parcel couriers and adding in the fur-computer swap between rich industrial and poor ag's on the way. One tip though, make sure you have fuel injectors added on, and also use the shortest route mode on the chart to help you plan your route. The reason for that being, ideally, you want at least a third a tank of fuel whenever you jump to a new system in case of an over-the-top ambush. If you do multiple contracts at once you will soon see what I mean.' ",


	"'Have you heard? That Cody chap got paid well over seventy thousand credits for delivering a parcel contract over in Galaxy Seven?' \n\n{color:redColor} 'Yes, but a third of that was a bonus for early fulfilment' \n\n{color:yellowColor} 'It's still a lot of moolah for a small parcel' \n\n{color:redColor} 'But he will have spent years developing the reputation to get those sorts of contracts'",
	"So I took one of those contracted deliveries. Lots of dosh for a long way to go. Blow me if the maintenance bills didn't take almost every penny I'd made... And if I had the maintenance done en-route - which would have been cheaper - I'd have fluffed the contract",
	"If you're flying contracts, time is of the essence. You do know that lots of short hops take less time than the long hops, don't you? Just make sure that your maintenance is up-to-date before you do too many hops though!",

//Equipment
	"The very first thing I did when I got my new Cobra was shift the laser. I moved it from the front to the back. I'm useless at combat, and at least that way I can take pot shots at the pirates while I'm fleeing them.",
	"Large blue insect at a table of other insects: 'Fuel. That stuff's so cheap that even when they're charging triple it's a bargain. Most folks know that it powers their injectors and limits their trade routes but it's also your ticket to get the hell out of trouble. Always a good idea to prep an escape route. Short jumps if you can. It's what you've got left in the tank, not left in the bank that will save you when you're out there.' ",
	"Did you know you can hitch a ride through someone else's wormhole? Gives you much more options when you arrive... Of course, given that you might not know where the hell that is until you get there you might want to use one of them pretty quick too.",
	"If you are going to get maintenance done, go to the highest TL system in the area - the maintenance will last much longer - and does not cost a penny more!",
	"Old Johnny never made it to Zaonce. He left at Lave sure enough but at Zaonce witch-point beacon, no sign of him... Some say it's the (lowers voice) 'Thargoids', say they can pull you right out of witchspace, or into witchspace depending on your point of view... Johnny never was one for keeping his ship maintenance up to date though, or for staying focused once he started a jump sequence...",
	"So when I found my milk-run and started earning serious money, I started spending on my ship. What did I buy? Well, the first most crucial pieces of equipment are either fuel injectors - for avoiding trouble - or an enlarged cargo hold for earning more dosh. Your choice as to which makes more sense.",
	"Bearded chap with a red spear logo on his jump suit: 'Oh sure, injectors are cool and all, a good investment for sure but they wouldn't be my first choice... See, when you've only got one piece of fancy-pantsy equipment on your boat then there's only one thing that's gonna get damaged, right? Repairing it is a good deal cheaper than buying a new one but you might end up wishing you'd invested in something a little more reliable... especially as it's useless when you're out of gas. My choice? A beam laser. Very reliable, a huge upgrade from the pulse and tough as old space boots. I've yet to hear of one breaking down... Just watch your fire kid, that thing shoots so fast you can overheat it before you've landed a single hit. But aim first, get a good bead and it'll soon be paying for itself in bounties.' ",
	"The best way to use a military laser is as a one-shot gun. Wait until the hoodlums are in your sights and fire one shot. then do it again... that way you don't overheat the darned thing.",
	"I found that the Extra Energy Unit made a massive difference when I got nobbled by the pirates. The improved recharge of my shields meant I was able to survive and get away with my cargo intact.",
	"Shields are complicated bits of kit. There are two things you can do to improve them - either increase the rate of recharge, or increase their overall strength. Those Extra Energy Unit does one, the Shield Boosters do the other. And the Military Shield Enhancer does both!",
	"Those naval energy units are really good which is why they are worth a fortune. If you're not in cahoots with the navy, the only way to get one usually is to buy a second-hand ship which already has one... and, boy, do they bump the price up!",
	"Red feline speaking to a larger blue one: 'The Multi-Targeting System only makes sense if you set up your targets in advance, before you get into combat. Otherwise it's just a waste of time and money. All it does is allow you set up different targets for your different missiles. How many people are really going to need something like that?' ",
	"It's also a really good idea to get good at combat against multiple targets at once.  Get the shield boosters and extra energy unit. An ECM unit is mandatory. Once you can afford it, you'll want the military shield boosters as well. When you are targeted and you either don't want to or can't run away, get close to them quickly so they furball around you.  As long as you don't fly straight they have a very hard time hitting you.  Only ever fly straight while you are firing your laser, and only fire when you are 100% on target.",


//Pirate Tactics
	"So you got scragged by the pirates again? You never learn, do you? When you arrive at the Witch-point beacon turn ninety degrees or one-eighty degrees and scarper like billy-oh! Get out of there, and head away from the planet. You might meet the odd pirate or bounty hunter in the nastier systems, but there will be more empty space around and you should be able to flee - you do remember how to use your injectors, no? When you're ten seconds or so away, then turn and head towards the station, but not directly. That way you should easily avoid the pug-uglies. No mass-locks. No pirates. And don't cross the space-lane, whatever you do!",
	"I just arrived at the witch-point and found myself surrounded by some half-dozen pirates. I always carry some spare TC’s of food. I whizzed away from them, dropped a half-dozen and then turned 90 degrees and scrammed again. I got away - and had my the rest of my load of furs which I then off-loaded at the orbital for a good profit.",


//Thargoid Tactics
	"'So what's best? Clobber the Thargoids first - or go after the robot thargons?'\n\n{color:redColor} 'Well, it depends... If you are good enough to polish off the 'goids quickly, then the robots deactivate and you can just scoop them up for a profit. If not, they will be reactivated the moment another 'goid gets close. Oh! ...you usually get more dosh for the thargons in agricultural economies'",
	"If you're gonna ram something, probably not a good idea to ram at injector speeds! Whenever my cargo is full and I come across a 'goid warship and end up with a bunch of unpowered fighters, I've found it's fastest to just ram them at full (non-injector) speed to kill them and pick up the 50 credit bounty. Costs like a few units of shield, which are regenerated within moments. If you ram one while at full injector speed you lose your whole shield, and that's with both the shield boosters and the military shield enhancement!",

//Combat Tactics
	"It’s all done with corkscrews. Move towards them in a corkscrew! Especially if you vary your speed, you’ll find that they can’t draw a bead on you and you can get in real close and then marmalise them.  And if you need to scram, and have the speed, corkscrew!",
	"So there I was, surrounded by pirates. I hit the fuel injectors and whizzed over towards the sun. Only a couple of them were fast enough to follow, and the sun blinded them, so I was able to pick them off with my rear laser - I could see them, but they couldn't see me",
	"Members of hit squads also tend to inject away when they get low on energy. Get good at sniping so you can kill them while they are running away. They'll be back in a minute after they've regenerated otherwise. They're cowards who refuse to meet their end with dignity, and it's entertaining to watch them beg for their lives.",
	"Missiles are a waste of time unless you are only facing one or two opponents. The moment you are in a fight with half a dozen pirates, one of them is bound to have an ECM, and your missiles end up being as useful as confetti.",
	"If you fire a missile when you are right up in front of a pirate, he’ll never have a chance to ECM it - just make sure he doesn’t do the same to you!",
	"As far as missiles, it's up to preference. I've found that either the regular or ECM types realistically have a chance of a kill only against pirates. Against the hit squads, you can expect them to have injectors to outrun your missiles as well as an ECM. The only thing missiles are good for against them is to get them off your back for a while.",
	"You could also start with quirium cascade mines, just make sure you don't launch them with vipers in range or you'll end up a fugitive potentially instantly. All your kills are recorded, remember?",
	"For Giles's sake, whatever you do, don't use a Q-bomb unless you have fuel injectors and enough fuel left to scram! Far too many people get caught by their own Quirium bombs!",
	"Those Quirium cascade bombs are most effective when detonated in an asteroid field. They zap the asteroids which then contribute to the effect. If you explode one in a dense enough asteroid field, then the whole shebang will exceed your scanner range and can last over a minute. Just make sure that you don't get caught in it yourself!",
	"'Get lasers on your port and starboard sides. They come in very handy against ships that show you a generous amount of profile while flying next to you like the fer-de-lance, asp, and both types of cobra.' \n\n{color:redColor} 'But how do I use the wretched things?' \n\n{color:yellow}'Just remember that you will be steering up and down with roll instead of pitch while looking to either side of your ship.'",
	"The best way to use a military laser is as a one-shot gun. Wait until the hoodlums are in your sights and fire one shot. then do it again... that way you don't overheat the darned thing.",
	"So there I was, surrounded by pirates on all sides. I took out my Wheel of Destiny, invoked Saint Giles, kissed my Knucklebones of Negation and threw my throttle into full speed. With a slight corkscrew on my trajectory, I escaped. I've always tithed to the Church ever since.",

//Other advice
	"... anyway, as the jump countdown hit one, some nutter in a Ferdie ran right across my bow. I pulled up hard on the 'stick to avoid the bastard... next thing I know, the bloody klaxon's wailing, and I'm in ghastly glowing green interstellar space surrounded by 'goids!",
	"Young frog to older couple: 'So, Uncle Ferdie, tell me about Rock Hermits! Jerry told me that there two things to remember - that they are usually off the beaten path, but that they are usually massive and can be seen from a distance'  \n{color:greenColor}
	Older frog with gold monocle: 'Well, almost every system has at least one if not several. And they differ. Some sit on one of the space lanes, others not. Some are dangerous to approach - surrounded or guarded by pirates, others are just harmless miners.'  \n{color:yellowColor}
	Young frog: 'My chum Switeck told me that you find them by looking for the movement of a distant point-of-light while whizzing around on torus and then you can initially spot them or other large stations'  \n{color:greenColor}
	Older frog with monocle: 'If you see a ship heading away from the space-lane, it's probably en route to a rock hermit.'  \n{color:redColor}
	Older frog with yellow cap: 'Some folk say they have a secret network, and control the black markets.'  \n{color:yellowColor}
	Young frog: 'Those must be the pirate-infested ones then'  \n{color:redColor}
	Older frog with yellow cap: 'I never heard that, but it seems a good guess...' ",

//Flavour text
	"Success in combat needs a lot of preparation. Personally, I meditate every morning and then take a bubblebath. I find that that makes all the difference.",
	"Have you heard that guy's story about parallel universes connected via a nexus? I mean, which intelligent being would believe there is more than eight galaxies. Eight! What a smeghead!",
	"'Looking for advice? Well, folks are gonna tell you all kinds of stuff but most of it's only half-true.'  \n\n{color:redColor} 'I mean half-true is something, right?...'  \n\n{color:yellowColor} 'What I'm trying to say is when you hear that, 'the best thing for so and so is X', or that, 'you really oughta be doing Y', you might just want to remember what I tell 'em...'  \n\n{color:redColor} 'Yeah, well, you know, that's just, like, your opinion, frog'.",
	"Small green avian: 'Oh Dad, I'm so confused!'
	\n\n{color:greenColor}
	Large green avian: 'You just have to decide what kind of a creature you want to grow up to be, Gork; because whoever that creature is, a trader, a bounty hunter, a cargo contractor, a damn pirate or even a hermit... Just follow your path. This is the way things are. You can't change nature.'
	\n\n{color:yellowColor}
	'But change is nature, Dad. The part that we can influence. And it starts when we decide!'
	\n\n{color:greenColor}
	Scratches head: 'Now you're confusing me, son'",
	"Chap in yellow jump suit with tattoos at table of women: 'Ever been to Digebiti? They are utter nuts over there! Into this wacky sport called extreme dominoes - which are bigger than you are. They sit on balconies telling their staff down below to throw these things at each other... You have to see it to believe it!'",
	"Ceesxe is the leading centre for rejuve. I met a frog who was almost five hundred years old... he'd had five doses and looked as good as you or I. They say that it costs a pretty packet, though.",
	"...they say there is some sort of secret naval base around Xeer. Doing research, new ships and weapons, that sort of thing. I bet you some of their kit has to be pretty good...",
	"My daughter picked me up one of those Tionislan masks. I don't see how they can wear them all the time... they are so uncomfortable",
	"Went to the opera last night. All about a black cat who lived in Qutiri yonks ago. Apparently she had to flee for the hills as all the others were turning themselves yellow! But stuck out like a sore thumb as she was black and the ice and snow were not. The tenor was top-notch...",
	"When I visited Zarece, I was pottering around in one of the markets in a cloud city looking at some pots and minding my own business, when all of a sudden there was a riot! A bunch of lobsters hurtled past with an entire horde of rather fierce felines chasing after them. A lot of screeching, shouting and yelling. Most unseemly!",
	"A decent cup of tea. That's all you need to really succeed at docking. Either a really good Fragrant Broken Orange Pekoe - or a decent tarry Lapsang Souchong.",
	"This beer is utter bilge. I could do with a decent glass of wine. A Rexebian Richebourg or a Gequrian Cannubi.",
	"Smallish green bespectacled rodent at a table of frogs: 'So, I've been reading Saint Phibo Nacci's book on Theological Arithmetics. Have you ever looked at it? It is quite something. There is an entire section analysing the colours of the loincloths of the demons who clobbered Ebortsa! Somehow it ties in with the underlying structure of the galaxy. But don't ask me how!' ",
	"The 'music' is so loud that you can't even hear yourself think, nevermind hear what anybody else has to say!",
	"You are evicted from the bar for not wearing a cravat",
);

"hints_bar_commies" = 
	(
	"SLAPU's have jolly good prices if you want to buy computers, CZGF's have the same for machinery",
	);
	
"hints_bar_dsd" = 
	(
	"I made a fortune selling food and liquors to one of those Deep Space Dredgers.",
	"Alloys are really cheap at Deep Space Dredgers - you can make an excellent profit selling them at agriculturals",
	"Docking with Deep Space Dredgers is rather difficult - they automatically swerve to avoid you! Best to use Docking Computers - or buy and install one of those ILS systems - you know, an Instrument Landing System.",
	);

"hints_Ship's_Library" =
	(
	"You can get the Ship's Manual to appear in an MFD if your HUD supports them. That way you can read it as you fly! You cycle what the current MFD shows with that semicolon key on your astrogation console. Have you ever used it? Oh! And you select which MFD-space you want to use with the colon key",
	);

    //GNN hints (9)

    //• Interview of Chap reaching Elite status and giving manoeuvre he used
    "education_news_1" = "Usge Ceanal has just attained Elite status according to a press release from the Elite Federation. In an interview, Ceanal said that he was an advocate of the Barkanion Bounce (named after the renowned Lave Academician) - swirling in loops towards his opposition whilst varying his speed. This tactic enables a trouble-free approach to one’s targets, and accounted for many hundreds of his kills.";

    //• Rock hermit destroyed in anarchy (a Pirate Cove)
    "education_news_2" = "A pirate-infested Rock Hermit has just been destroyed by a police viper-squad in the rodent-ridden anarchy of Riedquat. A centre for the local slave and narcotics trade, it has finally been shut down, allowing much safer travel in the Old Worlds sector! \"The pirate plague has finally been eliminated\" claimed the courageous Commander Reed Spar of GalCop, \"the Old Worlds are now as safe as a parentally-patrolled paddling pool!\" ";

    //• Pirates nab chap on milk run Ensoreus-Ararus Furs-Computers: turns out to be a millionaire
    "education_news_3" = "Reports are just coming in about Orit Ceedthse, an Ensorean trader was murdered at Ararus yesterday by marauding pirates. It turns out that the feline was phenomenally rich, due to trading in furs and computers between Ensoreus and Ararus. Was she killed for her cargo, her money or for more murky misdemeanours? Truth is, we don’t know!";

    //• Quirium Cascade mishap
    "education_news_4" = "A quirium cascade bomb has been detonated at Qubeen. It caught some 27 ships and a rock hermit as well as the launcher of the bomb, a rodent from nearby Maesin. Inquiries are ongoing into the exact cause of the incident. GalCop is offering handsome rewards for relevant information.";

    //• Flavour text
    "education_news_5" = "Murgh the Munificent, the Metropolitan of Maduro, in the Middle Oceans of Aronar, has been promoted to be the Sectoral Sacerdote for the Church of Giles the Creator. A devotee of fine wines, he is rumoured to have crepuscular connections in the ship-building industry as well as having links to the \"Cuban Cohort\", a mysterious group of musical mayhem-makers. He has for some time been threatening to lead a crusade against the Witchspace Lobster Worshippers. Watch this space!";

    //• Pirates have ECM
    "education_news_6" = "The number of pirates armed with Electronic Counter Measures is increasing. Arch-Chandler RedSpear of GalCop's weapons research laboratory at Ceesxe has confirmed that more and more pirates are now using ECM in combat: \"Do not fire missiles at pirates grouped in clusters of four or more, or you will waste them. At least one of them will be able to destroy your missiles\" he told our reporters this morning.";
    
    //• Flavour text
    "education_news_7" = "Archimandrite Ph'i Ku'ub of the Digebitian antipodes has just published a new commentary on the treatise on Theological Arithmetics by Saint Phibo Nacci. Combined with his earlier analysis of the mystical fourth codicil of the Codex of Giles the Creator, Ph'i Ku'ub claims to prove that the ooniverse was designed through random purposefulness, and show the numerical underpinnings of all that exists. Copies of his masterpiece have been selling like hotcakes! But does anybody actually understand it? Truth is, we don't know - and neither does anyone else!";

    //• Cim's changes to safe systems
    "education_news_8" = "Pirates travelling from their home system to raid another are becoming more of a threat. On the one hand, Police vipers at Diso have fought off another incursion of some several dozen pirates from the local anarchies, Uszaa and Reidquat. The President of Diso has appealed to GalCop for more help in stabilising the local region. On the other hand, Ensoreus has been raided by ravenous hordes from Ararus, Zaalela and Xeesle.";

    //•Contracts
    "education_news_9" = "Arquebus the Audacious, the master trader, has finally come a cropper! After years of amassing a fortune trading in furs and computers, he took a time-sensitive contract to deliver wodgets to Ceesxe. Forgetting that fewer long jumps take much more time than many more smaller jumps, he arrived several days too late - and lost well over thirty thousand credits as a result! He is rumoured to have sold his ship in disgust and retired to a life of farming trumbles!";

}   
Last edited by Cholmondely on Tue May 10, 2022 12:27 pm, edited 3 times in total.
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
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Education

Post by Cody »

Cholmondely wrote: Tue May 10, 2022 11:45 am
So, I'm a blithering idiot.
No comment!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 5587
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Education

Post by phkb »

Cholmondely wrote: Tue May 10, 2022 11:45 am
Bar chatter seems to work fine now.
Yay! One down...
Cholmondely wrote: Tue May 10, 2022 11:45 am
I finally got a broadcast - but as [education_news_0] - it was at my 10th or greater station visit!
OK, this one is my fault - a result of sending you non-tested code!
The issue comes down to when the "this.education_last" variable is updated.

These changes should fix it:

Code: Select all

"use strict";
this.name = "Hints_GNN.js";
this.author = "Cholmondely";
this.copyright = "(C) 2022 Littlebear & Phkb";
this.licence = "CC-NC-by-SA 4.0";
this.description = "Code by LittleBear and then Phkb.";
this.version = "0.9.4";

this.education_last = 0; // holds which news item was last published
this.education_max = 9; // hold the maximum number of news items available

this.startUpComplete = function() {
    // check save game for our education_last variable, and read it back in if found
    if (missionVariables.education_last) {
        this.education_last = parseInt(missionVariables.education_last);
    log(this.name, "got here1");
    }
}

this.playerWillSaveGame = function() {
    // make sure our education variable is saved
    missionVariables.education_last = this.education_last;
}

this.shipExitedWitchspace = function() {
    // if we've reach the maximum number of messages, we're done.
    if (this.education_last == this.education_max) return;

    // this is where you'd set up rules to govern how often news items are sent.
    // for the purposes of this exercise, we'll just make it random (1% chance)
    if (Math.random() < 0.01) { 
        var news = new Object;
        news.ID = this.name;
        // increment the education_last variable
        this.education_last += 1;
        // get the appropriate news item, based on the education_last variable.
        news.Message = expandDescription("[education_news_" + this.education_last + "]");
        news.Agency = 2;
        news.Priority = 1;
        this.passScreen(news, 1);
        log(this.name, "got here2");
    }
}

this.passScreen = function (news, mode) {
    var a = worldScripts.GNN._insertNews(news);
        log(this.name, "got here3");
    if (!a) {
        return;
    } else {
        if (a < 0) { // If the buffer was full ...
            if (mode) this.education_last -= 1; // ... revert the education_last variable to the previous setting so we can try again later.
            return;
        }
    }
}

/*

// copy and paste everything between these markers ****** (but not the markers themselves) into descriptions.plist

******
    //• Interview of Chap reaching Elite status and giving manouever he used
    "education_news_1" = "Usge Ceanal has just attained Elite status according to a press release from the Elite Federation. In an interview, Ceanal said that he was an advocate of the Barkanion Bounce (named after the renowned Lave Academician) - swirling in loops towards his opposition whilst varying his speed. This tactic enables a trouble-free approach to one’s targets, and accounted for many hundreds of his kills.";

    //• Rock hermit destroyed in anarchy (a Pirate Cove)
    "education_news_2" = "A pirate-infested Rock Hermit has just been destroyed by a police viper-squad in the rodent-ridden anarchy of Riedquat. A centre for the local slave and narcotics trade, it has finally been shut down, allowing much safer travel in the Old Worlds sector! “The pirate plague has finally been eliminated” claimed the courageous Commander Reed Spar of GalCop, \"the Old Worlds are now as safe as a parentally-patrolled paddling pool!\"";

    //• Pirates nab chap on milk run Ensoreus-Ararus Furs-Computers: turns out to be a millionaire
    "education_news_3" = "Reports are just coming in about Orit Ceedthse, an Ensorean trader was murdered at Ararus yesterday by marauding pirates. It turns out that the feline was phenomenally rich, due to trading in furs and computers between Ensoreus and Ararus. Was she killed for her cargo, her money or for more murky misdemeanours? Truth is, we don’t know!";

    //• Quirium Cascade mishap
    "education_news_4" = "A quirium cascade bomb has been detonated at Qubeen. It caught some 27 ships and a rock hermit as well as the launcher of the bomb, a rodent from nearby Maesin. Inquiries are ongoing into the exact cause of the incident. GalCop is offering handsome rewards for relevant information.";"

    //• Flavour text
    "education_news_5" = "Murgh the Munificent, the Metropolitan of Maduro, in the Middle Oceans of Aronar, has been promoted to be the Sectoral Sacerdote for the Church of Giles the Creator. A devotee of fine wines, he is rumoured to have crepuscular connections in the ship-building industry as well as having links to the \"Cuban Cohort\", a mysterious group of musical mayhem-makers. He has for some time been threatening to lead a crusade against the Witchspace Lobster Worshippers. Watch this space!";

    //•Contracts
    "education_news_9" = "Arquebus the Audacious, the master trader, has finally come a cropper! After years of amassing a fortune trading in furs and computers, he took a time-sensitive contract to deliver wodgets to Ceesxe. Forgetting that fewer long jumps take much more time than many more smaller jumps, he arrived several days too late - and lost well over thirty thousand credits as a result! He is rumoured to have sold his ship in disgust and retired to a life of farming trumbles!";

    //• Flavour text
    "education_news_7" = "Archimandrite Ph'i Ku'ub of the Digebitian antipodes has just published a new commentary on the treatise on Theological Arithmetics by Saint Phibo Nacci. Combined with his earlier analysis of the mystical fourth codicil of the Codex of Giles the Creator, Ph'i Ku'ub claims to prove that the ooniverse was designed through random purposefulness, and show the numerical underpinnings of all that exists. Copies of his masterpiece have been selling like hotcakes! But does anybody actually understand it? Truth is, we don't know - and neither does anyone else!";

    //• Cim's changes to safe systems
    "education_news_8" = "Pirates travelling from their home system to raid another are becoming more of a threat. On the one hand, Police vipers at Diso have fought off another incursion of some several dozen pirates from the local anarchies, Uszaa and Reidquat. The President of Diso has appealed to GalCop for more help in stabilising the local region. On the other hand, Ensoreus has been raided by ravenous hordes from Ararus, Zaalela and Xeesle.";

    //• Pirates have ECM
    "education_news_6" = "The number of pirates armed with Electronic Counter Measures is increasing. Arch-Chandler RedSpear of GalCop's weapons research laboratory at Ceesxe has confirmed that more and more pirates are now using ECM in combat: "Do not fire missiles at pirates grouped in clusters of four or more, or you will waste them. At least one of them will be able to destroy your missiles" he told our reporters this morning.";
******
*/
Cholmondely wrote: Tue May 10, 2022 11:45 am
it was at my 10th or greater station visit!
Change the Math.random() < 0.01 to a higher percentage to increase the chances of getting a broadcast. While testing, you might want to change the number to 1.0 so that it is a guaranteed chance you will get a broadcast in a new system.
User avatar
Cholmondely
Archivist
Archivist
Posts: 6545
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Hints OXZ (Development Thread)

Post by Cholmondely »

Call for help!

I'm now working on hints for OXP's.

So far I have the following:
Commies.oxp
1) Young woman: "I visited one of those communist systems. There was an Astro-gulag with convict labourers, but I couldn't find any Rock Hermits.
Feline in goggles: No, there are usually Rock Hermits too, it's just that their beacons are not as distinctive as the Astro-gulags
Woman: So what's the deal with the convict labourers?
Feline: Nasty. They work in Mining Pods and Scavenger Rays. The Pods are just a laser with an engine and a pilot's seat. Half a day of oxygen to stop them running. The heat from the laser warms up the pilots, so they have to fire it often to survive - which makes them visible to the Thought Police. The Scavenger Rays scoop up the splinters, but are ultra-slow and big. It's virtually impossible to escape in either, and many die in what seem to be pre-arranged accidents.",

2) "Those communist systems have factories built right in the sun's corona to harvest the energy.
Are they worth visiting?
Well, there are two sorts. SLAPU's in the more advanced systems, CZGF's in the poorer ones. SLAPU's have jolly good prices if you want to buy computers, CZGF's have the same for machinery",

Deep Space Dredgers.oxp
1) "I made a fortune selling food and liquors to one of those Deep Space Dredgers.",

2) "Alloys are really cheap at Deep Space Dredgers - you can make an excellent profit selling them at agriculturals",

3) "Docking with Deep Space Dredgers is rather difficult - they automatically swerve to avoid you! Best to use Docking Computers - or buy and install one of those ILS systems - you know, an Instrument Landing System.",

4) "You sometimes find several Dredgers in a rough line - if you find two of them, you can extrapolate the line to locate the rest"

Ship's Library.oxp
1) "Elderly green rodent: "You can get your Ship's Manual to appear in an MFD if your HUD supports them. That way you can read it as you fly!
Young lobster: Really? How do these MFD's work? I missed the class at Lave Academy...
Rodent: It's all done via your astrogation console. You cycle what your current MFD shows - even if it is currently blank - with that semicolon key on the console. If you have several MFD's available, that's how you choose between them.
Lobster: But what if I have more than one MFD slot on my viewscreen?
Rodent: Very simple. You select which MFD-space you want to use with the colon key
Lobster: So it's just those two keys then? The colon and the semi-colon?
Rodent: Well, if you add in the control key with either of your colons, then you can also cycle backwards!",

2) "That Ship's Manual is intelligent! If you've changed the keys on your astrogation console, it picks up on that and gives you your new keys instead!",

3) "It's best to read the Ship's Manual when docked! That way you get to see the diagrammes, which don't show in the MFD version"
Can you add anything?

(just bar talk, so far, but possibly to include GNN broadcasts too, if Phkb is amenable and if there are good enough press releases!)
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
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 694
Joined: Sat Dec 04, 2021 11:01 pm

Re: Hints OXZ (Development Thread)

Post by Old Murgh »

Cholmondely wrote: Fri May 13, 2022 9:14 am
Can you add anything?
Well, yes I'd like to. I have a background image that I submit for consideration,

Image

It makes it easier to read text above, and I feel it has a more generic and moody feel to it. Optional to have the neon signs alternate..?

So, some suggested additions:

*A button that offers the option to "stay another drink" for a card redraw.
*A simple yet haunting and weird musical score for a bit more depth of immersion (I have a sketch..)
*Mixing it up a little, (like getting evicted on account of the cravat), maybe some more unpredictable comic relief.
One idea is sentences that may be played with in Elite/Oolite style, something like:
A group of %I are are joined by a X Y companion. You suddenly feel compelled go over and Z them, but as usual you decide against it.
%I=inhabitants of current homeworld,
X=evocative adjective (appealing, edible, revolting, fine, vile, exotic, unremarkable, obscene, stunning, saucy, repellent, demure, etc),
Y=race (bird, feline, frog, human, humanoid, insectoid, lizard, lobstoid, Osrisian, rodent, Thargoid),
Z= lively verb (befriend, harass, enchant, preach to, ravage, embarrass, mime to, seduce, grift, swindle, offend, make whoopee with.. etc).

Fun, or not quite the direction you would like to see it go?
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
Cholmondely
Archivist
Archivist
Posts: 6545
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Hints OXZ (Development Thread)

Post by Cholmondely »

Old Murgh wrote: Wed Dec 10, 2025 11:08 pm
Well, yes I'd like to. I have a background image that I submit for consideration,
Ummm... all I can see is a puce oblong with "Content not viewable in your region" emblazoned on it.
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
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 780
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Hints OXZ (Development Thread)

Post by Lone_Wolf »

Old Murgh put it on imgur.com , I had no problems seeing it from the netherlands.

I've download it and uploaded to https://app.box.com/s/k2av8xal4ep9134g00ky1xde9dxrc08m

On-Topic :

Are salvage gangs & hacker outposts (both from anarchies oxp ) mentioned in the hints ?
atleast one of those sometimes sells a NEU .
Last edited by Lone_Wolf on Thu Dec 11, 2025 12:06 am, edited 1 time in total.
OS : Arch Linux 64-bit - rolling release

From: The Netherlands, Europe

OXPs : My user page (needs updating)

Retired, occasionally active
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 694
Joined: Sat Dec 04, 2021 11:01 pm

Re: Hints OXZ (Development Thread)

Post by Old Murgh »

Cholmondely wrote: Wed Dec 10, 2025 11:36 pm
Ummm... all I can see is a puce oblong with "Content not viewable in your region" emblazoned on it.
Very annoying about imgur cutting me off from UK

Here's one from Photobucket
Image

But thanks for taking action Lone_Wolf
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
Cholmondely
Archivist
Archivist
Posts: 6545
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Hints OXZ (Development Thread)

Post by Cholmondely »

Lone_Wolf wrote: Thu Dec 11, 2025 12:01 am
Old Murgh put it on imgur.com , I had no problems seeing it from the netherlands.

I've download it and uploaded to https://app.box.com/s/k2av8xal4ep9134g00ky1xde9dxrc08m

On-Topic :

Are salvage gangs & hacker outposts (both from anarchies oxp ) mentioned in the hints ?
at least one of those sometimes sells a NEU.
No, they are not mentioned. (And I've only ever shopped at Salvage Gangs, and never seen an NEU there yet).

I kept the Hints focused purely on the Vanilla game.

I did play a little with adding Hints for some of the OXPs iff they were loaded in-game, but could not decide how to weight those OXP Hints.

I have since wondered about repeating some of the Hints with different wording - taking on board Massively Locked's advice about needing c.120 of anything to avoid immersion-breaking repetitions. Alas, I'm too busy being mugged by RL™ at the moment to do much about it.
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
Cholmondely
Archivist
Archivist
Posts: 6545
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Hints OXZ (Development Thread)

Post by Cholmondely »

Old Murgh wrote: Thu Dec 11, 2025 12:04 am
Here's one from Photobucket
Image
Uhhhh! What is it?
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
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2913
Joined: Sat Jun 11, 2011 6:07 am
Location: Nova Hollandia
Contact:

Re: Hints OXZ (Development Thread)

Post by Wildeblood »

Cholmondely wrote: Wed Dec 10, 2025 11:36 pm
Ummm... all I can see is a puce oblong with "Content not viewable in your region" emblazoned on it.
Oxford not as posh as you thought it was, eh? It's perfectly viewable here, on the wrong side of Perth airport. :shock:

Hints OXZ is just a mission screen with randomly selected contents, right? It doesn't interact with anything else? So, a Trashier Hints OXP could sit alongside it, without interference?
R.I.P. John Lodge, 1943-2025.
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 694
Joined: Sat Dec 04, 2021 11:01 pm

Re: Hints OXZ (Development Thread)

Post by Old Murgh »

Cholmondely wrote: Thu Dec 11, 2025 1:40 am
Uhhhh! What is it?
You are looking at a stylized abstraction of two glasses of Ditizaian evil juice held by generic humanoid hands, in front of out-of-focus neon bar signs.

Yes, I hadn’t realized imgur ceased sharing content with UK in september. I’ll switch to one of the other.
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
Cholmondely
Archivist
Archivist
Posts: 6545
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Hints OXZ (Development Thread)

Post by Cholmondely »

Wildeblood wrote: Thu Dec 11, 2025 2:57 am
Hints OXZ is just a mission screen with randomly selected contents, right? It doesn't interact with anything else? So, a Trashier Hints OXP could sit alongside it, without interference?
It does not interact with anything else, as you say. I was hoping that it would be merged into [EliteWiki] Life in the Frontier, but alas, work on that has stopped for now.
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
Cholmondely
Archivist
Archivist
Posts: 6545
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Hints OXZ (Development Thread)

Post by Cholmondely »

Image
Old Murgh wrote: Thu Dec 11, 2025 7:56 am
You are looking at a stylized abstraction of two glasses of Ditizaian evil juice held by generic humanoid hands, in front of out-of-focus neon bar signs.
That is Ditizaian evil juice!

Well, blow me down with a feather!!
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
Cholmondely
Archivist
Archivist
Posts: 6545
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Hints OXZ (Development Thread)

Post by Cholmondely »

Summary of my stalled "Further Work" on this OXP.

1) I added in some colours to emphasise the different lines in trialogues. I forget now why I did not incorporate it - but something went wrong.

Code: Select all

this.name           = "Hints_Station_Bar.js";
this.author         = "Cholmondely";
this.copyright      = "(C) 2022 Cholmondely";   
this.licence        = "CC-NC-by-SA 4.0";
this.description    = "Adds a station bar where you might overhear useful tips";
this.version        = "0.0.95";

"use strict";

// LittleBear's comments: This script would let you give a randomly picked item each time. Although you might want to also add a timer so the messages change over time. You could also add tests for Government type, economy or station type so different items are overheard in different systems types and station types.

// Set Up your F4 Screen Option Like this:-


/*
// MslyLkd's mod- take out these 2 events in favor of guiScreenChanged
this.startUpComplete = this.shipDockedWithStation = function(station) {this.barinterface();}
*/
// MslyLkd's mod- drink cost = 40% of liquors' price.  higher the longer the stay?  random?
this.startUpComplete = this.shipDockedWithStation = function (stn) {
	this.$drinkCost = (player.ship.dockedStation.market.liquor_wines.price / 10 * 0.4).toFixed (1)
}
// MslyLkd's mod- only if player has enough credits then show the option on the F4 screen
this.guiScreenChanged = function (to, fro) {
	if (guiScreen === "GUI_SCREEN_INTERFACES") {
		if (player.credits >= $drinkCost) {this.barinterface ()}
			else {player.ship.dockedStation.setInterface ("bar_chatter", null)}
	}
}

this.removebar = this.shipWillLaunchFromStation = function() {
player.ship.dockedStation.setInterface("bar_chatter",null);
}

//  Now add your Visit the Bar Interface like this:-

this.barinterface = function() {
player.ship.dockedStation.setInterface("bar_chatter",{
title: "Visit the Station Bar",
category: "Activity",
summary: "Useful gossip can sometimes be overheard in the Bar",
callback: this.showBar.bind(this)});
};

// Phkb's Set up to allow colour (from http://www.aegidian.org/bb/viewtopic.php?p=283402#p283402)

//-------------------------------------------------------------------------------------------------------------
this.processText = function (text) {
    var final = [];
    var colors = [];
    var columnWidth = 32; // this is the maximum display width available
    var paras = text.split("\n");
    var color = "";
    for (var i = 0; i < paras.length; i++) {
        var line = "";
        // special case for a blank line
        if (paras[i].length == 0 && i < paras.length - 1) {
            final.push("");
            colors.push(color);
            continue;
        }
        var words = paras[i].split(" ");
        for (var j = 0; j < words.length; j++) {
            // look for a colour change
            if (words[j].indexOf("{color:") >= 0) {
                // get the color deinition
                color = words[j].substring(words[j].indexOf("{color:") + 7, words[j].indexOf("}"));
                if (color == "reset") color = ""; // check for a reset to set the color back to the default
                // remove the color definition from the word
                words[j] = words[j].substring(0, words[j].indexOf("{color:")) + words[j].substring(words[j].indexOf("}") + 1);
            }
            // can we fit this word into the line?
            if (defaultFont.measureString(line + " " + words[j]) > columnWidth) {
                final.push(line); // put the current line into the final array
                colors.push(color);
                line = ""; // clear the text
            }
            line += (line.length == 0 ? "" : " ") + words[j];
        }
        if (line.trim() != "") {
            final.push(line); // make sure any leftovers are put into the array
            colors.push(color);
            line = "";
        }
    }
    // return all the data we compiled in a dictionary
    return {
        lines: final,
        colors: colors
    };
}

//-------------------------------------------------------------------------------------------------------------
// returns true if a HUD with allowBigGUI is enabled, otherwise false
this.$isBigGuiActive = function $isBigGuiActive() {
	if (oolite.compareVersion("1.83") <= 0) {
		return player.ship.hudAllowsBigGui;
	} else {
		var bigGuiHUD = ["XenonHUD.plist", "coluber_hud_ch01-dock.plist"]; // until there is a property we can check, I'll be listing HUD's that have the allow_big_gui property set here
		if (bigGuiHUD.indexOf(player.ship.hud) >= 0) {
			return true;
		} else {
			return false;
		}
	}
}

// Now add this code so that when the Visit the Bar Option is selected Oolite will randomly pick one of the messages you have set up in descriptions. Version 0.93: This now includes PHKB's colour-tweaking additions

this.showBar = function () {
    // grab the text from the descriptions
    var text = expandDescription("[hints_bar_gossip]");
    var breakdown = this.processText(text);

    var defaultColor = "yellowColor";
    var displayLines = 26;
    if (this.$isBigGuiActive() == false) displayLines = 20;
    var choices = {};

    // add the text lines to the choices dictionary
    for (var i = 0; i < breakdown.lines.length; i++) {
        choices["line_" + (i < 10 ? "0" : "") + i.toString()] = {
            text: breakdown.lines[i],
            alignment: "LEFT",
            color: (breakdown.colors[i] == "" ? defaultColor : breakdown.colors[i]),
            unselectable: true
        }
    }
    // add some spacers to push the text to the top of the screen
    for (var i = 0; i < displayLines - breakdown.lines.length; i++) {
        choices["spacer" + i] = {
            text: "",
            unselectable: true
        }
    }
    // add a final choice to inform the player what to do next
    choices["z_end"] = {
        text: "Press enter to continue"
    }

	// MslyLkd's mod- randomize pics
	var pics = ["litf_bg_localbar", "androidWaitress", "BuccDen", "circularBar", "orbitalBar",
		"sciFiBar-ChrisGoff", "tronLegacy-SteveJung"]
	var rnd = Math.floor (Math.random () * pics.length)

    mission.runScreen({
        title: "The Local Bar",
        screenID: "show_bar",
        choices: choices,
		// MslyLkd's mod- randomize pics
        overlay: pics [rnd] + ".png", //This adds the bar image behind the message
        exitScreen: "GUI_SCREEN_INTERFACES",
    })

// MslyLkd's mod- add time as follows:
	// 15 min (900 sec) to get to the bar
	// time at bar: 15 min to 1 hr in 5 min increments
	// 15 min to get back from the bar
clock.addSeconds (Math.floor (Math.random () * 10) * 300 + 2700)

// MslyLkd's mod- pay bar tab
player.credits = player.credits - $drinkCost

}
2) I included a randomised selection of 7 bar pictures (androidWaitress, BuccDen, circularBar, litf_bg_localbar, orbitalBar, sciFiBar-ChrisGoff & tronLegacy-SteveJung)

3) GNN Help tips script which I never got to work:

Code: Select all

this.name           = "Education_GNN.js";
this.author         = "Cholmondely";
this.copyright      = "(C) 2022 Cholmondely";
this.licence        = "CC-NC-by-SA 4.0";
this.description    = "This .js file doesn't do anything at all yet.";
this.version        = "0.0.0";

"use strict";

//General Note. Not too sure what news items to add that would be genuinely educational and not come over as forced. But keeping this in the scripts folder just in case...

//LittleBear's comments: Needs other stuff: Under this.startupcomplete set up a news variable as 0 if not already defined. This gives you an easy way to check that each news item in your script is only given once. Under exiting.hyperspace increment a timer each time a jump is made so you can spread out the flavour news items so they don't pop up all at once.

//this.startUpComplete = function()
//{
//    if (!missionVariables.planner_planNames)
//    {
//	missionVariables.planner_plans = JSON.stringify({});
//	missionVariables.planner_planNames = JSON.stringify({"1_EXIT":
//							     "Exit."});
//    }
//    this._plans = JSON.parse(missionVariables.planner_plans);
//    this._planNames =  JSON.parse(missionVariables.planner_planNames);
//    this.$dockedCheck();
//}

//Then you just need a test like this under exiting hyperspace:- 

// Send the 2nd (Rooters) Broadcast to GNN.- Is Sent as a Priority 1 once 4 jumps have been made since Broadcast 1 was sent.
if (missionVariables.random_station_names_news === 2 &&  missionVariables.random_station_names_timer > 3) {
missionVariables.random_station_names_timer = 0;
var news = new Object;
news.ID = this.name;
news.Message = expandDescription("[random_station_names_2_news]");
news.Agency = 2;
news.Priority = 1;
this.passScreen(news,1); 
// The same method is used as above.
}

// Send the 3rd (Tionisla Chronicle) Broadcast to GNN.- Is Sent as a Priority 1 once 6 jumps have been made since Broadcast 2 was sent.
if (missionVariables.random_station_names_news === 3 &&  missionVariables.random_station_names_timer > 5) {
missionVariables.random_station_names_timer = 0;
var news = new Object;
news.ID = this.name;
news.Message = expandDescription("[random_station_names_3_news]");
news.Agency = 4;
news.Priority = 1;
this.passScreen(news,1); 
// The same method is used as above.
}

//And so on for however many news broadcasts you want to write.

// Now copy and past in the function below to send the news items to GNN when the conditions are met:

this.passScreen = function(news,mode)
{var a = worldScripts.GNN._insertNews(news);
if(!a){ if(mode) missionVariables.random_station_names_news++;  // If GNN conforms sucess, advance the News Counting variable to the next Broadcast.
return;
} else {if(a<0){ // If the buffer was full then the mission variable counting the News Broadcasts wasn't advanced. Once the player has made the required number of jumps Random Station names will check again.
return;
}}}

// In a descriptions file write the text for your news broadcasts. All you need is a:-

"random_station_names_1_news" = "Type in your text!";
"random_station_names_2_news" = "Type in your text for the next one";

And so on for however many broadcasts you want to send.

//• Interview of Chap reaching Elite status and giving manouever he used
//Usge Ceanal has just attained Elite status according to a press release from the Elite Federation. In an interview, Ceanal said that he was an advocate of the Barkanion Bounce (named after the renowned Lave Academician) - swirling in loops towards his opposition whilst varying his speed. This tactic enables a trouble-free approach to one’s targets, and accounted for many hundreds of his kills.

//• Rock hermit destroyed in anarchy (a Pirate Cove)
//A pirate-infested Rock Hermit has just been destroyed by a police viper-squad in the rodent-ridden anarchy of Riedquat. A centre for the local slave and narcotics trade, it has finally been shut down, allowing much safer travel in the Old Worlds sector! “The pirate plague has finally been eliminated” claimed the courageous Commander Reed Spar of GalCop, "the Old Worlds are now as safe as a parentally-patrolled paddling pool!".

//• Pirates nab chap on milk run Ensoreus-Ararus Furs-Computers: turns out to be a millionaire
//Reports are just coming in about Orit Ceedthse, an Ensorean trader was murdered at Ararus yesterday by marauding pirates. It turns out that the feline was phenomenally rich, due to trading in furs and computers between Ensoreus and Ararus. Was she killed for his cargo, her money or for more murky misdemeanours? Truth is, we don’t know!

//• Quirium Cascade mishap
//A quirium cascade bomb has been detonated at Qubeen. It caught some 27 ships and a rock hermit as well as the launcher of the bomb, a rodent from nearby Maesin. Inquiries are ongoing into the exact cause of the incident. GalCop is offering handsome rewards for relevant information.

//• Murgh the Munificent, the Metropolitan of Maduro, in the Middle Oceans of Aronar, has been promoted to be the Sectoral Sacerdote for the Church of Giles the Creator. A devotee of fine wines, he is rumoured to have crepuscular connections in the ship-building industry as well as having links to the "Cuban Cohort", a mysterious group of musical mayhem-makers. He has for some time been threatening to lead a crusade against the Witchspace Lobster Worshippers. Watch this space!

//• Chap who lost massive contract due to taking fewer jumps
//Arquebus the Audacious, the master trader, has finally come a cropper! After years of amassing a fortune trading in furs and computers, he took a time-sensitive contract to deliver wodgets to Ceesxe. Forgetting that fewer long jumps take much more time than many more smaller jumps, he arrived several days too late - and lost well over thirty thousand credits as a result! He is rumoured to have sold his ship in disgust and retired to a life of farming trumbles!

// Archimandrite Di Joner of Digebiti has just published a new commentary on the treatise on Theological Arithmetics by Saint Phibo Nacci. Combined with an earlier analysis of the mystical fourth codicil of the Codex of Giles the Creator, Di Joner claims to prove that the ooniverse was designed through random purposefulness, and show the numerical underpinnings of all that exists. Copies of his masterpiece have been selling like hotcakes! But does anybody actually understand it? Truth is, we don't know - and neither does anyone else!

//Police vipers at Diso have fought off another incursion of some several dozen pirates from the local anarchies, Uszaa and Reidquat. The President of Diso has appealed to GalCop for more help in stabilising the local region.

//The number of pirates armed with Electronic Counter Measures is increasing. Arch-Chandler RedSpear of GalCop's weapons research laboratory at Ceesxe has confirmed that more and more pirates are now using ECM in combat: "Do not fire missiles at pirates grouped in clusters of four or more, or you will waste them. At least one of them will be able to destroy your missiles" he told our reporters this morning.
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?
Post Reply