Cloaking Device script

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Cloaking Device script

Post by Smivs »

While working on an OXP project, I have discovered a problem with the cloaking device script (oolite-cloaking-device-pod.js)

Code: Select all

this.name			= "oolite-cloaking-device-pod";
this.author			= "Jens Ayton";
this.copyright		= "© 2007-2011 the Oolite team.";
this.version		= "1.75";


this.shipWasScooped = function (scooper)
{
	if (scooper.isPlayer)
	{
		if (player.ship.equipmentStatus("EQ_CLOAKING_DEVICE") !== "EQUIPMENT_OK")
		{
			player.ship.awardEquipment("EQ_CLOAKING_DEVICE");
			// Should we make it possible to repair?
			// EquipmentInfo.infoForKey("EQ_CLOAKING_DEVICE").effectiveTechLevel = 14;
		}
		else
		{
			player.ship.awardCargo("Gold", 100);
		}
	}
	// Should probably award 100 gold to non-player ships too, but they don’t have awardCargo at the moment.
};
The

Code: Select all

player.ship.awardCargo
is apparently no longer used.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Cloaking Device script

Post by Eric Walch »

Smivs wrote:
While working on an OXP project, I have discovered a problem with the cloaking device script (oolite-cloaking-device-pod.js)

The

Code: Select all

player.ship.awardCargo
is apparently no longer used.
Bad thing if you even can not thrust Oolites own code :P

Fixed now to:

Code: Select all

player.ship.manifest["gold"] += 100;
But I think that code-line will rarely be triggered because it assumes the player got a cloaking device in another way.

EDIT: Thinking about it.... The device should be much more valuable than just 100 kgs of gold.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Cloaking Device script

Post by Commander McLane »

@ Smivs: good catch! :D
Eric Walch wrote:
EDIT: Thinking about it.... The device should be much more valuable than just 100 kgs of gold.
Perhaps, but this is a very old feature. I wouldn't want to change it. And as you already noted, the player isn't really supposed to get his cloaking device in another way.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Cloaking Device script

Post by Smivs »

I should point out to be fair, it was McLane who told me "player.ship.awardCargo" was no longer used. A collaborative bug-report :D
Commander Smivs, the friendliest Gourd this side of Riedquat.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Cloaking Device script

Post by Switeck »

Then award 1000 kg of Platinum instead. 8)
(about 80k credits)
Post Reply