Page 2 of 2

Re: Rock Hermit Buoys

Posted: Mon Feb 28, 2011 9:57 am
by Smivs
Just checked (now running RHL v1.3.2 with Oolite v1.75).....RHL working fine here. Beacon showing up on scanner and only one beacon present.

Re: Rock Hermit Buoys

Posted: Mon Feb 28, 2011 11:22 am
by JD
Switeck wrote:
Is it possible of the 2 buoys, 1 is the "turned off" and the other is "turned on"? Only 1 of the 2 is reported on the advanced space compass, so I'm thinking for some reason both get spawned.
I get to see the duplicates on my space compass.

Re: Rock Hermit Buoys

Posted: Mon Feb 28, 2011 11:23 am
by Cody
Are there any errors showing in your latest.log?

Re: Rock Hermit Buoys

Posted: Mon Feb 28, 2011 11:34 am
by JD
El Viejo wrote:
Are there any errors showing in your latest.log?
None coming out of the Rock Hermit oxp (there's a YAH error, looks like the "system/System" issue, which I'll investigate and report elsewhere - unless you think it might have a bearing on this?).

Because I'm running a trunk version the level of logging is, what's the term I'm looking for, "aggressive", and the log file is massive. Otherwise I'd post it here.

When I get back to my home PC I'll try running the standard 1.75 again, and I'll try it with and without other oxps.

Re: Rock Hermit Buoys

Posted: Mon Feb 28, 2011 11:36 am
by Cody
Thanks JD... I've been using RHL for ages, in 1.74.x and 1.75.x, and have never seen this double beacon... an odd one.

Re: Rock Hermit Buoys

Posted: Mon Feb 28, 2011 1:43 pm
by Eric Walch
JD wrote:
I've just installed the Rock Hermit Locator oxp, version 1.3.2, and have noticed that it creates two buoys per rock hermit. Is that intentional?
It could be two rock hermits exactly on top of each other?
Can you fly close to the hermit and make an entity dump: pause the game and press 0 (zero) while paused. You'll now see all system entities in your latest log, sorted by distance to the player. Paste the lines about the hermit and the buoys here. Maybe those give a clue.

Re: Rock Hermit Buoys

Posted: Mon Feb 28, 2011 2:20 pm
by JD
OK, I'll do that this evening.

Re: Rock Hermit Buoys

Posted: Mon Feb 28, 2011 2:43 pm
by another_commander
The addBuoys function is firing twice. Here is a small test case. Copy the below to script.js inside a Config folder in AddOns:

Code: Select all

this.shipLaunchedFromStation = function()
{
	this.i = 0;
	this.testTimer = new Timer(this, this.fireMsg, 1); // should fire message once, with counter i set to 0
}

this.fireMsg = function()
{
	player.consoleMessage("We are firing! var i is " + i);
	i++;
}
The expected behaviour is to get one message on the console, like this: "We are firing! var i is 0". And that should be it.

On my system, I seem to be getting the message twice, one with i set to 0 and one with i set to 1. I think this problem is similar to the one we had encountered some time ago with timers having interval of 1 firing twice.

Edit: In fact, setting the timer delay to 1.0001 solves the problem. I am sure we are looking at the same case of bug.

Re: Rock Hermit Buoys

Posted: Mon Feb 28, 2011 3:12 pm
by Eric Walch
another_commander wrote:
On my system, I seem to be getting the message twice, one with i set to 0 and one with i set to 1. I think this problem is similar to the one we had encountered some time ago with timers having interval of 1 firing twice.

Edit: In fact, setting the timer delay to 1.0001 solves the problem. I am sure we are looking at the same case of bug.
Now you mention it, I remember the bug report but didn't think about the possibility. The bug was system specific, therefor only some people see it.

JD, please open the 'script.js' file inside the Config folder of the oxp, look for the lines:

Code: Select all

this.shipExitedWitchspace = function ()
{
    // use a delay to allow all other oxp's to add heir stuff.
    this.buoyTimer = new Timer(this, this.addBuoys, 1);
}
The lines are somewhere at the start, and change the '1' in something else, like '0.5' or even '1.0001' as A_C suggest. If that helps, we are talking about the same Oolite bug and I update the oxp with a version that bypasses the bug. Actually any value grater than zero will do. It is just to make sure the hermits are counted after all other oxp's have added their ships. '0.001' is even enough for that :lol:

Re: Rock Hermit Buoys

Posted: Mon Feb 28, 2011 4:10 pm
by Switeck
Commander McLane wrote:
Can you target them independently?
Yes, I can destroy them independently too!
JD wrote:
I get to see the duplicates on my space compass.
Come to think of it, I recall having to cycle through an inordinate number of R's on my space compass as well. :lol:
(So definitely duplicates for the same RH.)

Re: Rock Hermit Buoys

Posted: Mon Feb 28, 2011 4:18 pm
by Mauiby de Fug
Interesting! I've come across a couple of duplicates as well, but not all the time. Sometimes it seems to be working properly, and only makes one buoy.

And when I have had the duplicates, only one of them has shown up on my compass...

Re: Rock Hermit Buoys

Posted: Mon Feb 28, 2011 10:15 pm
by JD
Eric - I think this supports your theory about the bug - give or take any statistical uncertainty.

I had to try each scenario a few times before a rock hermit actually showed up in the system, and I've omitted those occasions from the sequence below.
  • I first ran Oolite with the normal value (1) in the script.js file. Exiting the station, only one RH beacon appeared.

    I therefore made a witchspace jump, and duplicate becons were created. I have various entity dumps if those might be useful.

    I then changed the script.js file as you suggested (to 1.0001). I unfortunately forgot to hold down shift. After a witchspace jump, I again saw duplicate beacons.

    Restarted, this time with shift held down.

    Another witchspace jump, singular beacons this time.

    Tried again, and once again, singular beacons.

    Reset the 1.0001 to 1, but again forgot to hold down shift on restarting. Still singular beacons.

    Restarted again, this time with shift held down.

    Witchspace jump, duplicate beacons.
I hope this helps, and I hope this small number of tests is sufficiently reliable.

Cheers
John

Re: Rock Hermit Buoys

Posted: Mon Feb 28, 2011 10:29 pm
by Eric Walch
JD wrote:
in the interests of full disclosure I should probably also say that I'm running nightly trunk version 4412.
This is important version info, as the bug was known at mid January and it was thought to be fixed before the 1.75 release. At least it means you are not using a version from before the alleged fix.
It also means that other, one shot timers, in other oxps, using round integer values for the delay could be affected.