v1.72.1 reset-handler fired to early

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

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

v1.72.1 reset-handler fired to early

Post by Svengali »

System: WIN

The behaviour of the reset-handler has changed in v1.72.x. When fired it is still in the old system so JS-scripts will run into trouble.
Before the system-data was set correctly when the handler was fired.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6630
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Can you elaborate a little on this, please? I am not sure I understand what you mean. What is the last version that behaves correctly? Can you post a test case script?
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

Sure. The last working version was v1.71.2 - just checked it again.
Take this testscript

Code: Select all

this.name           = "testA";
this.author         = "Svengali";
this.copyright      = "CC-by-nc-sa-3.0";
this.description    = "test";
this.version        = "1.00";

this.reset = function()
{
	log('Test','Test: System:'+system.name);
}
load savedgameA (maybe at Diso) and you will see that the systemdata still says Lave. And then load another savedgame (maybe at Esusti) and you are still in the system of savedgameA (Diso).

I haven't checked the state of missionVariables yet, but today I don't have the time anymore. Before they are set for the current savedgame - hope this is still the same. Maybe this is also the ( or one ) reason for the Commies problem.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6630
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

OK, problem isolated and fixed in SVN 1912-1913.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

Wow. that was fast. Thanks a lot another_commander :-)
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

Post by Ark »

another_commander wrote:
OK, problem isolated and fixed in SVN 1912-1913.
Errr!!!!!! does that means that the nav bouys are back in place when you have commies???
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 »

Ark wrote:
Errr!!!!!! does that means that the nav bouys are back in place when you have commies???
Only when you use bouyRepair at the same time. But when the source of the bug is the condition, it are probably not only the buoys that are missing but also a certain percentage of the police. commies also defines those with conditions.

I did notice that the bug does not happen when added by script. When I do a system.legacy_addShipsWithinRadius('buoy', 10, 'abs', player.ship.position, 10000) there are always 10 buoys and with police also always 10 police.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

Eric Walch wrote:
Ark wrote:
Errr!!!!!! does that means that the nav bouys are back in place when you have commies???
Only when you use bouyRepair at the same time. But when the source of the bug is the condition, it are probably not only the buoys that are missing but also a certain percentage of the police. commies also defines those with conditions.
I think Eric is right and it won't solve all problems related to missing buoys. But step by step we can hunt the problems down.
Eric Walch wrote:
I did notice that the bug does not happen when added by script. When I do a system.legacy_addShipsWithinRadius('buoy', 10, 'abs', player.ship.position, 10000) there are always 10 buoys and with police also always 10 police.
I can imagine that this is related to the way Oolite handles the legacy_add... methods. If the first try fails it repeats it a few times. So the chance that a entity will be added is a lot higher.

I noticed it when doing the Vector. There I've used a legacy_add... under some conditions. The shipdata.plist contains also conditions and last but not least the shipscript checks if there is already a ship with this role. If so it switches the AI and the ship leaves the system. This leads sometimes to ~20 leaving ships. It doesn't happen very often, but all these blue Hyperspheres are... erm... nice to watch. Looks like a police raid in a red light quarter :-)
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 »

Eric Walch wrote:
I did notice that the bug does not happen when added by script. When I do a system.legacy_addShipsWithinRadius('buoy', 10, 'abs', player.ship.position, 10000) there are always 10 buoys and with police also always 10 police.
It does. I noticed the bug first when in combination with Commies total_patrol failed to add additional police (but total_patrol doesn't use ...WithinRadius; perhaps that makes a difference, although I don't know why it should).
Post Reply