Tinkerer's Workshop - OXP tweaking for fun and profit!

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

Moderators: winston, another_commander

User avatar
Reval
---- E L I T E ----
---- 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!

Post by Reval »

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 :)
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
dybal
---- E L I T E ----
---- E L I T E ----
Posts: 499
Joined: Mon Feb 10, 2020 12:47 pm

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Post by dybal »

Reval wrote: Mon Nov 09, 2020 11:12 am
Thanks. 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)?
Market Observer keeps a buy log
User avatar
Reval
---- E L I T E ----
---- 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!

Post by Reval »

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.
User avatar
Reval
---- E L I T E ----
---- 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!

Post by Reval »

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?
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
User avatar
Reval
---- E L I T E ----
---- 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!

Post by Reval »

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)?
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Post by another_commander »

Yes. You can easily verify that in the debug console if you are at a high tech level system and execute:

Code: Select all

player.ship.serviceLevel = 80
Now if you go to the F3 screen you get the Maintenance Overhaul option. Next execute

Code: Select all

player.ship.serviceLevel = 100
and now the Maintenance Overhaul option is gone from the F3 screeen.
User avatar
Reval
---- E L I T E ----
---- 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!

Post by Reval »

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?
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Post by another_commander »

Try maxForwardShield (with a capital F). All these properties are case sensitive.
User avatar
Reval
---- E L I T E ----
---- 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!

Post by Reval »

Oops. And is it equivalent to max_ energy?
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Post by another_commander »

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.
User avatar
Reval
---- E L I T E ----
---- 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!

Post by Reval »

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 -

Code: Select all

if (this.$etLastSpeed<this.$etLimitSpeed) player.ship.maxSpeed++;
but it stays constant, refusing to increment.
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Post by another_commander »

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.
User avatar
Reval
---- E L I T E ----
---- 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!

Post by Reval »

Well, the odd thing is, all the other properties I'm incrementing with the same logic increase just fine...

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;
	}
}
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. :?
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Post by another_commander »

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:
Image
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.
User avatar
Reval
---- E L I T E ----
---- 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!

Post by Reval »

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.
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
Post Reply