|
|
 |
View previous topic :: View next topic |
 |
|
|
|
|
Author |
Message |
|
|
|
|
|
Cycrow Moderator (Script&Mod)


Joined: 15 Nov 2004 Posts: 19848 on topic Location: London

|
Posted: Wed, 3. Jun 09, 16:09 Post subject: [SCRIPT] Cycrows Library Scripts |
|
|
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.
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
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
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
lib.cycrow.getnotamt
Get Notority amount for specific rank.
lib.cycrow.getrankpage
Returns the pageid for the ranks of a given race
lib.cycrow.getresource
Returns the resource array for a station, either primary or secondary resources
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
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.
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
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 |
|
|
|
 |
|
|
|
|
|
Alien Tech Inc.


Joined: 28 Mar 2009 Posts: 506 on topic Location: Inside Your Monitor

|
Posted: Fri, 26. Mar 10, 14:11 Post subject: |
|
|
OK, stupid question time (sorry )
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 |
|
|
|
 |
|
|
|
|
|
Argonaught.

Joined: 06 Nov 2002 Posts: 1575 on topic Location: Omnipotence rules!

|
Posted: Fri, 26. Mar 10, 14:24 Post subject: |
|
|
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
 |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Syr3L
Joined: 18 May 2007 Posts: 12 on topic Location: Wels

|
Posted: Thu, 1. Nov 12, 20:14 Post subject: bug in lib.cycrow.math |
|
|
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 |
|
|
|
 |
|
|
|
|
|
|
|
 |
|
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
|
 |
|
|
|
|
|