Asteroid storm bug

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

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Ark
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sun Dec 09, 2007 8:22 am
Location: Athens Greece

Asteroid storm bug

Post by Ark »

Totay i wanted to test astreroid storm (latest version) with oolite 1.72
I just wanted to see the FPS during the missions (In the past i had serious performance problems)
The funny thing is that i bumbed into a bug of the JS instead

Code: Select all

[script.javaScript.exception.22]: ***** JavaScript exception: TypeError: player.call is not a function
[script.javaScript.exception.22]:       AddOns/AsteroidStorm.oxp/Scripts/AsteroidStorm.js, line 126.
Also I had the initiation of the mission without the mission info screen about the doomsday asteroid

By the way I had no performance issues :D :D
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:

Post by Commander McLane »

Ah, yes. This stems from the deprecated way the missionscreen was put up in the current version, which--I think--was a workaround for some problems that no longer exist in 1.72. Instead the workaround no longer exists... :wink:

In other words: time for a new version.
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 »

One of the things it needs is just added to 1.72 with system.info:

Code: Select all

        if(oolite.compareVersion("1.72") > 0)
        {
            player.call("setSpecificPlanetInfo:", "0=55=station=none");	
            player.call("setSpecificPlanetInfo:", "0=55=description="+d);
        }
        else
        {
			system.description = d;
			system.info.station = "none";
        }
However this only works for the current system. For changing an other system info we need to use system.infoForSystem(). I just don't know how to use it. Both are write only what makes things more difficult to test. The code below lets Oolite crash. Its probably not good.

Code: Select all

        if(oolite.compareVersion("1.72") > 0)
        {
            player.call("setSpecificPlanetInfo:", "0=55=station=none");	
            player.call("setSpecificPlanetInfo:", "0=55=description="+d);
        }
        else
        {
            // needs other code
			system.infoForSystem(0, 55).description = d;
			system.infoForSystem(0, 55).station = "none";
        }
How is this new infoForSystem() to be used?
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Crash confirmed and fixed. (The correct syntax is System.infoForSystem(0, 55).description = d; with a capital S – it applies to the class System, not the object system. I’m not entirely sure why it works with a lowercase s, but don’t rely on it.)
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 »

Ahruman wrote:
Crash confirmed and fixed.
Thanks, I just updated the appropriate Wiki page about this.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6630
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Maybe it's just me, but I am getting null every time I type in the console
System.infoForSystem(0,55).description . Is this working OK in the trunk for everyone else?
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:
Maybe it's just me, but I am getting null every time I type in the console
System.infoForSystem(0,55).description . Is this working OK in the trunk for everyone else?
This is also true for 1.72. But remember it is write only. Changes are only visible on the F7 screen.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Getting null is expected (but undesirable) behaviour.
Post Reply