Page 1 of 1

Trouble making a new piece of kit

Posted: Thu Aug 21, 2014 8:32 pm
by Redspear
Hi folks,

I'm trying to create some new pieces of equipment that exist as dependencies upon which to install other items.

e.g.

Code: Select all

	(
		100, 1, "Medium Sized Hull",
		"EQ_MEDIUM_HULL",
		"Enables fitting of medium sized equipment.",
		{
			condition_script = "oolite-conditions.js";
			available_to_all = true;
			visibile = false;
			damage_probability = 0;
		}
	),
I've put tech level as 100 because I don't want it to appear for sale (and "1" is just a token value for testing) but I have added some shipdata-overrides to add it as standard equipment to some ships as below:

Code: Select all

	"asp-player" =
	{
		"standard_equipment" =
		{
			extras =
			(
			"EQ_MEDIUM_HULL"
			);
		};
	};
No luck, even when buying a new ship :| ...

If I change visible to "true" and lower the tech level, then they appear for sale (and behave as expected) but never as standard, pre-installed equipment.

I even tried writing a script to add them (new territory for me, so it was almost certainly broken in some way) with player.ship.awardEquipment
but right now it's just not happening.

Any ideas?

Re: Trouble making a new piece of kit

Posted: Thu Aug 21, 2014 8:57 pm
by Norby
Redspear wrote:
I have added some shipdata-overrides
You mean shipyard-overrides (and include every lines from the original shipyard).
Redspear wrote:
a script to add them

Code: Select all

this.startUp = this.playerBoughtNewShip = function() {
  if(player.ship.dataKey=="asp-player") 
    player.ship.awardEquipment("EQ_MEDIUM_HULL");
}

Re: Trouble making a new piece of kit

Posted: Thu Aug 21, 2014 8:58 pm
by cim
Redspear wrote:
I have added some shipdata-overrides
First to check the really obvious one - do you mean shipyard-overrides here?

Note that items in standard_equipment are never advertised as being part of the ship's equipment on F3F3 - and that goes double for invisible ones. Have you actually checked with the debug console or similar that after buying the Asp it doesn't have the equipment fitted?

Note that shipyard-overrides replaces rather than merges at the level of the sub-keys. So to avoid removing the Asp's other standard equipment, you'd need to do this instead:

Code: Select all

		"standard_equipment" =
		{
			extras =
			(
                "EQ_SCANNER_SHOW_MISSILE_TARGET",
                "EQ_TARGET_MEMORY",
                "EQ_MEDIUM_HULL"
			);
			"forward_weapon_type" = "EQ_WEAPON_PULSE_LASER";
			missiles = 1;
		};

Re: Trouble making a new piece of kit

Posted: Thu Aug 21, 2014 9:02 pm
by Thargoid

Code: Select all

visibile = false;
The above certainly won't help - visible only has 2 i's in it...

Re: Trouble making a new piece of kit

Posted: Thu Aug 21, 2014 10:34 pm
by Redspear
Sorry, it seems I wasn't very clear.

Yes, I mean shipyard-overrides; apologies for the careless typing...

...which explains this:
Thargoid wrote:

Code: Select all

visibile = false;
The above certainly won't help - visible only has 2 i's in it...
Well spotted Thargoid and thanks.

As for visibility of the equipment. When set to visible, with low tech, they show on F3 (for purchase) and seem to exhibit the dependencies asked of them.
I'm reasoning that they are not installed on a newly purchased craft because, upon purchasing the ship, they neither display on F5 (when set to visible), nor am I prevented from buying them on F3 (I shouldn't be able to buy them if they were already installed, right?)

Thanks cim: I didn't know about the replace not merge issue, but I have also tried editing the equipment.plist itself and even including all of the shipyard info in the override file.
Norby wrote:

Code: Select all

this.startUp = this.playerBoughtNewShip = function() {
  if(player.ship.dataKey=="asp-player") 
    player.ship.awardEquipment("EQ_MEDIUM_HULL");
}
That code has something mine was missing, I'll give it a try, thanks.

Thanks for your time.