Removing blue rings when ships are spawned

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

Moderators: winston, another_commander

Post Reply
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Removing blue rings when ships are spawned

Post 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?
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Removing blue rings when ships are spawned

Post by Svengali »

You could try the way Eric has posted some time ago -> https://bb.oolite.space/viewtopic.php?f= ... gs#p124781
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Removing blue rings when ships are spawned

Post by Smivs »

Thanks, Svengali...I'll have a look :)
Commander Smivs, the friendliest Gourd this side of Riedquat.
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: Removing blue rings when ships are spawned

Post 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.
Last edited by Eric Walch on Wed Jun 20, 2012 9:33 am, edited 1 time in total.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Removing blue rings when ships are spawned

Post 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?
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: Removing blue rings when ships are spawned

Post 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)
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Removing blue rings when ships are spawned

Post 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 :(
Commander Smivs, the friendliest Gourd this side of Riedquat.
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: Removing blue rings when ships are spawned

Post 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.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Removing blue rings when ships are spawned

Post 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.
Commander Smivs, the friendliest Gourd this side of Riedquat.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Removing blue rings when ships are spawned

Post 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"!
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: Removing blue rings when ships are spawned

Post 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.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Removing blue rings when ships are spawned

Post 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...)
Last edited by Switeck on Thu Jun 21, 2012 11:34 pm, edited 1 time in total.
UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1246
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

Re: Removing blue rings when ships are spawned

Post 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. . .
Post Reply