Hints OXZ (Development Thread)

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

Moderators: another_commander, winston

User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 15402
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Education

Post by Cody »

Old Murgh wrote: Thu Jan 06, 2022 11:18 pmThere are luxuries and there are luxuries. I recommend Rexebian Richebourg or Gequrian Cannubi.
Zaquessoian Zinfandel?
Overall, there is a smell of fried onions!
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 344
Joined: Sat Dec 04, 2021 11:01 pm

Re: Education

Post by Old Murgh »

Cody wrote: Thu Jan 06, 2022 11:27 pm Zaquessoian Zinfandel?
Popular, though perhaps not zealously coveted.
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
Cholmondely
Wiki Wizard
Wiki Wizard
Posts: 2897
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of Her Most Britannic Majesty (currently plague-ridden)
Contact:

Re: Education

Post by Cholmondely »

I'm sorry. I need help with this one.

I can't get it to show anything whatsoever on the F4 screen. And I'm sure that if I can get help to manage it, that something else will inevitably go wrong...

I cut, pasted and tweaked LittleBear's code above. When I realised the problem I then looked at a half-dozen other simple-ish oxp's which also manifest a presence on the F4 screen. A couple looked similar, but I could not work out what was wrong with mine.

Oolite seems to recognise the .oxp as an .oxp and does not (yet!) evince any signs of indigestion. Quite simply, I don't know what I'm doing, and have only a foggy idea what most of this stuff means...

Here is my faulty code:

Code: Select all

this.name           = "Education_Station_Bar.js";
this.author         = "Cholmondely";
this.copyright      = "(C) 2022 Cholmondely";
this.licence        = "CC-NC-by-SA 4.0";
this.description    = "This OXP does nothing at all yet.";
this.version        = "0.1.1";

"use strict";

// Having a "Visit the Station Bar" on the F4 Screen might be a way to go for that. 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:-

this.shipDockedWithStation = function(station) {
this.barinterface();
}
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: "Activities",
summary: "Useful gossip can sometimes be overheard in the Bar",
callback: this.showBar.bind(this)});	
};

// 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. 

this.showBar = function() {
mission.runScreen({
title: "The Local Bar",
screenID:"show_bar",
var text = expandDescription("[education_bar_gossip]");
message: text;
}
OXP's adding choices to the F4 screen

There is a second file (a descriptions .plist ("education_bar_gossip") which seems to not yet be faulty!

2) This seems different to me: Ramen's Planner seems identical to Wildeblood's Station Self-Destruction

Code: Select all

this.name           = "planner.js";
this.author         = "Ramen";
this.copyright      = "(C) 2015 Ramen";
this.licence        = "CC-NC-by-SA 3.0";
this.description    = "This OXP doesn't do very much yet.";
this.version        = "1.0.0";

"use strict";

this._tempVal = ""; 

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();
}

this.shipDockedWithStation = function()
{
    this.$dockedCheck();
    this.playerWillSaveGame();
}

this.playerWillSaveGame = function()
{
    missionVariables.planner_plans = JSON.stringify(this._plans);
    missionVariables.planner_planNames = JSON.stringify(this._planNames);
}

this.$dockedCheck = function()
{
    player.ship.dockedStation.setInterface("Planner",
					       { title: "Planner",
						 category: "Info",
						 summary: "A Planner for "+
						 "'Real life' or Oolite",
						 callback:
						 this.$planner.bind(this)});
}

this.$planner = function()
{
    mission.runScreen({
	title: "Planner",
	message: "Choose an option.",
	choicesKey: "planner_options"},
		      this.$choice);
}
this.$choice = function(choice)
{
    if (choice == "1_ADD")
    {
	mission.runScreen({
	    title: "Planner",
	    message: "Enter subject. (30 char. max)",
	    textEntry: "TRUE"},
		      this.$subject);
    }
    else if (choice == "2_REMOVE")
    {
	mission.runScreen({
	    title: "Planner",
	    message: "Choose plan to remove.",
	    choices: this._planNames},
			  this.$remove);
    }
    else if (choice == "3_VIEW")
    {
	mission.runScreen({
	    title: "Planner",
	    message: "Choose a plan.",
	    choices: this._planNames},
			  this.$view);
    }
    else
    {
	return;
    }
}

this.$subject = function(choice)
{
    this._tempVal = choice;
    mission.runScreen({
	title: "Planner",
	message: "Enter details. (30 char. max)",
	exitScreen: "GUI_SCREEN_INTERFACES",
	textEntry: "TRUE"},
		      this.$details);
}

this.$details = function(choice)
{
    if (choice == "")
    {
	return;
    }
    this._plans[this._tempVal] = choice;
    this._planNames[this._tempVal] = this._tempVal;
}

this.$remove = function(choice)
{
    if (choice == "1_EXIT")
    {
	return;
    }
    delete this._plans[choice];
    delete this._planNames[choice];
    player.consoleMessage(choice + " removed.");
}

this.$view = function(choice)
{
    if (choice == "1_EXIT")
    {
	return;
    }
    mission.runScreen({
	title: choice,
	message: "Details:\n" + this._plans[choice]});
}
3) BeeTLe BeTHLeHeM's Life in the Frontier (relevant-seeming snippet) seems identical to Thargoid's OoCheat

