Tinkerer's Workshop - OXP tweaking for fun and profit!
Moderators: winston, another_commander
- Reval
- ---- E L I T E ----
- Posts: 402
- Joined: Thu Oct 29, 2020 3:14 am
- Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
True. The old hands (Braben/Bell) really squeezed a world of bytes into that 32k!
But I never really went on to 80386/486 etc with the PC: moved straight on up to higher level langs. Never looked back
But I never really went on to 80386/486 etc with the PC: moved straight on up to higher level langs. Never looked back
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Market Observer keeps a buy logReval wrote: ↑Mon Nov 09, 2020 11:12 amThanks. Manifest gives the quantities of all items in the hold; it doesn't seem to indicate the prices they were bought at (That's what I need to calculate profit) - is there any way to get at those? I mean, is it a question of setting global variables (if that's even possible)?
- Reval
- ---- E L I T E ----
- Posts: 402
- Joined: Thu Oct 29, 2020 3:14 am
- Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Yep. In my simple - and still hypothetical - 'Elite Trader' OXP I'd prefer to avoid saving or logging anything... just have a conditional statement to decide whether the trade was good or not, and update (or not) the player's Elite score accordingly.
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
- Reval
- ---- E L I T E ----
- Posts: 402
- Joined: Thu Oct 29, 2020 3:14 am
- Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
For a player and NPC ship, how to definitively restrict the availability of, for example, military lasers and military shield enhancers? I'm forced to ask because I have already, in FE Ships and FE Ships Player, removed those options from the "optional_equipment" in shipyard.plist, with the forbidden items still turning up for purchase at the shipyards of certain stations.
Edit: This is just for a few of the lighter craft, not all ships. I know there's "available_to_NPCs" in equipment.plist, but I think that's for all ships?
Edit: The Wiki suggests that allowAwardEquipment() might work if I include it in a condition script. It also says that the ship parameter can be an array... so how would I code that in practice?
Edit: This is just for a few of the lighter craft, not all ships. I know there's "available_to_NPCs" in equipment.plist, but I think that's for all ships?
Edit: The Wiki suggests that allowAwardEquipment() might work if I include it in a condition script. It also says that the ship parameter can be an array... so how would I code that in practice?
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
- Reval
- ---- E L I T E ----
- Posts: 402
- Joined: Thu Oct 29, 2020 3:14 am
- Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
In the JS Wiki:
serviceLevel : Number (read/write, positive integer in range 75-100)
The level of servicing the player's ship has. Renovation will be offered in shipyards at 85 or below, and malfunctions are more likely at lower values. This affects the sales price of the ship.
Would setting this to 100 effectively bring the ship into good repair (including all equipment)?
serviceLevel : Number (read/write, positive integer in range 75-100)
The level of servicing the player's ship has. Renovation will be offered in shipyards at 85 or below, and malfunctions are more likely at lower values. This affects the sales price of the ship.
Would setting this to 100 effectively bring the ship into good repair (including all equipment)?
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Yes. You can easily verify that in the debug console if you are at a high tech level system and execute:
Now if you go to the F3 screen you get the Maintenance Overhaul option. Next execute
and now the Maintenance Overhaul option is gone from the F3 screeen.
Code: Select all
player.ship.serviceLevel = 80
Code: Select all
player.ship.serviceLevel = 100
- Reval
- ---- E L I T E ----
- Posts: 402
- Joined: Thu Oct 29, 2020 3:14 am
- Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Indeed it does - thanks.
player.ship.maxforwardShield yields "undefined" when attempting to print the value. What is the range and is it really possible to increment it?
Is it the same property as max_energy in shipdata.plist?
player.ship.maxforwardShield yields "undefined" when attempting to print the value. What is the range and is it really possible to increment it?
Is it the same property as max_energy in shipdata.plist?
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Try maxForwardShield (with a capital F). All these properties are case sensitive.
- Reval
- ---- E L I T E ----
- Posts: 402
- Joined: Thu Oct 29, 2020 3:14 am
- Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Oops. And is it equivalent to max_ energy?
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
No, they are different properties. The equivalent of max_energy is maxEnergy. Generally the convention is underscores for the plist stuff and camelCase for the JS stuff.
- Reval
- ---- E L I T E ----
- Posts: 402
- Joined: Thu Oct 29, 2020 3:14 am
- Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
That makes sense.
Now, the Wiki has
maxSpeed
maxSpeed : Number (read-only, read/write from 1.81)
The ship’s maximum speed under normal power.
Problem incrementing maxSpeed, then thought it should it be maxFlightSpeed, as in the plist, but that gave me undefined. Can anyone enlighten me on how to modify a ship's max speed?
Edit: this is what I'm doing -
but it stays constant, refusing to increment.
Now, the Wiki has
maxSpeed
maxSpeed : Number (read-only, read/write from 1.81)
The ship’s maximum speed under normal power.
Problem incrementing maxSpeed, then thought it should it be maxFlightSpeed, as in the plist, but that gave me undefined. Can anyone enlighten me on how to modify a ship's max speed?
Edit: this is what I'm doing -
Code: Select all
if (this.$etLastSpeed<this.$etLimitSpeed) player.ship.maxSpeed++;
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Two possibilities:
1. The condition is not satisfied, therefore PS.maxSpeed++ is never exectued.
2. You have not tried PS.maxSpeed++ more than once. The first time you execute it, it will return its value and then increment it. You may want to try ++PS.speed instead so that it increments first, then it returns its value.
1. The condition is not satisfied, therefore PS.maxSpeed++ is never exectued.
2. You have not tried PS.maxSpeed++ more than once. The first time you execute it, it will return its value and then increment it. You may want to try ++PS.speed instead so that it increments first, then it returns its value.
- Reval
- ---- E L I T E ----
- Posts: 402
- Joined: Thu Oct 29, 2020 3:14 am
- Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Well, the odd thing is, all the other properties I'm incrementing with the same logic increase just fine...
It's only maxSpeed that isn't. Well, it does appear to increase once, but then resets itself.
BTW, testing on 1.82 atm, the min version specified in my manifest.plist... also on 1.90 - same result.
Code: Select all
this.shipWillDockWithStation = function(station) {
// incremental protective enhancements for the ship
if (this.$etLastSpeed<this.$etLimitSpeed) {
player.ship.maxSpeed++;
}
if (this.$etLastThrust<this.$etLimitThrust) {
player.ship.maxThrust++;
}
if (this.$etLastShields<this.$etLimitShields) {
player.ship.maxForwardShield++;
player.ship.maxAftShield++;
}
if (this.$etLastEnergy<this.$etLimitEnergy) {
player.ship.maxEnergy++;
}
if (this.$etLastRecharge<this.$etLimitRecharge) {
player.ship.forwardShieldRechargeRate++;
player.ship.aftShieldRechargeRate++;
}
// update last specs
this.$etLastSpeed=player.ship.maxSpeed;
this.$etLastThrust=player.ship.maxThrust;
this.$etLastShields=player.ship.maxForwardShield;
this.$etLastEnergy=player.ship.maxEnergy;
this.$etLastRecharge=player.ship.forwardShieldRechargeRate;
}
}
BTW, testing on 1.82 atm, the min version specified in my manifest.plist... also on 1.90 - same result.
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
If it resets, then there must be something else that is resetting it. Another OXP script maybe?
Here, have a look at this screenshot of the console checking maxSpeed:
We start at 350. Then do a maxSpeed++. It still shows 350, but it has incremented it already to 351. Then we do another ++ and it shows 351, but it has incremented it already to 352. And so on until it displays 354 and has incremented it to 355. At this point we just do a PS.maxSpeed and get back 355, as expected. I don't see a problem here.
Here, have a look at this screenshot of the console checking maxSpeed:
We start at 350. Then do a maxSpeed++. It still shows 350, but it has incremented it already to 351. Then we do another ++ and it shows 351, but it has incremented it already to 352. And so on until it displays 354 and has incremented it to 355. At this point we just do a PS.maxSpeed and get back 355, as expected. I don't see a problem here.
- Reval
- ---- E L I T E ----
- Posts: 402
- Joined: Thu Oct 29, 2020 3:14 am
- Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
No arguing with that
I'll try on a completly barebones install then...
I do have various oxps that play with speed - Torus to Sun Drive, injector cruise control etc.
Many thanks.
I'll try on a completly barebones install then...
I do have various oxps that play with speed - Torus to Sun Drive, injector cruise control etc.
Many thanks.
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.