EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
[lib]lib.find.gates v1-24
Post new topic Reply to topic
View previous topic :: View next topic
Author Message
Red Spot





Joined: 04 Feb 2005
Posts: 3224 on topic
Location: The Netherlands
Thank you for registering your game
modified
PostPosted: Tue, 17. Jan 06, 20:53    Post subject: [lib]lib.find.gates v1-24 Reply with quote Print

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
View user's profile Send private message Visit poster's website
nuclear_eclipse



MEDALMEDALMEDAL

Joined: 02 Sep 2004
Posts: 1128 on topic
Location: /dev/nuke
Thank you for registering your game
PostPosted: Tue, 17. Jan 06, 21:30    Post subject: Reply with quote Print

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
View user's profile Send private message Visit poster's website
Red Spot





Joined: 04 Feb 2005
Posts: 3224 on topic
Location: The Netherlands
Thank you for registering your game
PostPosted: Tue, 17. Jan 06, 21:37    Post subject: Reply with quote Print

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 ...Sad)

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
View user's profile Send private message Visit poster's website
nuclear_eclipse



MEDALMEDALMEDAL

Joined: 02 Sep 2004
Posts: 1128 on topic
Location: /dev/nuke
Thank you for registering your game
PostPosted: Tue, 17. Jan 06, 21:59    Post subject: Reply with quote Print

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
View user's profile Send private message Visit poster's website
merrydown





Joined: 02 Dec 2003
Posts: 5 on topic

Thank you for registering your game
PostPosted: Sun, 4. Feb 07, 03:27    Post subject: Reply with quote Print

These links are dead can anyone offer an alternative download source please?

Back to top
View user's profile Send private message
moggy2



MEDALMEDAL

Joined: 06 Nov 2002
Posts: 4588 on topic
Location: Montréal
Thank you for registering your game
PostPosted: Sun, 4. Feb 07, 05:16    Post subject: Reply with quote Print

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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic Reply to topic
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Tue, 18. Jun 13, 08:24

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2009
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.22136 seconds, sql queries = 39