Code: Select all

this.setInterface = function() {
	player.ship.dockedStation.setInterface("LITF_hangarScreen", 
		{
			title: "Disembark from your ship",
			category: "Activity",
			summary: "Visit the station",
			callback: this.$enterStation.bind(this) 
		}
	);
};
3) Different again: Phkb's Laser Arrangement (snippet)

Code: Select all

// establishes the F4 interface for switching laser mounts while docked
this.$initInterface = function $initInterface(station) {
    // can only move lasers if there is more than one mount to move them between
    // 0 = none, 1 = forward only
    if (player.ship.weaponFacings > 1) {
        station.setInterface(this.name, {
            title: "Laser arrangement",
            category: "Ship Systems",
            summary: "Allows lasers to be moved between the different mounts available on the ship.",
            callback: this.$showInitial.bind(this)
        });
    } else {
        station.setInterface(this.name, null);
    }
}
Denizen of the Dark and Dismal Deserts of Digebiti.

Milo wrote Dancing the Gavotte

Oolite BB Topic icons guide
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2662
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Education

Post by spara »

1. Rename "world-script.plist" to "world-scripts.plist"
2. Remove "," from world-scripts.plist
3. Fix whatever there is wrong in the "this.showBar" function.

I did 1 & 2 + commented the internals of the "this.showBar" function and the Station Bar appeared in the F4 screen. After launch and dock of course.
User avatar
Cholmondely
Wiki Wizard
Wiki Wizard
Posts: 2897
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of Her Most Britannic Majesty (currently plague-ridden)
Contact:

Re: Education

Post by Cholmondely »

spara wrote: Sun Jan 16, 2022 11:22 am 1. Rename "world-script.plist" to "world-scripts.plist"
2. Remove "," from world-scripts.plist
3. Fix whatever there is wrong in the "this.showBar" function.

I did 1 & 2 + commented the internals of the "this.showBar" function and the Station Bar appeared in the F4 screen. After launch and dock of course.
Thanks! I'll give it a whirl tonight.
Denizen of the Dark and Dismal Deserts of Digebiti.

Milo wrote Dancing the Gavotte

Oolite BB Topic icons guide
User avatar
Cholmondely
Wiki Wizard
Wiki Wizard
Posts: 2897
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of Her Most Britannic Majesty (currently plague-ridden)
Contact:

Re: Education

Post by Cholmondely »

Cholmondely wrote: Sun Jan 16, 2022 1:05 pm
spara wrote: Sun Jan 16, 2022 11:22 am 1. Rename "world-script.plist" to "world-scripts.plist"
2. Remove "," from world-scripts.plist
3. Fix whatever there is wrong in the "this.showBar" function.

I did 1 & 2 + commented the internals of the "this.showBar" function and the Station Bar appeared in the F4 screen. After launch and dock of course.
Thanks! I'll give it a whirl tonight.
So I commented out the internals (lines 34-38) and the option to visit the station bar finally appeared on my F4 screen. The only thing, was that I couldn't "select" it! So I'm still doing something wrong there. But a stage further forwards. Nothing obviously wrong in the latest.log


Current gossip is the following:

Trade
" 'So what did you do after you graduated from Lave?'/n/n '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 'No, no, Xexedi to Laenin is better - Laenin is much safer then Ararus."

"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?"

" 'Have you heard? That Cody chap got paid well over seventy thousand credits for delivering a parcel contract over in Galaxy Seven?'/n/n 'Yes, but a third of that was a bonus for early fulfillment' /n/n 'It's still a lot of moolah for a small parcel' /n/n '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!"

"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"

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.",

"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!"

"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.",

"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!"

"The Multi-Targeting System only makes sense if you set up your targets in advance, before you get into combat. Otherwise its 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?"

Pirate Tactics (some of the combat tactics soley refer to pirates but are of broader application)
"So you got scragged by the pirates again? You never learn, do you? When you arrive at the Witchpoint 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 witchpoint 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."

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!"

"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!"

"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",

"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!"

"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.",

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.",

"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.",

"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",

______________________________________________________________________________________________________________________________

Can't think of too much else to add at the moment, except from wanting a more Oolite flavour for the conversations (more references to St Giles, or the swamps of Isinor... that sort of thing).
Denizen of the Dark and Dismal Deserts of Digebiti.

Milo wrote Dancing the Gavotte

Oolite BB Topic icons guide
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 344
Joined: Sat Dec 04, 2021 11:01 pm

Re: Education

Post by Old Murgh »

A volume of good advice, amusingly put. Well done.
And a beautiful thing that there are those who'd rather enjoy a tea and wine.

