[UPDATE] Missile Spoof

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

Moderators: another_commander, winston

User avatar
Cmdr Wyvern
---- E L I T E ----
---- E L I T E ----
Posts: 1649
Joined: Tue Apr 11, 2006 1:47 am
Location: Somewhere in the great starry void

Re: [RELEASE] Missile Spoof

Post by Cmdr Wyvern »

UK_Eliter wrote:
Cmdr Wyvern: this is wonderful stuff. Thank you. However - and because of the fuel consumption and because I have a cloaking device - I might want to sell the equipment. But I don't seem able to do so.
A cloak is the ultimate ECM: When you cloak, incoming missiles lose lock and self-destruct. However, once damaged the cloak is a bugbear to get repaired, so you may be without it for some time if it gets shot up. The cloak has a cost-per-use as well; it gulps energy at a phenomenal rate.

Not to mention that one has to dodge a lot of missiles to get a cloak anyway.

Anyway, you should be happy with the updated missile spoof. It uses less fuel now, and is sellable. Keep your energy banks charged for when you really need to deploy the cloak.
"Those who cloak and inject away, live to see those pirates burn later." :twisted:
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1244
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

Re: [UPDATE] Missile Spoof

Post by UK_Eliter »

Wicked.
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: [UPDATE] Missile Spoof

Post by Lone_Wolf »

I was checking my installed oxp against the oxp list to see if there were newer versions, and noticed missile spoof is not yet in the oxp list.

Can somebody with a wiki account add it ?
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
User avatar
Cmdr Wyvern
---- E L I T E ----
---- E L I T E ----
Posts: 1649
Joined: Tue Apr 11, 2006 1:47 am
Location: Somewhere in the great starry void

Re: [UPDATE] Missile Spoof

Post by Cmdr Wyvern »

Done, sorta.
Missile Spoof is in a sense ACS v2.0, so you'll find it mentioned in the wiki entry for ACS.
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1244
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

Re: [UPDATE] Missile Spoof

Post by UK_Eliter »

I get errors in my log from the Spoofer, although the functionality seems OK:

03:24:06.703 [script.javaScript.exception.ooliteDefinedError]: ***** JavaScript exception (flares.js 1.0): Error: Cannot set property target of instance of Ship to invalid value undefined.
03:24:06.703 [script.javaScript.exception.ooliteDefinedError]: ../AddOns/missile_spoof.oxp/Scripts/spoof-flares.js, line 39.

Perhaps you need 'entity.isValid' in your 'isHostileMissile' routine? But I'm still new to this stuff, so I'm just guessing.
User avatar
Cmdr Wyvern
---- E L I T E ----
---- E L I T E ----
Posts: 1649
Joined: Tue Apr 11, 2006 1:47 am
Location: Somewhere in the great starry void

Re: [UPDATE] Missile Spoof

Post by Cmdr Wyvern »

UK_Eliter wrote:
I get errors in my log from the Spoofer, although the functionality seems OK:

03:24:06.703 [script.javaScript.exception.ooliteDefinedError]: ***** JavaScript exception (flares.js 1.0): Error: Cannot set property target of instance of Ship to invalid value undefined.
03:24:06.703 [script.javaScript.exception.ooliteDefinedError]: ../AddOns/missile_spoof.oxp/Scripts/spoof-flares.js, line 39.

Perhaps you need 'entity.isValid' in your 'isHostileMissile' routine? But I'm still new to this stuff, so I'm just guessing.
I'm using it on Oolite v1.75.3, and I'm seeing no log errors at all concerning the spoof.

I can confirm that it's 100% compatible with native missiles, Military Missile, Naval Torpedo, Nukes, Armory missiles, and M&B missiles. There should be few, if any, oxp missiles it won't work with.

What oolite version are you playing, and what missile oxps are you using?
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1244
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

Re: [UPDATE] Missile Spoof

Post by UK_Eliter »

Hi there

Missiles I have installed:

