Page 117 of 117

Re: Scripters cove

Posted: Mon Aug 19, 2024 12:06 am
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.

Re: Scripters cove

Posted: Mon Aug 19, 2024 7:58 am
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?

Re: Scripters cove

Posted: Wed Sep 04, 2024 5:23 am
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?

Re: Scripters cove

Posted: Wed Sep 04, 2024 5:46 am
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!

Re: Scripters cove

Posted: Wed Sep 04, 2024 5:48 am
by Wildeblood
I'll have a look. Ta.

LOL @ Nick's version history:

2.2.1
- Fixed missing ";" in Javascript file.