[SCRIPT] Cycrows Library Scripts

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22226
Joined: Sun, 14. Nov 04, 23:26
x4

[SCRIPT] Cycrows Library Scripts

Post by Cycrow » Wed, 3. Jun 09, 16:09

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
  • [ external image ]

    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
  • [ external image ]

    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
  • [ external image ]

    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 :arrow: lib.cycrow.getrankpage :arrow: lib.cycrow.getresource
  • [ external image ]

    Returns the resource array for a station, either primary or secondary resources
:arrow: lib.cycrow.getshiptypefromclass
  • [ external image ]

    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
  • [ external image ]

    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
  • [ external image ]

    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
  • [ external image ]

    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

User avatar
Alee Enn
Posts: 2575
Joined: Sat, 28. Mar 09, 16:03
x4

Post by Alee Enn » Fri, 26. Mar 10, 13:11

OK, stupid question time (sorry :oops: )
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
Formerly "Alien Tech Inc."

User avatar
Argonaught.
Posts: 1827
Joined: Wed, 6. Nov 02, 20:31
x4

Post by Argonaught. » Fri, 26. Mar 10, 13:24

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>X4F

I lurk alot for the most part now
:thumb_up:

Syr3L
Posts: 12
Joined: Fri, 18. May 07, 21:03
x3tc

bug in lib.cycrow.math

Post by Syr3L » Thu, 1. Nov 12, 19:14

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

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”