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

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 »

A good strategy when creating OXPs is to not have any others installed. With 600+ expansions and increasing it is very easy for cross-talk between OXPs to occur. If your expansion depends on others, just install whatever is absolutely necessary for it to function and nothing else.

The same is good practice when reporting bugs too. Unless a reported bug can be reproduced without any OXPs present, chances that one of the core devs will dedicate time to it are small.
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 »

I haven't come across it anywhere in the Wiki, but is there a method for changing the player's legal status? Is it possible at all?
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
User avatar
montana05
---- E L I T E ----
---- E L I T E ----
Posts: 1166
Joined: Mon May 30, 2016 3:54 am
Location: lurking in The Devils Triangle (G1)

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

Post by montana05 »

Reval wrote: Fri Nov 20, 2020 8:09 am
I haven't come across it anywhere in the Wiki, but is there a method for changing the player's legal status? Is it possible at all?
try bounty in the Oolite JavaScript Reference: Ship:

bounty : Number (read/write integer)

The bounty on the ship.

In 1.77, changes to the bounty are given a reason. If you change this directly, the reason sent to shipBountyChanged will be "scripted". To set a different reason, use setBounty instead.
Scars remind us where we've been. They don't have to dictate where we're going.
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 »

Thanks.

Would anyone happen to know the acceptable maxima for a ship's maxForwardShields, maxEnergy, maxRechargeRate? ie. 0..???
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 »

All three appear to be unlimited.
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 »

What is a "non-localised name"? - as in the following:

The playerSoldCargo handler is called when cargo is sold at the market screen. commodity contains the non-localised name for the cargo. You can get the localised name using expandDescription("[commodity-name "+commodity+"]");
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 »

It is the commodity name that the game sees internally and refers to. The localized name is the name used for displaying on screen and has to be a sεparate thing from the non-localized name because it can be used in potential localization OXPs (e.g. Italian, Russian, etc). The same goes for pretty much everyhting in the game. Ships for example have a name and a displayName property for this reason.
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 »

How does one change the colour of a HUD's energy bars? I've tried just about everything in hud.plist, including things like

color_medium = "newColor";
color_high = "newColor";

and

color = "newColor";

and

rgb_color = (X,X,X);

