EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
[SCRIPT] Cycrows Library Scripts
Post new topic Reply to topic
View previous topic :: View next topic
Author Message
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 20457 on topic
Location: London
Thank you for registering your game
PostPosted: Wed, 3. Jun 09, 16:09    Post subject: [SCRIPT] Cycrows Library Scripts Reply with quote Print

Here is a set of library scripts that i use with my other scripts.

I thought i'll release them seperatly encase anyone would like to use them.

Arrow lib.cycrow.addware



    Adds a ware to a group of stations based on station class
    Arguments:

    • StationType: The station type, or class to add to
    • Race: The owner race of the stations
    • Ware: The ware to add

    All stations in the universe owned by "Race" and matchs type/class of "StationType" will have the ware added


Arrow lib.cycrow.emp



    2 scripts for using EMP:

    • lib.cycrow.isValidEmp: Returns [TRUE] if emp is installed correctly
    • lib.cycrow.getusedemp: Returns an arrray of all EMP wares that are currnetly being used


Arrow lib.cycrow.getinstalledequipment



    This script returns an array of all equipment installed on a given ship

    • Ship: The ship object to get equipment from
    • Include Equipment: Weather to include equipment wares are well

    Returns shields/lasers and any installed equipment


Arrow lib.cycrow.getnotamt



    Get Notority amount for specific rank.


Arrow lib.cycrow.getrankpage



    Returns the pageid for the ranks of a given race


Arrow lib.cycrow.getresource



    Returns the resource array for a station, either primary or secondary resources


Arrow lib.cycrow.getshiptypefromclass



    Returns all ship types based on a ship class and race.

    • Class: The ship class to match, use "-2" for missile frigates
    • Race: The race filter, will only match ships that are created by this race
    • Exclude Race: Any races in this array will be skipped



Arrow lib.cycrow.match.css



    Match an entry in a comma seperated string
    If you have a list of items in a single string seperated by commas, this can check if an item is in that list.

    IE, if the css is string1,string2,string3. Then you can match if string1 is in the list.


Arrow lib.cycrow.math



    Maths Library

    • lib.cycrow.math.floatcos: Coverts the X3 angels into a float figure for cos
    • lib.cycrow.math.floatsin: Coverts the X3 angels into a float figure for sin
    • lib.cycrow.math.forward: Computes a forward vector position to a given distance


Arrow lib.cycrow.menu.mystations



    Station Menu, creates a menu and returns the selected station.
    The menu displays stations matching a given class and race owner.
    Stations are split up into thier sectors



_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Alien Tech Inc.



MEDALMEDALMEDAL

Joined: 28 Mar 2009
Posts: 653 on topic
Location: UK
Thank you for registering your game
PostPosted: Fri, 26. Mar 10, 14:11    Post subject: Reply with quote Print

OK, stupid question time (sorry Embarassed )
I've downloaded the scripts above, unzipped them and they are all .xml files
Do I copy them to a folder in the game directory ? If so which one ?

Also are they of any use to me, even if I'm not writing scripts myself ?

Thanks in advance
Alien

Back to top
View user's profile Send private message
Argonaught.





Joined: 06 Nov 2002
Posts: 1618 on topic
Location: Omnipotence rules!
Thank you for registering your game
PostPosted: Fri, 26. Mar 10, 14:24    Post subject: Reply with quote Print

All the Library scripts here are for use by scripters and of no use to anyone but a scripter, they would be used as extra parts that a scripter might use in their scripts etc.

So unless you are scripting you won't need them.

HTH

Argo.


_________________
[MOD]X3TC No Fog / [MOD]X3AP No Fog / [MD]X3TC Menagerie Shipyard / [MD]X3AP Menagerie Shipyard
<==<<Argonaught>>==>

XBTF>XT>X2TT>X3R>X3TC>X3AP

I lurk alot for the most part now
Thumb up
Back to top
View user's profile Send private message Visit poster's website
Syr3L





Joined: 18 May 2007
Posts: 12 on topic
Location: Wels
Thank you for registering your game
PostPosted: Thu, 1. Nov 12, 20:14    Post subject: bug in lib.cycrow.math Reply with quote Print

hi cycrow
you have 3 bugs in your script lib.cycrow.math.forward.xml
1st you need to fix the rotation for x y and z axis to have minus values
fix is:
$rotAlpha = $rotAlpha - 32768
$rotBeta = $rotBeta - 32768

2nd: this will cause value overflow due to limitations in the integer range:
$move.x = ( ( $dist * $sinAlpha ) * $cosBeta ) / 1000000
$move.z = ( ( $dist * $cosAlpha ) * $cosBeta ) / 1000000

fix is:
$move.x = ( $dist * $sinAlpha ) / 1000
$move.x = ( $move.x * $cosBeta ) / 1000
$move.z = ( $dist * $cosAlpha ) / 1000
$move.z = ( $move.z * $cosBeta ) / 1000

3rd: this will couse mirrowed point calculations due to cos 0 = -1 in this case. We tested it and dont know why this happens
$y = $y + $move.y

fix is:
$y = $y - $move.y

with this fixes it creates the points in a 360 degree range with 5 meters correction in 20km distance

hope you will correct it
thx Syr3L

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 Fri, 20. Oct 17, 18:21

All times are GMT + 2 Hours


Board Security

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