18 Trillion Credits ! Dredger Oxp "Bug"

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

Moderators: winston, another_commander, Getafix

Post Reply
Rocky Racoon
Mostly Harmless
Mostly Harmless
Posts: 2
Joined: Sun Nov 22, 2009 5:32 pm

18 Trillion Credits ! Dredger Oxp "Bug"

Post by Rocky Racoon »

Having salvaged (using the Dredger.oxp - Salvage Missile) a small ship I was surprised to be award 429 Million Credits, it certainly made my hours of shipping between Lave and Diso look pretty paltry.
However, I now know this was a bug (fixed) in Dredgers 2.2.6, corrected in 2.2.7.
The problem is when I loaded in 2.2.7 and loaded up Oolite (1.74) , I now have 18 Thousand Trillion credits.

My problem is..how do I get back to my original "4500" credits I had amassed ? Is there an oxp that "cheats" money backwards, or can I alter the save game somehow ?

I hate the feeling of "cheating" and am disinclined to start again, can anyone help ?

Thanks

Rocky
User avatar
CheeseRedux
---- E L I T E ----
---- E L I T E ----
Posts: 827
Joined: Fri Oct 02, 2009 6:50 pm

Post by CheeseRedux »

To alter your savegame, simply open it up in a text editor (beware of the evil Notepad if you're on Windows) and search for <key>credits</key>
The next line reads <integer>2564510</integer>, where 2564510 is whatever # of credits you have.
Note that 2564510 translates into 256451.0 in-game, so to get 4500Cr, you need to put 45000.

Hope that helps.

PS Don't forget to make a backup before mucking around with anything, just in case.
"Actually this is a common misconception... I do *not* in fact have a lot of time on my hands at all! I just have a very very very very bad sense of priorities."
--Dean C Engelhardt
Rocky Racoon
Mostly Harmless
Mostly Harmless
Posts: 2
Joined: Sun Nov 22, 2009 5:32 pm

Thanks !

Post by Rocky Racoon »

Perfect..I'm back to being happy...but poor.

Thanks a lot for your help !!!

Rocky
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

I have been thinking. This bug was caused by using an undefined variable. Should not happen but it did. And sooner or later it will happen in an other oxp.

Would it be an idea to maximise the amount of credits you can award with a single JS command to one million? That way a similar bug would have less drastic results and deliberately awarding credits of this amount is not likely.

It just takes one additional check. Just added it in my version. Oolite itself can not check the integrity of the added sum as it has become a technical valid sum when added by the JS command.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6633
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Eric Walch wrote:
Would it be an idea to maximise the amount of credits you can award with a single JS command to one million? That way a similar bug would have less drastic results and deliberately awarding credits of this amount is not likely.
I don't think it would help much. There would still be an enormous amount of money added without the scripter's intention. I don't think it changes much what happens now. It would be best if the addition of credits is not performed at all if the parameter variable(s) is/are undefined. Haven't checked the code to know how feasible this is, but I think it would be a preferred method of confronting this.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

another_commander wrote:
Eric Walch wrote:
Would it be an idea to maximise the amount of credits you can award with a single JS command to one million? That way a similar bug would have less drastic results and deliberately awarding credits of this amount is not likely.
I don't think it would help much. There would still be an enormous amount of money added without the scripter's intention.
And I just realised it also not can work because the script does not add a value but sets the whole new value. In case the player has 5.000.000 credits, adding 10 credits would force to write a credits number of 5.000.010 :cry:
This check gives no solution.
Post Reply