Page 1 of 1

port_radius

Posted: Sat Mar 10, 2007 11:50 am
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.

Posted: Sat Mar 10, 2007 12:51 pm
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

Posted: Sat Mar 10, 2007 1:00 pm
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?

Posted: Sat Mar 10, 2007 1:32 pm
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.

Posted: Mon Mar 12, 2007 9:21 am
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.

Posted: Mon Mar 12, 2007 12:19 pm
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.