Bug produced by trunk + Randomhits

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

Moderators: winston, another_commander

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

Re: Bug produced by trunk + Randomhits

Post by Eric Walch »

maik wrote:
I just ran into this as well (on a certainly fast enough computer). Relevant log excerpt:
Yes, it seems that the code was not interrupted because of the speed, but because of an error.

I just wonder why that command returned 'null'. I anticipated that there would always be a solution. It happens in the selection of a suitable system. I filter a list with all systems were "government < 6" and "range > 5" and "range < 33". I assumed there will always be such a system. Did you find a super safe area in the galaxy, or missed I an other rare exception.

I probably have to add an extra test and create a "no hit mission available" page.

If this is the reason, than it is system specific. In what system/galaxy did this happen, so I can test this further.
User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2025
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Bug produced by trunk + Randomhits

Post by maik »

I'm in galaxy 7. The weird thing is it already did work prior to yesterday. I thought the same that it could be dependent on the system where I am so I flew to two other anarchies but encountered the same behaviour. I'm away from home for this week so can't tell you the name of the system where I am, but maybe the position that is written in my log excerpt helps you. The other two anarchies are close by.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Bug produced by trunk + Randomhits

Post by Commander McLane »

I'd suppose you're close to the great rift, possibly on the wrong side.
User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2025
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Bug produced by trunk + Randomhits

Post by maik »

Commander McLane wrote:
I'd suppose you're close to the great rift, possibly on the wrong side.
From memory about in the middle of the map (horizontally), a bit to the left of what probably is the great rift, and about 3/4th down from the top...

Edit: I just looked at the vector map and found the systems: Usxela, Esreates, and Esrire.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Bug produced by trunk + Randomhits

Post by Eric Walch »

maik wrote:
Edit: I just looked at the vector map and found the systems: Usxela, Esreates, and Esrire.
Thanks for looking up. I just tried docking at the bar in Usxela and got the same result as you. So, it is very likely system specific. I'll add a few additional checks to the code. I suspect it can't find a suitable system in the given range. I can create a greater range in those cases, but easier will probably be to say that there is no hit available. I'll see what I come up with.
User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2025
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Bug produced by trunk + Randomhits

Post by maik »

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

Re: Bug produced by trunk + Randomhits

Post by Eric Walch »

It seems not that there is no system found. Looking in the code I already anticipated that. In that case it selects the current system. I logged the number of suitable target systems. There were enough for all the 3 missions:

Code: Select all

[Random_Hits] OOJSGlobal.m:247: Number of target systems: 38
[Random_Hits] OOJSGlobal.m:247: Number of target systems: 47
[Random_Hits] OOJSGlobal.m:247: Number of target systems: 62
The problem was in System.infoForSystem().routeToSystem(). Apparently this has changed between 1.74 and 1.75. If the route to an isolated system was calculated, 1.74 returned an object but with the distance property null. It seems that 1.75 now returns null for such a route.

I thought I explicit tested this with trunk to see if this behavior was unchanged with the new JS implementation. Or I missed something, or there was another change in trunk after my tests.

Anyhow, I now have a working script that deals with this situation.
Post Reply