 |
View previous topic :: View next topic |
 |
|
|
|
|
Author |
Message |
|
|
|
|
|
Red Spot

Joined: 04 Feb 2005 Posts: 3224 on topic Location: The Netherlands

 |
Posted: Tue, 17. Jan 06, 20:53 Post subject: [lib]lib.find.gates v1-24 |
|
|
a little lib to make scripting-life a bit easier ..
this lib can find 1 or all gates, within a distance or not, using a refrence position or not ..
the script has 4 arguments
-sector (required)
-distance (optional .. input a maximum search distance or null)
-return array (optional .. input true/false .. will return all gates in sector (when using distance or ref.pos it will only include gates within distance of a potential ref.pos))
-ref.pos (optional .. input a position array or null .. will use this position when searching within distance or else use the center of sector as ref.pos)
will return the nearest gate or gates when return array is used .. but only when they are in range if the distance is used .. and the distance will use a given refrence position or else use the center off sector (0,0,0)
handy when searching the nearest gate/potential gates/posible gate(s) within x range/etc etc ..for jumpdriving/stationspawning/etc etc
(I just got annoyed with making several scripts that more or less did the same with a small difference .. so I combined them all into 1 'easy does it' script)
get it here;
http://www.geocities.com/g5_11/XCommunity/lib.find.gatesv1-24.zip
G
_________________ Last edited by Red Spot on Sat, 2. Jul 05, 20:05; edited 34 times in total
Last edited by Red Spot on Wed, 25. Jan 06, 00:44; edited 1 time in total |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
nuclear_eclipse

 
Joined: 02 Sep 2004 Posts: 1128 on topic Location: /dev/nuke

|
Posted: Tue, 17. Jan 06, 21:30 Post subject: |
|
|
So if all I want to do is find the gate closest to the target object, what arguments would I use? I'm not quite clear how your args affect the output. In specific, I was just about to write a lib script that would get passed a station or ship object and simply return the gate object closest to the passed reference. How would I accomplish that with your script?
_________________ blog |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Red Spot

Joined: 04 Feb 2005 Posts: 3224 on topic Location: The Netherlands

|
Posted: Tue, 17. Jan 06, 21:37 Post subject: |
|
|
give a ref.position (position of the target)
and dont use distance or return array ..
when using distance it could return no gate
when using return array it will return an array with 0 to all gates
(trying to upload a new version that wont return an empty array when using both distance and return array .. but I cant seem to acces my own site ... )
Edit; got in while writting this .. so a 'new' version is up ..
G
_________________ Last edited by Red Spot on Sat, 2. Jul 05, 20:05; edited 34 times in total |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
nuclear_eclipse

 
Joined: 02 Sep 2004 Posts: 1128 on topic Location: /dev/nuke

|
Posted: Tue, 17. Jan 06, 21:59 Post subject: |
|
|
Nevermind, I just wrote my own version that just takes the actual ship/station object instead of having to pass in a position array. Thanks anyways.
_________________ blog |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
merrydown
Joined: 02 Dec 2003 Posts: 5 on topic

|
Posted: Sun, 4. Feb 07, 03:27 Post subject: |
|
|
These links are dead can anyone offer an alternative download source please?
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
moggy2


Joined: 06 Nov 2002 Posts: 4588 on topic Location: Montréal

|
Posted: Sun, 4. Feb 07, 05:16 Post subject: |
|
|
there is a find nearest gate routine in lib.xi.find that comes with the bonus pack.
you can use it with a line something like this
| Code: |
| @ $Target.gate = [THIS] -> call script 'lib.xi.find' : CMD='nearest.gate' Arg1=$Target Arg2=null Arg3=null Arg4=null |
Arg1 can take either an object of a position array.
If you want the usigned equivalent, it's called lib.Xai.find. Most Xai Corporation scripts come with it.
_________________
RSS Feed : Submit News Article : Download Scripts : Image Galleries |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
|
|