[UPDATED RELEASE] - Escort Contracts OXP - 1.5.6 (07/05/12)
Moderators: winston, another_commander
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: [UPDATED RELEASE] - Escort Contracts OXP - 1.5.6 (07/05/
I completed an escort mission tonight, and when I went to get paid, had a strange-looking amount displayed on-screen.
After which, when I hit the spacebar, according to the manifest, my bank account had gone from over 80,000 credits to zero.. so I killed the game without saving.
We've seen these NaN things before with this OXP, but I thought that had all been fixed.
After which, when I hit the spacebar, according to the manifest, my bank account had gone from over 80,000 credits to zero.. so I killed the game without saving.
We've seen these NaN things before with this OXP, but I thought that had all been fixed.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
Re: [UPDATED RELEASE] - Escort Contracts OXP - 1.5.6 (07/05/
Sounds like an overflow?
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: [UPDATED RELEASE] - Escort Contracts OXP - 1.5.6 (07/05/
That was pretty much my take on it.. should have been a straight 287Cr job.. some kind of rounding problem, perhaps?
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
- Keeper
- ---- E L I T E ----
- Posts: 273
- Joined: Fri Feb 01, 2013 7:44 am
- Location: Indian Hills, Nevada, USA
Re: [UPDATED RELEASE] - Escort Contracts OXP - 1.5.6 (07/05/
Hmm. I've never seen this. Do you see this happen in 1.5.9?
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: [UPDATED RELEASE] - Escort Contracts OXP - 1.5.6 (07/05/
Yes.. this was with 1.5.9.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
- Keeper
- ---- E L I T E ----
- Posts: 273
- Joined: Fri Feb 01, 2013 7:44 am
- Location: Indian Hills, Nevada, USA
Re: [UPDATED RELEASE] - Escort Contracts OXP - 1.5.6 (07/05/
Hmm. I'm guessing then that {silly nonsense deleted} would at least solve the problem with it erasing your bank account because of the weird decimals. I don't think that would solve the weird amount display to begin with, though. Would it work to edit Escort_Contracts.js line 80 to be something like {more silly nonsense}? Would that force mission_ec_payment not to have a decimal value, or should .toFixed() get added to the other variables there?
Why it's coming up with a decimal value in the first place is the real mystery. There's absolutely no reason why that should happen. Bug in Oolite?
Why it's coming up with a decimal value in the first place is the real mystery. There's absolutely no reason why that should happen. Bug in Oolite?
Last edited by Keeper on Sat Jul 12, 2014 11:22 am, edited 1 time in total.
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: [UPDATED RELEASE] - Escort Contracts OXP - 1.5.6 (07/05/
It's only happened the once, to date.. on the second attempt at the same mission, everything worked as it should.. not that I've done much escort work of late..
As for your other questions, I'll leave those for cim or someone more knowledgeable to answer.
As for your other questions, I'll leave those for cim or someone more knowledgeable to answer.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
- Keeper
- ---- E L I T E ----
- Posts: 273
- Joined: Fri Feb 01, 2013 7:44 am
- Location: Indian Hills, Nevada, USA
Re: [UPDATED RELEASE] - Escort Contracts OXP - 1.5.6 (07/05/
Oh, that wouldn't work at all, because toFixed turns the number into a string. It could be used to help the display, but wouldn't solve that weird banking issue, I guess. Hmm. Well, the contractbaseprice (line 187) was not using Math.round, whereas contractactualprice and killsbonus were, so maybe that's where the problem lies. But contractbaseprice is only used to set up contractactualprice, which does have Math.round on it, so that couldn't be the problem... hmmmmm.
Only thing I can figure is that somehow Oolite corrupted the missionkills. I think this should solve it, changing line 80 to
which should ensure that your payment amount is a whole integer. This also should fix the display on the mission screen.
Does that sound right, programming gurus?
Only thing I can figure is that somehow Oolite corrupted the missionkills. I think this should solve it, changing line 80 to
Code: Select all
this.ec_payment = Math.round(this.ec_contractactualprice + (this.ec_missionkills * this.ec_killsbonus));
Does that sound right, programming gurus?
Re: [UPDATED RELEASE] - Escort Contracts OXP - 1.5.6 (07/05/
Math.round() won't help - call it on something which isn't a number, and it'll return NaN, which is exactly what you don't want. Decimal places aren't the problem anyway.
would guarantee that the value was an integer, but it might still be integer NaN, so that doesn't necessarily help here (and shouldn't be necessary)
I suspect the problem is that while the mission is running,is ... 287,211NaN.
I would advise rewriting the script a bit so that you use different
Having a variable that's sometimes a number and sometimes an array is going to cause problems. I suspect there's something going on with the array variable being saved to the mission variable in playerWillSaveGame (which converts it to a string) and then being read back as a string which can't properly be treated as a number, but it'll be easier to rename the variables than to try to debug that.
Code: Select all
parseInt(this.ec_contractactualprice + (this.ec_missionkills * this.ec_killsbonus))
I suspect the problem is that while the mission is running,
ec_contractactualprice
is (supposed to be) a number, but the F4 mission screen puts an array into the same variable name. Similarly for ec_killsbonus
. The result of doing this (two element ec_cap array, two element ec_kb array) is ...
Code: Select all
[287,211] + ([20,15] * 3)
I would advise rewriting the script a bit so that you use different
this.
variables on the F4 screen and for the in-mission parameters, and don't save them to the same mission variables either. The F4 screen is only saving to mission variables for string expansion when printed: you can use some temporary mission variables for that - or, better, use the option to pass a custom dictionary to expandMissionText
and don't touch mission variables at all at that stage.Having a variable that's sometimes a number and sometimes an array is going to cause problems. I suspect there's something going on with the array variable being saved to the mission variable in playerWillSaveGame (which converts it to a string) and then being read back as a string which can't properly be treated as a number, but it'll be easier to rename the variables than to try to debug that.
Re: [UPDATED RELEASE] - Escort Contracts OXP - 1.5.6 (07/05/
Just a minor nitpick.
Usually no ITHA line is displayed when there are no contracts, but sometimes I get "ITHA escort contracts (0 availabe)" in the F4 screen.
BTW, I've also seen these NaN eroors, but looks like this happens only when you take a contract and then save and exit the game.
Once you've loaded it and completed the contract, you get NaN.
Otherwise, this has never happened to me, so I never take one before saving/exiting the game.
Thanks,
V.
Usually no ITHA line is displayed when there are no contracts, but sometimes I get "ITHA escort contracts (0 availabe)" in the F4 screen.
BTW, I've also seen these NaN eroors, but looks like this happens only when you take a contract and then save and exit the game.
Once you've loaded it and completed the contract, you get NaN.
Otherwise, this has never happened to me, so I never take one before saving/exiting the game.
Thanks,
V.
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: [UPDATED RELEASE] - Escort Contracts OXP - 1.5.6 (07/05/
Thanks for that, it definitely explains what happened, and why it doesn't happen more often.. (it should be enough of a clue for the bug to be fixed now, too!)vaxon wrote:BTW, I've also seen these NaN eroors, but looks like this happens only when you take a contract and then save and exit the game.
Once you've loaded it and completed the contract, you get NaN.
Otherwise, this has never happened to me, so I never take one before saving/exiting the game.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
- Keeper
- ---- E L I T E ----
- Posts: 273
- Joined: Fri Feb 01, 2013 7:44 am
- Location: Indian Hills, Nevada, USA
Re: [UPDATED RELEASE] - Escort Contracts OXP - 1.5.6 (07/05/
I think I have fixed the NaN problem actually. I just haven't tested it.
Yeah, that "Contracts available: 0" thing is mysterious. It shouldn't happen, as there's code to repress the menu entry when the value is zero, and that code usually works. Sometimes, though, it just doesn't, for whatever reason. It doesn't break anything, so... whatever.
Yeah, that "Contracts available: 0" thing is mysterious. It shouldn't happen, as there's code to repress the menu entry when the value is zero, and that code usually works. Sometimes, though, it just doesn't, for whatever reason. It doesn't break anything, so... whatever.
Re: [UPDATED RELEASE] - Escort Contracts OXP - 1.5.6 (07/05/
Same thing happened to me yesterday that Diziet Sma experienced. I had saved & exited the game, and when mission was complete I had those same, crazy results in payment & zero credits. I also get the contracts available (0) on occasion.
Question: can you save, but not exit the game & have the mission work correctly?
Question: can you save, but not exit the game & have the mission work correctly?
Re: [UPDATED RELEASE] - Escort Contracts OXP - 1.5.6 (07/05/
png loading errors with v 1.5.9 , oxz version
Please correct them like this : (start in the oxz main folder)
see here for details
Sidenote :
all scripts in Scripts folder still have version 1.5.6 , this makes it harder to see which version is installed in latest log.
Code: Select all
00:58:46.026 [texture.load.png.warning]: ----- A PNG loading warning occurred for /home/panoramix/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/oolite.oxp.CaptMurphy.EscortContracts.oxz/Images/welcomeCom.png: iCCP: known incorrect sRGB profile.
00:58:46.124 [texture.load.png.warning]: ----- A PNG loading warning occurred for /home/panoramix/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/oolite.oxp.CaptMurphy.EscortContracts.oxz/Textures/EscortsMedallion_normals&Parallax.png: iCCP: known incorrect sRGB profile.
Code: Select all
cd /path/to/oxz/folder
cd Images
convert welcomeCom.png welcomeCom.png
cd ../Textures
convert EscortsMedallion_normals\&Parallax.png EscortsMedallion_normals\&Parallax.png
Sidenote :
all scripts in Scripts folder still have version 1.5.6 , this makes it harder to see which version is installed in latest log.
OS : Arch Linux 64-bit - rolling release
OXPs : My user page
Retired, reachable at [email protected]
OXPs : My user page
Retired, reachable at [email protected]
Re: [UPDATED RELEASE] - Escort Contracts OXP - 1.5.6 (07/05/
A useful feature here for future maintenance: if you don't specify the version at all in the script file, Oolite will fill it in automatically from theLone_Wolf wrote:Sidenote :
all scripts in Scripts folder still have version 1.5.6 , this makes it harder to see which version is installed in latest log.
manifest.plist