Scripters cove

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

Moderators: winston, another_commander

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

Re: Scripters cove

Post by phkb »

Wildeblood wrote: Mon Aug 05, 2024 7:24 pm
I'm still having fun with screen backgrounds, and my next question is, can I switch off the rotating planet model on the F7 screen?
Not easily. I experimented with forcing the system to be a nova system (just temporarily), which would then allow you to manipulate the "system_data_nova" screen backgrounds id, but that was a bust. The nova settings for a system are readonly except for "system.sun.goNova" and "system.sun.cancelNova". But the "system_data_nova" background only applies if the sun has *gone* nova, at which point you can't "cancelNova" to change it back.

So my recommendation is that you'd need to replace the F7 screen with a custom mission screen, triggered whenever the player tries to visit the F7 screen.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2413
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Scripters cove

Post by Wildeblood »

phkb wrote: Mon Aug 19, 2024 12:06 am
Wildeblood wrote: Mon Aug 05, 2024 7:24 pm
I'm still having fun with screen backgrounds, and my next question is, can I switch off the rotating planet model on the F7 screen?
Not easily. I experimented with forcing the system to be a nova system (just temporarily), which would then allow you to manipulate the "system_data_nova" screen backgrounds id, but that was a bust. The nova settings for a system are read-only...
Methinks, you do like to do things the hard way. If there's no "official" way to switch off the planet model, I would have tried experimenting with the planet's texture, attempting to make it transparent, or the planet's radius, trying to make it imperceptibly small, before I thought to mess about with the nova settings. Have you ever tried those approaches?
In your heart, you know it's flat.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2413
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Scripters cove

Post by Wildeblood »

Can anyone offer any advice, how to proceed, here? This is my first attempt at a _checkForDamage function, which loops through player.ship.equipment until it finds something damaged, then returns true. Or, returns false if it gets all the way through.

Code: Select all

    this._checkForDamage = function () {
        "use strict";
        var self = player.ship;
        for (var i = 0; i < self.equipment.length; i++) {
            if (self.equipment[i].isVisible &&
                self.equipmentStatus(self.equipment[i]) === "EQUIPMENT_DAMAGED") {
                this._repairsNeeded = true;
                return true;
            }
        }
        this._repairsNeeded = false;
        return false;
    }
When it came time to make use of the function, I was somewhat disappointed at the result, and left myself this note:-

The flag, _repairsNeeded, is surprisingly frustrating.
It encourages me to check the F3 screen, where I learn
the repairs I need are not available on this low-tech
station. What's actually needed is a _repairsAvailable
flag.

So, that is the question, how does one find what equipment repairs are available at the current station, and compare them to what is needed?
User avatar
Cholmondely
Archivist
Archivist
Posts: 5290
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Scripters cove

Post by Cholmondely »

Wildeblood wrote: Wed Sep 04, 2024 5:23 am
Can anyone offer any advice, how to proceed, here? This is my first attempt at a _checkForDamage function, which loops through player.ship.equipment until it finds something damaged, then returns true. Or, returns false if it gets all the way through.

Code: Select all

    this._checkForDamage = function () {
        "use strict";
        var self = player.ship;
        for (var i = 0; i < self.equipment.length; i++) {
            if (self.equipment[i].isVisible &&
                self.equipmentStatus(self.equipment[i]) === "EQUIPMENT_DAMAGED") {
                this._repairsNeeded = true;
                return true;
            }
        }
        this._repairsNeeded = false;
        return false;
    }
When it came time to make use of the function, I was somewhat disappointed at the result, and left myself this note:-

The flag, _repairsNeeded, is surprisingly frustrating.
It encourages me to check the F3 screen, where I learn
the repairs I need are not available on this low-tech
station. What's actually needed is a _repairsAvailable
flag.

So, that is the question, how does one find what equipment repairs are available at the current station, and compare them to what is needed?
Are there not OXPs which do this? And will have relevant code built in?

Here's a screen shot from Damage Report MFD:

Image

And the script should be on Hiran's database!
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: 2413
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Scripters cove

Post by Wildeblood »

I'll have a look. Ta.

LOL @ Nick's version history:

2.2.1
- Fixed missing ";" in Javascript file.
In your heart, you know it's flat.
Post Reply