I am robbed

General discussion for players of Oolite.

Moderators: winston, another_commander

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

I am robbed

Post by Eric Walch »

Strange thing just happened to me. My credits account was over 3 000 000 cr. I left my ship unattended hanging just outside the station aegis for a few hours. when coming back I flew the last part to the station, docked, refuelled and repaired my damaged energy bomb. As last I wanted to repair my shield boosters. This needed repair was the main reason I flew to this level 13 system.

Repair didn't work. I tried several times but always heard a beep. Then I noticed my account. 3820.5 credits and repair is 7375 cr. Clearly to low. There is something fishy going on. I don't know if I am robed during my absence or during buying fuel or repairing the bomb.

Strange thing however is that equipment that it to expensive to buy normally does not show at all. But I now see the repair: Shield boosters option and also the Maintenance Overhaul of 8000.0 cr And even the Galactic Hyperdrive.

I saved under a new name, restarted Oolite with cleared cache and opened that file again. Still to low credits and things for sale that I can not afford.

-----
Went back to me previous saved file in a system earlier: 4223.3 credits. So the robbing took place before.

Than I opened a still older file: 3 503 241.9 credits. Oeff. Saved my money and only 1 day old that file. I normally use a new name only every few weeks.

Was this a bug or an oxp that robs people?

------
Remembering what I did in the meantime was working on the oo-haul script. Hmm. That oxp uses a js script for the subentities. But that is not only used for the mission script but for all oo-haul ships. I added a few lines, but those should only be active for the mission ship. They should be changed to:

Code: Select all

this.shipDied = function(whom, why)
{
	this.ship.owner.spawn("oohaulcargo", 10);
	if(this.ship.owner.primaryRole = "oohaulermisgo")
	{
		missionVariables.oohaul_credits -= 500 // decrement credits with 500 on each death.
		if(--missionVariables.oohaul_cargo == 0) missionVariables.oohaul_credits = 500  // decrement by one. And when zero set credits to 500.
	}
}
Still, I never saved during testing and only saved once after doing a full escort. And the bonus it added was written on screen and was correct. So I'm still puzzled were my money went. A few dozen times -500 to much does not account for my loss.
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

perhaps you are responsible for every dead oo-haul ship everywhere, in the whole Ooniverse!!
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: I am robbed

Post by Kaks »

Hmmm,

Code: Select all

	if(--missionVariables.oohaul_cargo == 0)
checks if the variable is 0, but what happens if the variable is less than 0? It will fail to set oohaul_credits to 500! That way you could get huge negative amounts in oohaul_credits...

I'd definitely change that condition to

Code: Select all

	if(--missionVariables.oohaul_cargo <= 0)
just in case...
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
tomsk
Dangerous
Dangerous
Posts: 66
Joined: Sun Jan 11, 2009 12:21 pm
Location: under my Cobra's hood...

Post by tomsk »

The credit crunch has reached the ooniverse.
User avatar
DeepSpace
Deadly
Deadly
Posts: 157
Joined: Tue May 29, 2007 6:35 pm
Location: A small asteroid in the Tionisla System.
Contact:

Post by DeepSpace »

@tomsk - that is a genuis statement!!!
- Deepspace doffs his hat - :lol:
http://www.jblythe.f9.co.uk/oolite

"Smoke me a kipper, I'll be back it time of Breakfast!"
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post by Screet »

tomsk wrote:
The credit crunch has reached the ooniverse.
Maybe we need some Random Hits mission to shoot down a bankster? :twisted:

Screet
User avatar
Rxke
Retired Assassin
Retired Assassin
Posts: 1760
Joined: Thu Aug 12, 2004 4:54 pm
Location: Belgium

Post by Rxke »

AFAIK, equipment too expensive to buy is listed.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Rxke wrote:
AFAIK, equipment too expensive to buy is listed.
This is correct, as can already be seen at the Lave shop.
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 »

After sending my message I realised what really went wrong. OO-Haul is not to blame, although the little code error could lower the reward several times 500 credits during the mission.

What I did was adding a ship of an other mission.oxp with the console to see what happened. (according to the author this should be possible). But somehow the variables were not initialised correct and on docking I got the message: awarded NaN credits. means here an non-initialised variable. But that does not mean zero. I was just awarder an undefined amount of money. I this case a negative amount. I did save it under a new name, but made the mistake to continue with that file the next day.

So, in the end I robbed myself.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

I think we should give here some more infos. This happened when Eric has used the Vector.
Eric Walch wrote:
But somehow the variables were not initialised correct and on docking I got the message: awarded NaN credits. means here an non-initialised variable.
The worldScript initialized a missionVariable with a value of 0.01 (or it has tried to do it), but somehow it went wrong and the value has become NaN (Not a number -> C.998753...) while init or while transferring it to a property. On my computer the variable is always right initialized, so this is maybe the same problem as Eric has reported before (older processor structures) on his MAC.

I'm pretty sure that I'll go and change it from float to integer to avoid this problem.
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 »

Svengali wrote:
I think we should give here some more infos. This happened when Eric has used the Vector.
Digging deeper on the bug I discovered it had nothing to do with mine ship adding by hand. Svengali did is also himself for Vector. But one of the mission variables in my save file that should have read 0.01, now reads: C.991592789737117e+36. This value looked familiar and gave some frustration in the past. It is probably the same JS bug that only happens with oolite version 1.72.x on G4 and G5 macs. This bug is already solved for the 1.73 release. But players that use Vector.oxp on those mac systems should be warned now to watch their credits!

On all intel macs and other systems this bug should not occur.

EDIT
Or even more precise: Conversion of floating numbers in strings goes wrong on these machines. I already noticed this on printing out floating numbers but mission variables are also written as string. So any oxp on those machines using floating numbers in mission variable could be buggy. I haven't noticed any of those things in UPS but I think I only user integer numbers as mission variables. (checked: only integers are stored in ups.)
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

For all G4 and G5 user I've updated the scripts
see https://bb.oolite.space/viewtopic.php?t=4634
Post Reply