Hard to think on the fly of anything that needs adding, but if something pops into mind while I nap, I'll suggest. Maybe the spiritual angle..
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
hiran
---- E L I T E ----
---- E L I T E ----
Posts: 854
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Education

Post by hiran »

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!
I have not failed. I've just found 10,000 ways that won't work. [Thomas Edison]
User avatar
Redspear
---- E L I T E ----
---- E L I T E ----
Posts: 2001
Joined: Thu Jun 20, 2013 10:22 pm

Re: Education

Post by Redspear »

"Looking for advice? Well, folks are gonna tell you all kinds of stuff but most of it's only half-true. I mean half-true is something, right?... 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... 'Yeah, well, you know, that's just, like, your opinion, frog'."
"With our thoughts, we make the world" :-) - - - Game too slow for you? Masslock Compensators - - - Trouble getting out of trouble? Indestructible Injectors
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 344
Joined: Sat Dec 04, 2021 11:01 pm

Re: Education

Post by Old Murgh »

How about something along the lines of:

"Oh Dad, I'm so confused!"
"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 you path. This is the way things are. You can't change nature."
" But change is nature, Dad. The part that we can influence. And it starts when we decide!”
"Now you're confusing me, son".
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2662
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Education

Post by spara »

Cholmondely wrote: Tue Jan 18, 2022 4:30 pm So I commented out the internals (lines 34-38) and the option to visit the station bar finally appeared on my F4 screen. The only thing, was that I couldn't "select" it! So I'm still doing something wrong there. But a stage further forwards. Nothing obviously wrong in the latest.log
Step forward indeed 8) To make the function actually do something, try this:

Code: Select all

this.showBar = function() {
	mission.runScreen({
		title: "The Local Bar",
		screenID:"show_bar",
		message: "foo"
	})
}
When you get that working, link it to the description.plist by altering that "foo" there. Oh, and to make bug-fixing and tweaking a bit faster, you might want to add this.startUpComplete as an extra event for adding the interface. Just change the first function to this:

Code: Select all

this.startUpComplete = this.shipDockedWithStation = function(station) {
...
User avatar
Cholmondely
Wiki Wizard
Wiki Wizard
Posts: 2897
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of Her Most Britannic Majesty (currently plague-ridden)
Contact:

Re: Education

Post by Cholmondely »

spara wrote: Wed Jan 19, 2022 4:47 pm Step forward indeed 8) To make the function actually do something, try this:

Code: Select all

this.showBar = function() {
	mission.runScreen({
		title: "The Local Bar",
		screenID:"show_bar",
		message: "foo"
	})
}
When you get that working, link it to the description.plist by altering that "foo" there. Oh, and to make bug-fixing and tweaking a bit faster, you might want to add this.startUpComplete as an extra event for adding the interface. Just change the first function to this:

Code: Select all

this.startUpComplete = this.shipDockedWithStation = function(station) {
...
Thanks, seriously! Still coming up with ideas for the conversations (and have a couple from Redspear/Murgh to include)...

______________________________________________________________________________________________________________________________

Is it feasible to detect what oxp's are being used and add in relevant tips which only show up then?

Eg: to detect that Galactic Navy is included in the oxp suite and add in some tips about it making Isinor much safer as a destination, or that buying zillions of bonds gives a massive discount on equipment in the navy base chandlery? Or a reminder that Market Observer only gives an average for the markets visited - not a galactic price average... Or that furs are often cheaper at Imperial Astrofactories... for those with Dictators loaded... Or Cody's points above about too much automation

I'm not at that stage yet (I want to include BB's bar photo and include the timer idea to limit the number of tips first...), but I definitely want to have a stab at it, if possible.

Image
Denizen of the Dark and Dismal Deserts of Digebiti.

Milo wrote Dancing the Gavotte

Oolite BB Topic icons guide
User avatar
Redspear
---- E L I T E ----
---- E L I T E ----
Posts: 2001
Joined: Thu Jun 20, 2013 10:22 pm

Re: Education

Post by Redspear »

"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."

"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."
"With our thoughts, we make the world" :-) - - - Game too slow for you? Masslock Compensators - - - Trouble getting out of trouble? Indestructible Injectors
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2662
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Education

Post by spara »

Cholmondely wrote: Wed Jan 19, 2022 5:19 pm Is it feasible to detect what oxp's are being used and add in relevant tips which only show up then?
Sure it feasible. You can easily check for the presence of an oxp and act accordingly. I would start with general gossip first though. I would create a list of converstations to the descriptions.plist and let the game randomly expand from those. If needed, I'll provide some example code for you.
User avatar
Redspear
---- E L I T E ----
---- E L I T E ----
Posts: 2001
Joined: Thu Jun 20, 2013 10:22 pm

Re: Education

Post by Redspear »

"Old Johnny never made it to Zaonce. He left at Lave sure enough but at Zaonce witchpoint 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..."
"With our thoughts, we make the world" :-) - - - Game too slow for you? Masslock Compensators - - - Trouble getting out of trouble? Indestructible Injectors
Post Reply