- military missile;
- the missiles from Missiles and Bombs;
- the missiles from Armoury OXP;
- the missiles from Aquatics;
- navel torpedo
(and whatever OXP gives the Thargoids projectiles - but I don't think that one is the cause, given the scenarios I have tested in).

**EDIT**: oh, and the upsetting ones from the Vector OXP.

I think it might be the script for my Fer-de-Lance 3G ships that are causing the problem. I don't know.

Oolite version: 1.75.3 beta.

PS: Here are some of the error messages from the log.

Code: Select all

01:29:36.234 [script.javaScript.warning.ooliteDefinedError]: ----- JavaScript warning (Missile Spoof 1.01 - for Oolite 1.75): Ship [PlayerShip "Fer-de-Lance 3G+" position: (58662.7, -76993.1, 590752) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT] was requested to fire ECM burst but does not carry ECM equipment.
  01:29:36.234 [script.javaScript.warning.ooliteDefinedError]:       ../AddOns/missile_spoof.oxp/Scripts/missile-spoof.js, line 12.

Code: Select all

01:30:20.625 [script.javaScript.warning.ooliteDefinedError]: ----- JavaScript warning (Missile Spoof 1.01 - for Oolite 1.75): Ship [PlayerShip "Fer-de-Lance 3G+" position: (60406.8, -80806.7, 578269) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT] was requested to fire ECM burst but does not carry ECM equipment.
01:30:20.625 [script.javaScript.warning.ooliteDefinedError]:       ../AddOns/missile_spoof.oxp/Scripts/missile-spoof.js, line 12.
Last edited by UK_Eliter on Tue Jul 19, 2011 4:09 am, edited 1 time in total.
User avatar
CommonSenseOTB
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed May 04, 2011 10:42 am
Location: Saskatchewan, Canada

Re: [UPDATE] Missile Spoof

Post by CommonSenseOTB »

UK_Eliter wrote:
Hi there

Missiles I have installed:

- military missile;
- the missiles from Missiles and Bombs;
- the missiles from Armoury OXP;
- the missiles from Aquatics;
- navel torpedo
(and whatever OXP gives the Thargoids projectiles - but I don't think that one is the cause, given the scenarios I have tested in).

I think it might be the script for my Fer-de-Lance 3G ships that are causing the problem. I don't know.

Oolite version: 1.75.3 beta.

PS: Here are some of the error messages from the log.

Code: Select all

01:29:36.234 [script.javaScript.warning.ooliteDefinedError]: ----- JavaScript warning (Missile Spoof 1.01 - for Oolite 1.75): Ship [PlayerShip "Fer-de-Lance 3G+" position: (58662.7, -76993.1, 590752) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT] was requested to fire ECM burst but does not carry ECM equipment.
  01:29:36.234 [script.javaScript.warning.ooliteDefinedError]:       ../AddOns/missile_spoof.oxp/Scripts/missile-spoof.js, line 12.

Code: Select all

01:30:20.625 [script.javaScript.warning.ooliteDefinedError]: ----- JavaScript warning (Missile Spoof 1.01 - for Oolite 1.75): Ship [PlayerShip "Fer-de-Lance 3G+" position: (60406.8, -80806.7, 578269) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT] was requested to fire ECM burst but does not carry ECM equipment.
01:30:20.625 [script.javaScript.warning.ooliteDefinedError]:       ../AddOns/missile_spoof.oxp/Scripts/missile-spoof.js, line 12.
Uhhh....UK_Eliter, let me guess, you don't have an ECM, right?

Cmdr Wyvern, I've posted the modified script with changes below that should work as I think that your script is trying to fire the player's ecm when it doesn't have one. This can be prevented with a check to see if the equipment is there just prior to firing.


this.shipAttackedWithMissile = function(missile, whom)
{
if(player.ship.fuel < 0.1 && player.ship.equipmentStatus("EQ_MISSILE_SPOOF") == "EQUIPMENT_OK")
{
if((player.ship.equipmentStatus("EQ_ECM") == "EQUIPMENT_OK"))
{
player.ship.fireECM();
}
player.consoleMessage("Fuel exausted. Cannot produce flares.",5);
}
else if(player.ship.fuel > 0.0 && player.ship.equipmentStatus("EQ_MISSILE_SPOOF") == "EQUIPMENT_OK")
{
if((player.ship.equipmentStatus("EQ_ECM") == "EQUIPMENT_OK"))
{
player.ship.fireECM();
}
player.ship.fuel -= 0.1;
system.legacy_addShipsWithinRadius("spoof_flare_package", 1, "abs", player.ship.position.subtract(player.ship.orientation.vectorUp().multiply(20)), 10);
}
}

If I understand things correctly that should take care of the problem for both of you. Cheers! :D
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.


CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1244
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

Re: [UPDATE] Missile Spoof

Post by UK_Eliter »

CommonSenseOTB

I do have an ECM. But I have the auto-ECM oxp too. Possibly that's the problem? I've got a cloaking device as well.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2286
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: [UPDATE] Missile Spoof

Post by Wildeblood »

UK_Eliter wrote:
I do have an ECM. But I have the auto-ECM oxp too. Possibly that's the problem?
Yes. Missile Spoof includes the autoECM function, using it and autoECM OXP together is sure to cause trouble.
User avatar
CommonSenseOTB
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed May 04, 2011 10:42 am
Location: Saskatchewan, Canada

Re: [UPDATE] Missile Spoof

Post by CommonSenseOTB »

UK_Eliter wrote:
CommonSenseOTB

I do have an ECM. But I have the auto-ECM oxp too. Possibly that's the problem? I've got a cloaking device as well.
Now I see the problem. The lack of a check for ecm in missile spoof still needs to be corrected, however you have ecm and auto-ecm. So, auto-ecm checks for the ecm and then fires it. This oxp script checks first because the script name starts with "a". Then the missile spoof script fires the ecm but it has already just been fired so I think that may be the reason for the error message pointing to exactly the same point in the missile spoof script that it would point to if there were no ecm. If this works the way I think it does then firing an ecm when it has already just been fired gives the same message as if there were no ecm to fire. Perhaps an additional check in missile spoof script to see if auto-ecm EQ is present before firing the ecm would work and also there may be some variables to check as well in auto-ecm for its condition I think.

Compatibility between oxps that do the same things under similar circumstances should be checked by preventing buying the oxp equipment if you have the other one just like shield equalizer and shield cycler do or if both are installed as equipment then one or both should check for the existence of the other and either deactivate its own function or deactivate the other oxp's function.

if it were me I would have the missile spoof script check for ecm EQ ok and auto-ecm EQ not ok before firing the ecm and tweak the script from there if necessary. Might be a good idea to check for other similar ecm oxps compatibility as well. Hope that helps and thanks for mentioning that you have auto-ecm UK_Eliter, that does make a difference in this case I believe. Good luck with that Cmdr Wyvern. :wink:
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.


CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2286
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: [UPDATE] Missile Spoof

Post by Wildeblood »

CommonSenseOTB wrote:
Now I see the problem. The lack of a check for ecm in missile spoof still needs to be corrected, however you have ecm and auto-ecm. So, auto-ecm checks for the ecm and then fires it. This oxp script checks first because the script name starts with "a".
More likely both scripts start executing at the same time, and AutoECM just gets there first because it's a much shorter script. If the game really runs scripts one at a time in alphabetical order then Aaron Aardvark could mess things up for everyone else.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2412
Joined: Mon May 31, 2010 11:11 pm

Re: [UPDATE] Missile Spoof

Post by Switeck »

AutoECM can be set to disabled mode even when equipped so it doesn't conflict.
...Which makes it a good device to have around as a backup if Missile Spoof gets damaged.
User avatar
Cmdr Wyvern
---- E L I T E ----
---- E L I T E ----
Posts: 1649
Joined: Tue Apr 11, 2006 1:47 am
Location: Somewhere in the great starry void

Re: [UPDATE] Missile Spoof

Post by Cmdr Wyvern »

I changed the main script to include checks for ECM, per OTB's suggestion -

Code: Select all

this.shipAttackedWithMissile = function(missile, whom)
		{
	if(missile.name == "Missile" && player.ship.equipmentStatus("EQ_MISSILE_SPOOF") == "EQUIPMENT_OK" && player.ship.equipmentStatus("EQ_ECM") == "EQUIPMENT_OK")
	{
	player.ship.fireECM();
	}
	else if(player.ship.fuel < 0.1 && player.ship.equipmentStatus("EQ_MISSILE_SPOOF") == "EQUIPMENT_OK")
		{
	if((player.ship.equipmentStatus("EQ_ECM") == "EQUIPMENT_OK"))
	{
	player.ship.fireECM();
	}
	player.consoleMessage("Fuel exausted. Cannot produce flares.",5);
}
	else if(player.ship.fuel > 0.0 && player.ship.equipmentStatus("EQ_MISSILE_SPOOF") == "EQUIPMENT_OK")
		{
	if((player.ship.equipmentStatus("EQ_ECM") == "EQUIPMENT_OK"))
	{
	player.ship.fireECM();
	}
	player.ship.fuel -= 0.1;
	system.legacy_addShipsWithinRadius("spoof_flare_package", 1, "abs", player.ship.position.subtract(player.ship.orientation.vectorUp().multiply(20)), 10);
	}
}
If this tests positive, then I'll upload an update in a day or so.

Meanwhile, UK_Eliter posted this error,

Code: Select all

03:24:06.703 [script.javaScript.exception.ooliteDefinedError]: ***** JavaScript exception (flares.js 1.0): Error: Cannot set property target of instance of Ship to invalid value undefined.
03:24:06.703 [script.javaScript.exception.ooliteDefinedError]: ../AddOns/missile_spoof.oxp/Scripts/spoof-flares.js, line 39.
...which has nothing to do with the spoof's main script, or ECM. The log error points to the script that lets flares distract missiles. I suspect a conflict with whatever oxp UK has that lets the Thargs fire missiles.
EDIT - Or Vector.oxp, which adds some weird npc missiles to the game.
In either case, flares.js is a modded script for chaff from M&B, so likely those missiles error out M&B chaff and autochaff as well.
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2412
Joined: Mon May 31, 2010 11:11 pm

Re: [UPDATE] Missile Spoof

Post by Switeck »

I vaguely recall some missiles that don't have a scan class of missile in order to confuse/screw with precisely those OXPs that generate missile-distracting chaff.
Post Reply