Missile Countermeasures OXP (v 0.2)
Moderators: winston, another_commander
Missile Countermeasures OXP (v 0.2)
Hi,
if anyone is tired of missiles and doesn't like to use the MASC or wants more security for moments when the MASC won't help, try this toy! It's also much more fun than using the MASC
It's basically an advancement to the Chaff Launcher by Ramirez and the Anti Missile System by Thargoid. As a result, it's not compatible with existing AMS on your ship as both would activate together, but the oxp itself is compatible to AMS.
Please test it and let me know of any problems!
http://www.box.net/shared/91dchnlecf
EDIT: updated link to v.0.2
It's a first test version, but the testers so far have reported no problems.
Version 0.2 now should access equipment price factor on oolite nightly builds. There was accidentally still some dependency on another oxp and I also did add auto-ECM for standard missiles and slightly reduced the dart price.
Screet
if anyone is tired of missiles and doesn't like to use the MASC or wants more security for moments when the MASC won't help, try this toy! It's also much more fun than using the MASC
It's basically an advancement to the Chaff Launcher by Ramirez and the Anti Missile System by Thargoid. As a result, it's not compatible with existing AMS on your ship as both would activate together, but the oxp itself is compatible to AMS.
Please test it and let me know of any problems!
http://www.box.net/shared/91dchnlecf
EDIT: updated link to v.0.2
It's a first test version, but the testers so far have reported no problems.
Version 0.2 now should access equipment price factor on oolite nightly builds. There was accidentally still some dependency on another oxp and I also did add auto-ECM for standard missiles and slightly reduced the dart price.
Screet
Since editing the entry didn't push the thread up, I'm doing it this way now. Most of the initial downloaders haven't switched to the new version and I guess it's simply been missed.
You really should update to version 0.2! Otherwise you may suffer massively reduced efficiency of the MCM system...
Screet
You really should update to version 0.2! Otherwise you may suffer massively reduced efficiency of the MCM system...
Screet
- Greyman
- Dangerous
- Posts: 98
- Joined: Thu Jun 05, 2008 5:54 pm
- Location: somewhere in the Bavarian outback
I guess I found a small bug. So here's the feedback:
When buying a Chaff refill at a station I end up with a huge number of credits.
I have 71.700Cr and buy Chaff refill for 3.000Cr and end up with 4.294.966.729Cr!
Otherwise, I like the idea of this piece of equipment. I also think the pricing is adequate (as long as your Credits aren't multiplied by refilling).
When buying a Chaff refill at a station I end up with a huge number of credits.
I have 71.700Cr and buy Chaff refill for 3.000Cr and end up with 4.294.966.729Cr!
Otherwise, I like the idea of this piece of equipment. I also think the pricing is adequate (as long as your Credits aren't multiplied by refilling).
Get the Oolite Keymapper for Mac here!
Uhh...sounds like trouble with an older version of oolite delivering a wrong value - I wrote code to check for a proper oolite version in order to apply equipment price factor, but it seems it's not working as intended.Greyman wrote:Otherwise, I like the idea of this piece of equipment. I also think the pricing is adequate (as long as your Credits aren't multiplied by refilling).
In mcm_system.js there are two lines like this:
Code: Select all
priceFactor = player.ship.dockedStation.equipmentPriceFactor;
Which version of oolite are you running?
Hmmm. Just thinking...I didn't check for values of
Code: Select all
<key>mission_mcm_chaff_count</key>
<key>mission_mcm_dart_count</key>
Screet
- Greyman
- Dangerous
- Posts: 98
- Joined: Thu Jun 05, 2008 5:54 pm
- Location: somewhere in the Bavarian outback
Hello,
thanks for the advice! I changed the script as proposed and it works like a charm.
I'm using Oolite version 1.73.4 and while checking the save file i found the following:
So both keys seem to be of positive value. Even though I don't understand why they are strings and not integers.
Greyman
thanks for the advice! I changed the script as proposed and it works like a charm.
I'm using Oolite version 1.73.4 and while checking the save file i found the following:
Code: Select all
<key>mission_mcm_chaff_count</key>
<string>23</string>
<key>mission_mcm_dart_count</key>
<string>6</string>
Greyman
Get the Oolite Keymapper for Mac here!
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
They must be correct as the code is:Greyman wrote:So both keys seem to be of positive value. Even though I don't understand why they are strings and not integers.
Code: Select all
player.credits += (priceFactor * 12000/6)*missionVariables.mcm_dart_count;
missionVariables.mcm_dart_count = 6;
On the second question: missionVariable are always stored as strings. That way it can contain everything.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Greyman
- Dangerous
- Posts: 98
- Joined: Thu Jun 05, 2008 5:54 pm
- Location: somewhere in the Bavarian outback
Thank you for the explanation. I am not much of a programmer but it seemed odd to me to have number values stored as strings and then used as a multiplication factor without any conversion.
Get the Oolite Keymapper for Mac here!
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Mission variables are always stored as strings because the legacy scripting mechanism only supports string variables (although it can do arithmetic on strings containing numerical values). This isn’t especially unusual for high-level scripting languages.
For JavaScript, mission variables with a purely numeric values are converted to numbers when retrieved, and setting a mission variable to a number converts it to a string behind the scenes; in other words, mission variables can be numbers or strings in the JavaScript programming interface but are always strings internally and in saved games. Changing this (at least in the saved games) would break backwards-compatibility.
For JavaScript, mission variables with a purely numeric values are converted to numbers when retrieved, and setting a mission variable to a number converts it to a string behind the scenes; in other words, mission variables can be numbers or strings in the JavaScript programming interface but are always strings internally and in saved games. Changing this (at least in the saved games) would break backwards-compatibility.
E-mail: [email protected]