port_radius

General discussion for players of Oolite.

Moderators: winston, another_commander

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

port_radius

Post by Commander McLane »

Does anybody know what the port_radius-method in shipdata actually does?

It isn't mentioned in the wiki at all (could be added perhaps?).

The value for all native stations is 500, except for Dodecs, where it is something odd like 392, rock hermits have 250.

For a new station I tried out values between 20 and 12000. I see no difference at all in the behaviour of the station or launching/docking ships.

So what does it do anyway? I would be grateful for clues.
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

I think it's to do with the radius of the 'S' safety zone around the station, ie the area where ships will be protected by the stations vipers if attacked
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 »

I read that before, but I doubt it, as there is no safety zone around a rock hermit. So what would the method mean there? And why should the zone be smaller around a dodec than around the other stations?
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

The port_radius value is used when loading a station to set the port_position, i.e. the point at which ships spawn when leaving the station. However, it appears to be used before it is loaded from the property list, so it’s actually always 500. (The position can also be overridden by subentities whose names start with “dock”.)

I’ll look into fixing this (i.e. reading before using). If this turns out to break stuff, I’ll introduce a new key with the same effect that actually does something (say, spawn_distance). It’s on my list.
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 »

Thanks, Ahruman!

That's actually exactly what I assumed it to be supposed to do.

Actually I was trying to have launching ships spawned in a greater distance from the dock, by setting the value of port_radius. Now you have explained why it didn't work.

For my problem I have found a work-around by giving the launching defense-ships an AI that lets them fly straight forward for 4 seconds and then switches to their intended AI. Works fine, but of course not for any other ships launched. So I'm going to wait for a fix.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Again, when setting up a dock, the game looks for any subentity whose name begins with “dock” and uses its position and orientation in preference to the calculated value. To use this, do something like:

Code: Select all

<key>subentities</key>
<array>
    <string>dock-mclane-station 0 0 1000 1 0 0 0</string>
</array>
where 0, 0, 1000 is the position, and 1, 0, 0, 0 is the orientation. Also add an invisible do-nothing “ship” with role dock-mclane-station to your shipdata.plist.
Post Reply