('new' here being any of the Wiki's documented colour values, like cyan, yellow, orange, magenta etc) ...
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 »

Code: Select all

{	// speed bar, can draw a surround 2 units out from the dial size specified
	draw_surround	= yes;
	height		= 8;
	selector	= "drawSpeedBar:";
	width		= 80;
	x		= 200;
	y		= 95;
	y_origin	= -1;
	color_medium = "blueColor";
},
This works for me.
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 »

Many thanks, but that didn't work for me, I'm afraid. The bars stay yellow :(

Edit - but it's the Energy bars I'm trying to change.
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 »

OK, this works for me:

Code: Select all

{	// energy gauge, can draw a surround 2 units out from the dial size specified
	draw_surround	= yes;
	height		= 48;
	selector	= "drawEnergyGauge:";
	width		= 80;
	x		= 200;
	y		= 35;
	y_origin	= -1;
	labelled	= yes;
	color_medium = "blueColor";
},
For the energy bars, you only get color_medium and color_low. There is no color_high there.
Edit: Also, retry after removing all OXPs.
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 »

Again, changing color_medium only gave me the usual yellow bars. Here's my entire (non-working) entry:

Code: Select all

		{	// energy gauge, can draw a surround 2 units out from the dial size specified
			draw_surround	= yes;
			height		= 48;
			selector	= "drawEnergyGauge:";
			width		= 80;
			x		= 200;
			y		= 35;
			y_origin	= -1;
			labelled	= no;
			color_medium = "orangeColor";			
		},

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 »

another_commander wrote: Wed Nov 25, 2020 10:07 am
Edit: Also, retry after removing all OXPs.
Ah, OK, I'll give it a go on a clean install...

Edit: even on a completely non-OXP's install, my energy bars remain yellow.
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 »

And, FWIW, here's my entire hud.plist:

Code: Select all

{
	crosshair_scale		= 32.0;
	crosshair_width		= 1.5;
	crosshair_color		= "greenColor";
	dials			= //these are drawn, in order, after the legends
	(
		{	// Targeting enhancement
			equipment_required 	= "EQ_SCANNER_SHOW_MISSILE_TARGET";
			selector		= "drawTargetReticle:";
			// reticle_scale = 0.015625 /* 1/64 is default */
			target_rgba = "greenColor";
			target_sensitive_rgba = "redColor";
			wormhole_rgba = "cyanColor";
		},
		{	// Waypoint display
			equipment_required 	= "EQ_ADVANCED_COMPASS";
			selector		= "drawWaypoints:";
		},
		{	// scanner
			alpha		= 1.0;
			selector	= "drawScanner:";
			x		= 0;
			y		= 68;
			y_origin	= -1;
			height		= 64.0;
			width		= 288.0;
			rgb_color	= (0.0, 0.4, 0.3);
		},
		{	// scanner zoom indicator
			alpha		= 1.0;
			selector	= "drawScannerZoomIndicator:";
			x		= 100;
			y		= 36;
			y_origin	= -1;
		},
		{	// compass
			alpha		= 1.0;
			selector	= "drawCompass:";
			x		= 132;
			y		= 32;
			y_origin	= -1;
			rgb_color	= (0.0, 0.5, 0.4);
		},
		{	// station aegis
			alpha		= 1.0;
			selector	= "drawAegis:";
			x		= -132;
			y		= 32;
			y_origin	= -1;
		},
		{	// fuel scoop status
			alpha		= 0.75;
			selector	= "drawScoopStatus:";
			x		= -132;
			y		= 92;
			y_origin	= -1;
		},
		{	// speed bar, can draw a surround 2 units out from the dial size specified
			draw_surround	= yes;
			height		= 8;
			selector	= "drawSpeedBar:";
			width		= 80;
			x		= 200;
			y		= 94;
			y_origin	= -1;
		},
		{	// Reval - digital speed
			data_source = "shipSpeed"; 
			selector = "drawCustomText:";
            alert_conditions = 14; // hide when docked
			alpha = 1.0; 
			height = 13; 
			width = 15; 
			x = 180; 
			y = 68; 
			y_origin = -1; 
		},
		{	// energy gauge, can draw a surround 2 units out from the dial size specified
			draw_surround	= yes;
			height		= 48;
			selector	= "drawEnergyGauge:";
			width		= 80;
			x		= 200;
			y		= 35;
			y_origin	= -1;
			labelled	= no;
			color_medium = "orangeColor";			
		},
		{	// forward shield bar, can draw a surround 2 units out from the dial size specified
			draw_surround	= yes;
			height		= 8;
			selector	= "drawForwardShieldBar:";
			width		= 80;
			x		= -200;
			y		= 94;
			y_origin	= -1;
		},
		{	// aft shield bar, can draw a surround 2 units out from the dial size specified
			draw_surround	= yes;
			height		= 8;
			selector	= "drawAftShieldBar:";
			width		= 80;
			x		= -200;
			y		= 78;
			y_origin	= -1;
		},
		{	// just draws a surround 2 units around the selected size
			height		= 40;
			color		= "yellowColor";
			selector	= "drawSurround:";
			width		= 80;
			x		= -200;
			y		= 46;
			y_origin	= -1;
		},
		{	// fuel bar
			height		= 8;
			selector	= "drawFuelBar:";
			width		= 80;
			x		= -200;
			y		= 61;
			y_origin	= -1;
		},
		{	// cabin temperature bar
			height		= 8;
			selector	= "drawCabinTempBar:";
			width		= 80;
			x		= -200;
			y		= 51;
			y_origin	= -1;
		},
		{	// weapon temperature bar
			height		= 8;
			selector	= "drawWeaponTempBar:";
			width		= 80;
			x		= -200;
			y		= 41;
			y_origin	= -1;
		},
		{	// altitude bar
			height		= 8;
			selector	= "drawAltitudeBar:";
			width		= 80;
			x		= -200;
			y		= 31;
			y_origin	= -1;
		},
		{	// missile display, x and y give the location, the x-spacing is given by spacing, the size defines the icon size
			height		= 12;
			selector	= "drawMissileDisplay:";
			spacing		= 16;
			width		= 12;
			x		= -228;
			y		= 16;
			y_origin	= -1;
		},
		{	// status indicator light, x and y give the location, the size defines the icon size
			height		= 8;
			selector	= "drawStatusLight:";
			width		= 8;
			x		= -108;
			y		= 32;
			y_origin	= -1;
		},
		{	// ship's clock, x and y give the location, the size defines the character size
			height		= 12;
			selector	= "drawClock:";
			width		= 12;
			x		= -41;
			y		= 18;
			y_origin	= -1;
			rgb_color	= (0.0, 0.5, 0.4);
		},
		{	// primed equipment, x and y give the location, the size defines the character size, n_bars is the number of items to show (default 1)
			selector	= "drawPrimedEquipment:";
			y_origin = -1;
			x = 156;
			y = -2;
			width		= 10;
			height		= 10;
			rgb_color	= (0.0, 0.6, 0.5);
		},
		{	// compass beacon/waypoint ID, x and y give the location, the size defines the character size
			equipment_required 	= "EQ_ADVANCED_COMPASS";
			selector		= "drawASCTarget:";
			height		= 12;
			width		= 12;
			x		= 144;
			y		= 4;
			y_origin	= -1;
			align = 1;
			rgb_color	= (1.0, 1.0, 1.0); // target names in white
		},
		{	// weapons systems offline text, x and y give the location, the size defines the character size
			height		= 10;
			selector	= "drawWeaponsOfflineText:";
			width		= 10;
			y_origin = -1;
			x = -51; // Reval - was -51 (screen center)
			y = -2; // Reval - was -51 (screen center)
			rgb_color	= (0.0, 0.5, 0.4);
		},
		{	// fps counter, x and y give the location, the size defines the character size
			height		= 18;
			selector	= "drawFPSInfoCounter:";
			width		= 18;
			x		= -300;
			y		= -20;
			y_origin	= 1;
			rgb_color	= (0.0, 1.0, 0.0, 1.0);
		}
	);
	
	legends		= // these are drawn, in order, before the dials, add any other images you want here
	(
		{	// LHS
			text		= "FWD";
			align		= 1;
			x		= -245;
			y		= 86;
			y_origin	= -1;
			height		= 12;
			width		= 12;
			with_dial	= "drawForwardShieldBar:";
			color = (0.0, 0.5, 0.4);
		},
		{	text		= "AFT";
			align		= 1;
			x		= -245;
			y		= 70;
			y_origin	= -1;
			height		= 12;
			width		= 12;
			with_dial	= "drawAftShieldBar:";
			color = (0.0, 0.5, 0.4);
		},
		{
			text		= "FUEL";
			align		= 1;
			x		= -245;
			y		= 55;
			y_origin	= -1;
			height		= 10;
			width		= 10;
			with_dial	= "drawFuelBar:";
			color = (0.0, 0.5, 0.4);
		},
		{
			text		= "CT";
			align		= 1;
			x		= -245;
			y		= 45;
			y_origin	= -1;
			height		= 10;
			width		= 10;
			with_dial	= "drawCabinTempBar:";
			color = (0.0, 0.5, 0.4);
		},
		{
			text		= "LT";
			align		= 1;
			x		= -245;
			y		= 34;
			y_origin	= -1;
			height		= 10;
			width		= 10;
			with_dial	= "drawWeaponTempBar:";
			color = (0.0, 0.5, 0.4);
		},
		{
			text		= "ALT";
			align		= 1;
			x		= -245;
			y		= 24;
			y_origin	= -1;
			height		= 10;
			width		= 10;
			with_dial	= "drawAltitudeBar:";
			color = (0.0, 0.5, 0.4);
		},
		{
			text		= "MISS";
			align		= 1;
			x		= -245;
			y		= 3;
			y_origin	= -1;
			height		= 14;
			width		= 14;
			with_dial	= "drawMissileDisplay:";
			color = (0.0, 0.5, 0.4);
		},
		{	// on a separate line with speed readout
			text		= "SPD";
			x		= 155;
			y		= 68;
			y_origin	= -1;
			height		= 14;
			width		= 14;
			with_dial	= "drawSpeedBar:";
			color = (0.0, 0.5, 0.4);
		},
	);
	multi_function_displays = (
		{
			width = 198;
			height = 132;
			x = -156;
			y = -72;
			y_origin = 1;
		},
		{
			width = 198;
			height = 132;
			x = 156;
			y = -72;
			y_origin = 1;
		}
	);
	message_gui = {
		width = 252;
		height = 140;
		x = 128;
		y = -60;
		row_height = 14;
		permanent = no;
		background_automatic = yes;
		// default background transparent
		background_rgba = "0.0 0.05 0.45 0.0";
		text_color = "yellowColor";
		text_comms_color = "greenColor";
	};
	comm_log_gui = {
		alpha = "0.75";
		width = 216;
		height = 132;
		x = -156;
		y = -68;
		row_height = 12;
		permanent = no;
		automatic = yes;
		background_rgba = "0.0 0.05 0.45 0.5";		
	};
	overall_alpha	= 0.75;
	reticle_target_sensitive = no;
	cloak_indicator_on_status_light = yes;
	scanner_minimalistic = yes;
	scanner_non_linear = yes;
	scanner_ultra_zoom = yes;
}

And perhaps it might be relevant to add that this is an OXP - I'm no longer tinkering with the original hud.plist in Resources/Config. All my other colour changes work fine.
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 »

Did a Select All and pasted your code into an AddOns\TestHUD.oxp\Config\hud.plist file. Run the game, orange bars visible right away without changing anything in your code.
Post Reply