Page 3 of 5

Re: Docking fees revisited

Posted: Sun May 03, 2015 2:42 pm
by Vincentz
I really like this addon. Great texts and good for immersion.
A thing that would take it to the roof would be BGS type images.
Since its sort of a welcome screen (and all the BGS images are similar despite different stations), I think adding different type images for different type stations would be pure awesome. I'd offer my simple skills in Photoshop if you choose to do so.

Re: Docking fees revisited

Posted: Sun May 03, 2015 2:53 pm
by Smivs
Vincentz wrote:
A thing that would take it to the roof would be BGS type images.
Please, no! I (and many others) really don't like screen clutter like this. Keep it simple, and let the 'screen backgrounds' OXZs handle this for those that want them.

Re: Docking fees revisited

Posted: Sun May 03, 2015 3:02 pm
by Layne
I agree with Smivs-- especially given you'd need a different background image for each and every station type that exists. The mind is better at adding images than any artist, so my intention is to keep it to text for now, making use of the existing docking manifest screen.

Re: Docking fees revisited

Posted: Sun May 03, 2015 3:08 pm
by Norby
Smivs wrote:
let the 'screen backgrounds' OXZs handle this for those that want them.
I use this code in Towbar to get an image from an installed background OXP:

Code: Select all

this.startUp = function() {
	this.$TowbarBG = ""; //mission screen background
	if(worldScripts["BGS-M"]) this.$TowbarBG = "bgs-i_equipship.png";
	else if(worldScripts["Better Screens"]) this.$TowbarBG = "bs-base-bg.png";
}
...
	mission.runScreen({	background: worldScripts.towbar.$TowbarBG
...

Re: Docking fees revisited

Posted: Thu May 07, 2015 5:09 am
by phkb
A small issue: when using the "Combat Simulator", after completing a mission you are given a docking fee. Here's the steps to resolve this:

Code: Select all

// oolite.oxp.Layne.DockingFees
"use strict";

this.name = "Docking Fees";
this.version = "1.3";

this._simulator = false; // holding variable to work out whether this launch/dock routine was part of a simulator run

this.shipDockedWithStation = function (station) {

	// if this was a simulator run, reset the variable and return - no docking fee in this case
	if (this._simulator == true) {
		this._simulator = false;
		return;
	}

    // work out fee based on system tech level and station type
    // default for galcop stations (and any other station that is not covered in the examples below
    var fee = ((system.techLevel * 0.5) + 0.5);

    ....
    snip!
    ....

    if (fee == 0 && dock_mess != "") {
        player.addMessageToArrivalReport(expandDescription("[dockfee_" + dock_mess+ "]"));
    }
}

// check when the player launches if this is a simulator run
this.shipLaunchedFromStation = function(station) {
   if (this.$simulatorRunning()) this._simulator = true;
}

// routine to check the combat simulator worldscript, to see if it's running or not
this.$simulatorRunning = function() {
	var w = worldScripts["Combat Simulator"];
	if (w && w.$checkFight && w.$checkFight.isRunning) return true;
	return false;
}

Re: Docking fees revisited

Posted: Thu May 07, 2015 4:23 pm
by Layne
Thanks for noticing that and the scripting advice, phkb.

Version 1.4 has been uploaded to the wiki and the manifest updated, get it from the Expansion Pack Manager or here: http://wiki.alioth.net/index.php/File:O ... ngFees.oxz

Changes in this version:
Now compatible with Combat Simulator OXP
Three new OXP stations (Lave Academy, Sentinel/Renegade Stations) added
Oolite Tutorial station docking fee/message removed
Various minor typos fixed

Re: Docking fees revisited

Posted: Tue May 26, 2015 2:46 pm
by Layne
I'm still running across OXP stations that need patching for this-- it's not good when an RRS plague mine tells me they've got a bistro and welcome to the station-- so I want to try the matchup for stations in reverse: Opt-in as opposed to Opt-out. In other words, any station not specifically added to the docking fees gets ignored by the script, as opposed to how it works now where all stations not specifically excluded get a fee. That way stations that I don't know about-- unique ones from interesting OXPs-- won't need specific exemptions in the list.

I note the core stations have roles of 'coriolis', 'dodecahedron', and 'icosahedron'. What I need to do is figure out how to tweak the existing script to only add fees to the core stations based on these roles, as well as those specialty stations already included in the current version, and ignore any station not on the list that the player might dock at, to prevent secret ninja pirate bases and space yogurt stands from being charged. As it is now, every new OXP that adds a type of station not covered has to be patched, and I'd rather nip that in the bud.

Have any of the shiny-bright scripting mavens some advice on the syntax for handing this? I've spent a couple of hours fiddling and gotten no good results.

Also, so long as I'm passing the hat, I'd be more than happy to add extra docking message texts to the next version of the oxp! There are currently about 50+ messages for the docking manifest, but the more there are, the more immersion, I think. Anyone who has a suggested text for a certain tech-level or specific station type is more than welcome to send me a note, and I'll see about including it. I particularly enjoy the messages that use the core game text variables (the same list Oolite uses to generate messages about, 'deadly tree grubs' and 'hoopy art students') to add random elements to the docking messages, and some may have noticed there's a few of those already in the current version. So, if there's any creative ideas for those, please, feel free to send them along! Thanks!

Re: Docking fees revisited

Posted: Wed May 27, 2015 1:54 am
by phkb
Have you tried using if (station.allegiance == "galcop") to determine whether it's a Galcop station or not?

Re: Docking fees revisited

Posted: Wed May 27, 2015 2:00 am
by Layne
phkb wrote:
Have you tried using if (station.allegiance == "galcop") to determine whether it's a Galcop station or not?
I have not! I didn't know there was such a property. Thank you for the tip, I will return to my tinkering and see if that does the trick!

Re: Docking fees revisited

Posted: Wed May 27, 2015 12:18 pm
by Bugbear
I like the work being done here. It never ceases to amaze me when I watch (deceptively) simple concepts develop into complex ideas...

Re: Docking fees revisited

Posted: Thu May 28, 2015 3:54 am
by Layne
Bugbear wrote:
I like the work being done here. It never ceases to amaze me when I watch (deceptively) simple concepts develop into complex ideas...
Deceptively simple is the right word. I planned to just do a basic fee and generic message like I was used to in Frontier. That metastasized out of control pretty quickly, if you'll forgive the image.

:roll:

Re: Docking fees revisited

Posted: Tue Jun 09, 2015 5:57 pm
by Layne
Version 1.5 is now posted for downloading via the expansion manager or on the wiki (http://wiki.alioth.net/index.php/File:O ... ngFees.oxz). No changes to code, yet (still working on that) but fifteen new docking messages have been added to provide a bit more variety in the ambiance!

Re: Docking fees revisited

Posted: Mon Jun 15, 2015 2:20 am
by Layne
Version 1.6 is up! Get it via download manager or wiki (http://wiki.alioth.net/index.php/File:O ... ngFees.oxz).

Changes in this version:
Fee script changed to exclude any station not specifically included in the script (unknown OXP stations will no longer have docking fees assigned). Many, many (and did I say many?) new stations have been added to the list, though most have only a generic docking message or none at all.

In order to add all the new stations, I had to rely on a list of oxp stations provided by Norby; unfortunately I do not use most of the oxps on the list and cannot verify that the new stations added to the script will work as advertised.

In addition, I would like to announce that this will almost certainly be my last update to this oxp barring major bug-fixes or a sudden unanticipated burst of creativity. While I enjoy writing ambiance text, scripting is a source of much eye-twitching and gnashing of small gummie animals to me. However, as the oxp is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) it may be considered free to roam in the wild.

Run, little oxp, run with the wind.

Re: Docking fees revisited

Posted: Mon Jun 15, 2015 2:32 pm
by Norby
Nice work, I enjoy the result. :)

In the future maybe I will make another addon which add an arrival message with the name of the station to make the screens a bit more different in the rare stations due to currently only the system name is displayed both in the title and messages.

Re: Docking fees revisited

Posted: Mon Jul 27, 2015 7:50 pm
by Layne
Well, a small update-- phkb alerted me to a bit of misbehavior when returning to a station in an escape pod (Shame on you, GalCop, for double-dipping fees on commanders who just lost their ship!), and he also sent me the code to bugfix it. All that was needed from me was to patch and post, and given how lazy I am, that's just the level of involvement I can handle to-day!

It would have been churlish of me to let phkb's hard work go to waste, so, version 1.6.1 is up via download manager. Get it if you'd prefer GalCop not charge you for being hauled in as a tinned commander.