Arrivals and departures
Moderators: winston, another_commander
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Arrivals and departures
With escorts, there doesn't appear to be a way for me to create them manually. I can set them up, but the "escortGroup" property of a ship is read only - I assume because normally an escort group is created on the fly as defined in the shipdata.plist file. Given that what I am trying to achieve here is an approximation, would it work if I create the escort members as a normal ship group? Would they operate as escorts if I do that? Or do I need to switch their AI to something else?
Re: Arrivals and departures
The
In practice though it's best to use
escort_roles in shipdata can be used to make sure a ship has some blank escort slots available (and if you want to do the set up entirely manually, only has blank slots when created)
escortGroup
property is read-only - you can't change a ship's escort group to another group - but you can add ships to the existing group by using group.addShip()
as usual.In practice though it's best to use
ship.offerToEscort(othership)
to do this as this will make sure all the bits get set up properly and the ship doesn't exceed its escort limit.escort_roles in shipdata can be used to make sure a ship has some blank escort slots available (and if you want to do the set up entirely manually, only has blank slots when created)
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Arrivals and departures
Thanks cim. Another issue: the ten minutes between pressing F1 and being in space. If I have 5 ships who are due to launch inside those 10 minutes I'd expect to see them in space after I launch. However, I can't just launch them all in the
shipWillLaunchFromStation
- they still end up launching after the player. Does this mean I have manually create them in the vicinity on the dock using system.addShips
and skip the station.launchShipWithRole
function?Re: Arrivals and departures
Yes.phkb wrote:Does this mean I have manually create them in the vicinity on the dock usingsystem.addShips
and skip thestation.launchShipWithRole
function?
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Arrivals and departures
Ah. Thought so. This rabbit hole sure is deep.
Edit: So, thinking of the best way to push out a bunch of launched ships. Would
Edit: Actually, given I'm going to need to do this on docking and launching, I'm probably going to have to use station dock orientation. I think I've worked out the dock position for this (entity.position with entity.heading).
Edit: So, thinking of the best way to push out a bunch of launched ships. Would
player.ship.vectorForward
coupled with a random selection of player.ship.vectorUp/vectorDown/vectorRight
do the job? Is player.ship.vectorForward accurate at the shipWillLaunchFromStation
stage? Or should I get a series of vectors based on the station dock orientation?Edit: Actually, given I'm going to need to do this on docking and launching, I'm probably going to have to use station dock orientation. I think I've worked out the dock position for this (entity.position with entity.heading).
Re: Arrivals and departures
Remember that for subentities like docks the position and orientation are reported relative to the parent entity.phkb wrote:Edit: Actually, given I'm going to need to do this on docking and launching, I'm probably going to have to use station dock orientation. I think I've worked out the dock position for this (entity.position with entity.heading).
That said, you can fly quite a way in 10 minutes, so for a lot of the ships "somewhere vaguely near the station" is probably sufficient.
- Disembodied
- Jedi Spam Assassin
- Posts: 6885
- Joined: Thu Jul 12, 2007 10:54 pm
- Location: Carter's Snort
Re: Arrivals and departures
Would most ships - ones with interstellar destinations, anyway - not have jumped away within (say) five minutes of exiting the station? And any planetary shuttles/transporters would at least have entered the atmosphere.cim wrote:That said, you can fly quite a way in 10 minutes, so for a lot of the ships "somewhere vaguely near the station" is probably sufficient.
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: Arrivals and departures
Threadjack: I was just thinking last night that opening wormholes anywhere near a station or planet or other ship should be too dangerous to be lawful, and I might make a little script that only allowed witchspace jumps from torus speed.Disembodied wrote:Would most ships - ones with interstellar destinations, anyway - not have jumped away within (say) five minutes of exiting the station?
Re: Arrivals and departures
I would definitely play with that. Thought about that as well atleast 10 times during the last 24 hoursWildeblood wrote:Threadjack: I was just thinking last night that opening wormholes anywhere near a station or planet or other ship should be too dangerous to be lawful, and I might make a little script that only allowed witchspace jumps from torus speed.Disembodied wrote:Would most ships - ones with interstellar destinations, anyway - not have jumped away within (say) five minutes of exiting the station?
Though it would be pretty difficult to use other ships wormholes (?) and how would the AI respond to it? When "mothership" makes wormhole, escorts follow, but if "mothership" cant create wormhole because of escorts too close?
"There is a single light of science, and to brighten it anywhere is to brighten it everywhere." - Isaac Asimov
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: Arrivals and departures
Yeah well, I was only thinking of the player ship. NPCs don't have any torus drive.Vincentz wrote:I would definitely play with that. Thought about that as well atleast 10 times during the last 24 hoursWildeblood wrote:Threadjack: I was just thinking last night that opening wormholes anywhere near a station or planet or other ship should be too dangerous to be lawful, and I might make a little script that only allowed witchspace jumps from torus speed.
Though it would be pretty difficult to use other ships wormholes (?) and how would the AI respond to it? ...
You wave the differences away by saying, "That's relativity for ya.": the subjective experience inside a moving ship will be very different to the observed phenomena from outside a ship.
- Norby
- ---- E L I T E ----
- Posts: 2577
- Joined: Mon May 20, 2013 9:53 pm
- Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
- Contact:
Re: Arrivals and departures
I used a trick to prevent masslock while a ship is landed on the escort deck:Vincentz wrote:if "mothership" cant create wormhole because of escorts too close?
ship.scanClass="CLASS_CARGO";
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Arrivals and departures
So to get the docks actual position would that becim wrote:Remember that for subentities like docks the position and orientation are reported relative to the parent entity.
station.position.add(dock.position)
? I tried this with Code: Select all
pos = (station.position.add(dock.position)).add(dock.heading.multiply(1000));
I've been doing some testing and I'm discovering thatphkb wrote:Another one: if I launch a ship this way, it doesn't appear to launch any escorts - it just launches the ship. Am I correct in my understanding that launching a ship using a specific ship key will only launch that ship, and no escorts?
system.addShips("[anaconda]", 1, pos, 1000);
will sometimes add one ship and sometimes add multiple ships (one or more escorts). Is it possible to only create one ship, and skip the escort creation?Edit: Actually, station.launchShipWithRole will also launch escorts, so the question applies to a broader context.
Re: Arrivals and departures
Very rarely - you need to account for the rotation of the station with respect to the universal coordinate frame.phkb wrote:So to get the docks actual position would that bestation.position.add(dock.position)
Code: Select all
station.position.add(
station.vectorForward.multiply(dock.position.z).add(
station.vectorUp.multiply(dock.position.y).add(
station.vectorRight.multiply(dock.position.x)
)
)
)
Not really, no.phkb wrote:Is it possible to only create one ship, and skip the escort creation?
like_ship
the thing you're trying to launch so that its escort_roles
entry is just
Code: Select all
escort_roles = (
{ role = ""; min = 16; max = 16; }
)
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Arrivals and departures
When you say that, how does that work in practice? I know I can create a shipdata.plist file and put the data in there, but I don't want to hard code anything if I don't have to. In fact, hardcoding will be the end of this concept in my view. Is it possible to create a shipdata.plist entry on the fly and launch a ship with it?cim wrote:like_ship the thing you're trying to launch
I've tried these options without success:
Code: Select all
var p = player.ship;
var myship = {like_ship:"anaconda", escorts:0, escort_roles:{role:"", min:16, max:16}};
var ships = system.addShips(myship, 1, p.position.add(p.vectorForward.multiply(10000)), 100);
Code: Select all
var p = player.ship;
var myship = Ship.shipDataForKey("anaconda");
myship["like_ship"] = "anaconda";
myship["escorts"] = 0;
myship["escore_roles"] = {role:"", min:16, max:16};
var ships = system.addShips(myship, 1, p.position.add(p.vectorForward.multiply(10000)), 100);
- Norby
- ---- E L I T E ----
- Posts: 2577
- Joined: Mon May 20, 2013 9:53 pm
- Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
- Contact:
Re: Arrivals and departures
Yes, I had the same problem with ILS until I figured out the same solution.cim wrote:you need to account for the rotation of the station with respect to the universal coordinate frame.
Call remove() for each element in ship.escorts after addShips.phkb wrote:Is it possible to only create one ship, and skip the escort creation?