Page 1 of 1

Removing blue rings when ships are spawned

Posted: Tue Jun 19, 2012 10:31 pm
by Smivs
When a ship or entity is spawned it generates a blue ring. Is it possible to remove or 'switch off' the blue ring?

Re: Removing blue rings when ships are spawned

Posted: Tue Jun 19, 2012 10:53 pm
by Svengali
You could try the way Eric has posted some time ago -> https://bb.oolite.space/viewtopic.php?f= ... gs#p124781

Re: Removing blue rings when ships are spawned

Posted: Tue Jun 19, 2012 11:06 pm
by Smivs
Thanks, Svengali...I'll have a look :)

Re: Removing blue rings when ships are spawned

Posted: Wed Jun 20, 2012 7:45 am
by Eric Walch
Svengali wrote:
You could try the way Eric has posted some time ago
The idea to do it that way however, was from Kaks.

Best place to look at an example is by looking in the YAH script. Essential the ship is added at a place were rings are not added and than relocated to the entry-point.
When doing it on the 'shipWillEnterWitchspace' 'shipWillExitWitchspace' handler, I think the rings are also not visible. I never checked that myself. Rings are not intentional left out than, but it could be that time is not handled correct.

Just checked by dumping time during a jump:

Code: Select all

Player will enter witchspace. At: 180572875975.73105
Player will exit witchspace. At: 180572875975.73105
Player exited witchspace. At: 180572878282.2512
Indeed, time is only updated after the 'shipWillEnterWitchspace' 'shipWillExitWitchspace' handler. And as rings are only drawn for a few seconds, the rings think their time has already past.

Re: Removing blue rings when ships are spawned

Posted: Wed Jun 20, 2012 8:24 am
by cim
Eric Walch wrote:
Just checked by dumping time during a jump:

Code: Select all

Player will enter witchspace. At: 180572875975.73105
Player will exit witchspace. At: 180572875975.73105
Player exited witchspace. At: 180572878282.2512
Indeed, time is only updated after the shipWillEnterWitchspace handler. And as rings are only drawn for a few seconds, the rings think their time has already past.
I see plenty of rings when adding on shipWillExitWitchspace (though they're almost faded out, so only on objects added in front of the player). Adding on shipWillEnterWitchspace wouldn't give visible rings, I think, but wouldn't it also add to a completely different system?

Isn't there an issue with those times in that the player (and JS) only gets the displayed time, which may be adjusting, but the rings are displayed on real system time, which is well into the future of that?

Re: Removing blue rings when ships are spawned

Posted: Wed Jun 20, 2012 9:32 am
by Eric Walch
cim wrote:
Adding on shipWillEnterWitchspace wouldn't give visible rings, I think, but wouldn't it also add to a completely different system?
:oops: :oops: I ment shipWillExitWitchspace in my above message. Will correct now.

I think the used moment for time update is useful as this allows to add objects that are supposed to be there already on player arrival. (No visible rings)

Re: Removing blue rings when ships are spawned

Posted: Wed Jun 20, 2012 12:01 pm
by Smivs
The only problem is, this is not an ExitWitchSpace event. I'm actually doing something clever with a ship that seperates into two, so the 'spawning' is done in full view of the player during the game.
I've got the clever bit working well, but can't get rid of the rings yet :(

Re: Removing blue rings when ships are spawned

Posted: Wed Jun 20, 2012 2:27 pm
by Commander McLane
Smivs wrote:
When a ship or entity is spawned it generates a blue ring. Is it possible to remove or 'switch off' the blue ring?
Don't do it in scanner range of the witchpoint. The wormhole exit rings are not generated anywhere else in the system.

(By the way: When the JS-ship spawning methods were designed I suggested an additional parameter for generating (or not generating) the rings, which would solve your problem quite easily. It wasn't included, though.)

And if you want to create two other entities (or an additional entity) in the place of another entity, you should use spawn anyway.

Re: Removing blue rings when ships are spawned

Posted: Wed Jun 20, 2012 4:33 pm
by Smivs
Commander McLane wrote:
Don't do it in scanner range of the witchpoint. The wormhole exit rings are not generated anywhere else in the system.
Very good point :wink: I've just tested after launching and...no rings :)
Commander McLane wrote:
(By the way: When the JS-ship spawning methods were designed I suggested an additional parameter for generating (or not generating) the rings, which would solve your problem quite easily. It wasn't included, though.)
It would be ueful, though. Any chance of it being added?
Commander McLane wrote:
And if you want to create two other entities (or an additional entity) in the place of another entity, you should use spawn anyway.
I have been using system.AddShips, because I can't get the ship's orientation correct whn using spawn or spawnOne. Is there a way to do this? I'm currently using

Code: Select all

   system.addShips("my_ship_component",1,ship.position.add(ship.vectorForward.multiply(100)),0)[0];
	orientation = this.ship.orientation;
which works fine.

Re: Removing blue rings when ships are spawned

Posted: Thu Jun 21, 2012 5:18 am
by Switeck
I had the reverse problem...I ran across spawn methods that were NOT showing the blue rings when ships spawned in at the witchspace beacon and it was causing me headaches.

These may have changed since I experimented with them circa v1.74 betas:

Code: Select all

		system.legacy_addShipsAt("trader", 1, "wpu", [Math.random()*0.05-0.025, Math.random()*0.05-0.025, Math.random()*0.05-0.025]); // doesn't trigger "EXITED_WITCHSPACE"
		system.legacy_addShipsAt("trader", 1, "wpu", [0, 0, 0]); // doesn't trigger "EXITED_WITCHSPACE"
		system.legacy_addShips("trader", 1); // triggers "EXITED_WITCHSPACE"!

Re: Removing blue rings when ships are spawned

Posted: Thu Jun 21, 2012 10:58 am
by Commander McLane
Switeck wrote:
I had the reverse problem...I ran across spawn methods that were NOT showing the blue rings when ships spawned in at the witchspace beacon and it was causing me headaches.
I was talking about the genuin JS addShips-family of methods, specifically not about the legacy methods. Those are deprecated, it's irrelevant what they do or don't do.

Re: Removing blue rings when ships are spawned

Posted: Thu Jun 21, 2012 4:50 pm
by Switeck
Commander McLane wrote:
I was talking about the genuin JS addShips-family of methods, specifically not about the legacy methods. Those are deprecated, it's irrelevant what they do or don't do.
(That comes across sounding rude, CML.)

I am answering the thread poster. Even if the methods I'm describing are depreciated, I figure he'd want to know. It's up to Oolite's maintainers if they want to implement similar functionality in the non-depreciated addShips methods.

A semi-messy workaround of spawning ships elsewhere and them moving them to the witchpoint causes me other problems.
I still get crashes-to-desktop if lots of ships are moved around when I arrive at a new system...but only if my ship is cloaked. I need to test latest daily build to see if that still happens. :(

(Yep, still crashes...)

Re: Removing blue rings when ships are spawned

Posted: Thu Jun 21, 2012 11:32 pm
by UK_Eliter
If I may chip in . .
Switeck wrote:
I still get crashes-to-desktop if lots of ships are moved around when I arrive at a new system...but only if my ship is cloaked. I need to test latest daily build to see if that still happens. :(
That state of affairs with the code might explain problems with my Interstellar Tweaks OXP. Perhaps I should turn off the player's cloak before moving - and then, I suppose, I could re-enable it. . .