Page 2 of 2
Re: Maintenance upon demmand
Posted: Thu Jul 18, 2019 10:24 am
by phkb
It seemed appropriate to include the code in the actual OXP, so here it is, v0.3, with maintenance emails:
MaintenanceTuneUp.oxz.
For the really keen, here's what I did:
First, the startupComplete event, I added this code:
Code: Select all
if (worldScripts.GalCopAdminServices) {
var ga = worldScripts.GalCopAdminServices;
ga._purchase_ignore_equip.push("EQ_MAINTENANCE_TUNEUP"); // don't sent a normal purchase email for this one
}
Essentially, this tells the GalCop Admin Services worldscript to ignore any purchase of the tune up equipment item. That's so we only get one email, not two.
Next, I added the following event handler
Code: Select all
this.guiScreenChanged = function(to, from) {
if (to === "GUI_SCREEN_EQUIP_SHIP") {
this._cost = player.ship.renovationCost;
}
}
This grabs a copy of the players current renovation cost, so we can apply it to the email if required.
Finally, in the "playerBoughtEquipment" routine, I added this code:
Code: Select all
if (worldScripts.GalCopAdminServices) {
var ga = worldScripts.GalCopAdminServices;
ga._maintCost = this._cost / 10;
ga.$setupRepNames();
ga.$sendMaintenanceEmail();
}
All this does is applies the cost value we recorded earlier to GalCop Admin Servers, forces the rep names to be defined, and then sends the maintenance email.
Hope that makes sense!
Re: Maintenance upon demmand
Posted: Thu Jul 18, 2019 2:51 pm
by Nite Owl
Geez - No wonder it would not work for me, left out almost every step. Thank you again for both the update and the scripting lesson, much appreciated.
Re: Maintenance upon demand
Posted: Fri May 28, 2021 5:42 pm
by Cholmondely
This one is another little gem. It really should be on the Expansions Manager, in my humble opinion. Actually, it should be in the vanilla (non-strict) game!
But, the title is wrong. EquipmentRemoveItemColor - it seems not to affect "Remove Items", just "Sell Items".
- See here:
http://wiki.alioth.net/index.php/File:F ... P%27d).png
Could I suggest:
Equipment "Sell Item" Colour or
F3 screen "Sell Item" Colour as more accurate - and more comprehensible?
Re: Maintenance upon demmand
Posted: Sat May 29, 2021 7:10 am
by phkb
Cholmondely wrote: ↑Fri May 28, 2021 5:42 pm
it seems not to affect "Remove Items", just "Sell Items".
Well, it
should have affected remove items.
*has peek under the hood*
Oh, right. HUD Selector doesn't have "remove" in the description for its remove item, only in the name.
*grumbles something about inconsistent OXP descriptions*
*takes hammer to code*
(sound of bashing and thumping, followed by breaking glass and the screech of a stray cat)
*wipes hands on overalls*
Right! Sorted! With a name change to aid the unwary.
Re: Maintenance upon demmand
Posted: Sat May 29, 2021 7:18 am
by phkb
Although... this has been posted to the wrong thread, really...
Re: Maintenance upon demmand
Posted: Sat May 29, 2021 6:02 pm
by hiran
phkb wrote: ↑Sat May 29, 2021 7:10 am
Cholmondely wrote: ↑Fri May 28, 2021 5:42 pm
it seems not to affect "Remove Items", just "Sell Items".
Well, it
should have affected remove items.
*has peek under the hood*
Oh, right. HUD Selector doesn't have "remove" in the description for its remove item, only in the name.
*grumbles something about inconsistent OXP descriptions*
*takes hammer to code*
(sound of bashing and thumping, followed by breaking glass and the screech of a stray cat)
*wipes hands on overalls*
Right! Sorted! With a name change to aid the unwary.

Re: Maintenance upon demand
Posted: Sat May 29, 2021 9:46 pm
by Cholmondely
phkb wrote: ↑Sat May 29, 2021 7:18 am
Although... this has been posted to the wrong thread, really...
I somehow posted Maintenance and Equipment Remove Item Colour together.
Apologies. Old age, galloping senility, dying brain cells, ... They need Maintenance on de
mmmand!
Re: Maintenance upon demand
Posted: Wed Sep 28, 2022 9:10 pm
by Cholmondely
phkb wrote: ↑Sat May 29, 2021 7:10 am
(sound of bashing and thumping, followed by breaking glass and the screech of a stray cat)
Wiki page now up:
https://wiki.alioth.net/index.php/Maintenance_Tune_Up
Re: Maintenance upon demmand
Posted: Fri Sep 30, 2022 10:37 am
by phkb
Thanks!
Re: Maintenance upon demand
Posted: Fri Sep 30, 2022 11:27 am
by Cholmondely
phkb wrote: ↑Fri Sep 30, 2022 10:37 am
My pleasure. Great pleasure, in fact. Thank
you for all that you do for the rest of us...
Re: Maintenance upon demmand
Posted: Mon Jun 09, 2025 6:52 am
by phkb
A small update - I made the call to stop offering a tune up immediately after an overhaul is performed. My logic being, why would the same place make your ship better immediately after overhauling your ship? Why couldn't they have got to the tune up level during the overhaul?
Logic is now: if you do the overhaul, you won't be offered a tune up in that system until you jump out and come back.