Well it sounds good in theory anyway.
Demo Script :
Add value selection to menu :
This script is a bit of a demo on how you can use the 'add value selection' command in a menu.
This is especially useful for Option and Settings menus. Download it and have a look at how i did it and use any parts / ideas that you find useful.
The script is heavily commented to help.
Disclaimer:
This is only how i have found how to use it and in no way indicates the Best or Only way it can be used.
Download 'script' and 't' files from google code:
Add value selection to Menu Demo v1 Zip
Screenshot:
[ external image ]
An excellent tutorial on 'Add value selection' to menus by ScRaT_GER
can be found here.
Utility Script :
Clone Station or Shipyard v3
This script is useful if you need to clone a Station or Shipyard due to an installed Mod giving you trouble or any other reason and you need to create a replacement.
You may even just wish to boost the economy in your game or create specific station layouts in your game. This will help make it a lot easier.
This script can also be called by other scripts to perform the same funtion by supplying the script call arguments provided.
Also very useful for testing scripts and mods.
- Hotkey settable in controls menu.
- Target station and use hotkey.
- Follow the menu prompts.
NOTE:
This script will NOT work on Player owned Complexes !! (but it will clone NPC multi product factories )
Download 'script' files from google code:
SPK:
MarCon Clone Station v3 Spk
ZIP:
MarCon Clone Station v3 Zip
MINI Scripts :
Emergency Brake v1
Sets 2 hotkeys, one works on Player Ship and the other on the player tracking aim if it is a ship and owned by the Player.
Simple script code,
PlayerShip,
[ external image ]
Tracking Aim,
[ external image ]
Downloads,
SPK:
E Brake v1 Spk.
ZIP:
E Brake v1 Zip.
(All we need now is for someone to come up with a Mod for Airbags in TC)
Library Scripts :
Get All Sectors by Race v1.
Call this script and set the argument for the race you want and it will return an array of all the sectors in the universe belonging to that race. If you set the race to 'null', it will return an array of All the sectors in the universe.
If you use it, i would suggest a name change in case someone else uses it and mods the script.
This script is available for Download, see below.
Code: Select all
Version: 1
for Script Engine Version: 44
Description
Returns array of all sectors in Universe, race selectable.
Arguments
1: Race , Var/Race , 'Race, null = All :'
Source Text
001 * --------------------------------------------------------------------------------
002 * Author : mark_a_condren a.k.a MarCon
003 * --------------------------------------------------------------------------------
004 * Created : May - 2010
005 * --------------------------------------------------------------------------------
006
007 *$Testing = [TRUE]
008 $Testing = [FALSE]
009
010 $max.x = get max sectors in x direction
011 $max.y = get max sectors in y direction
012
013 $x = 0
014 $y = 0
015
016 $sectors.array = array alloc: size=0
017
018 while $x <= $max.x AND $y <= $max.y
019 |$sector = get sector from universe index: x=$x, y=$y
020 |if $sector -> exists
021 ||if not $Race == null
022 |||$sector.owner = $sector -> get owner race
023 |||if $sector.owner == $Race
024 ||||append $sector to array $sectors.array
025 |||end
026 ||else
027 |||append $sector to array $sectors.array
028 ||end
029 |end
030 |if $y == $max.y
031 ||$y = 0
032 ||inc $x =
033 |else
034 ||inc $y =
035 |end
036 end
037
038 if $Testing
039 |$Sectors.count = size of array $sectors.array
040 |$desc = sprintf: fmt='%s', $Sectors.count, null, null, null, null
041 |$ret = open custom menu: title='Sectors :' description=$desc option array=$sectors.array
042 |$sect = $sectors.array[$ret]
043 |$sect = sprintf: fmt='%s', $sect, null, null, null, null
044 |display subtitle text: text=$sect duration=3000 ms
045 end
046
047 return $sectors.array
ZIP:
lib_All_sectors_array_by_race_xml Zip.
Get All Sectors by Race ARRAY v1.
Same as above, but it takes an array of races to return all sectors beloging to any race you put into the array.
Just create the array of the races you want to get the sectors for, in any manner you wish, then past the array as an argument to the script when you call it.
If you use it, i would suggest a name change in case someone else uses it and mods the script.
Code: Select all
Version: 1
for Script Engine Version: 44
Description
Lib - Get all sectors from universe, by race array.
Arguments
1: race.array , Value , 'Inc Races Array, Null = All:'
Source Text
001 * --------------------------------------------------------------------------------
002 * Author : mark_a_condren a.k.a MarCon
003 * --------------------------------------------------------------------------------
004 * Created : May - 2010
005 * --------------------------------------------------------------------------------
006
007 $Testing = [TRUE]
008 *$Testing = [FALSE]
009
010 $max.x = get max sectors in x direction
011 $max.y = get max sectors in y direction
012
013 $x = 0
014 $y = 0
015
016 $sectors.array = array alloc: size=0
017
018 while $x <= $max.x AND $y <= $max.y
019 |$sector = get sector from universe index: x=$x, y=$y
020 |if $sector -> exists
021 ||if $race.array
022 |||$race = $sector -> get owner race
023 |||if find $race in array: $race.array
024 ||||append $sector to array $sectors.array
025 |||end
026 ||else
027 |||append $sector to array $sectors.array
028 ||end
029 |end
030 |if $y == $max.y
031 ||$y = 0
032 ||inc $x =
033 |else
034 ||inc $y =
035 |end
036 end
037
038 if $Testing
039 |$Sectors.count = size of array $sectors.array
040 |$desc = sprintf: fmt='%s', $Sectors.count, null, null, null, null
041 |$ret = open custom menu: title='All Sectors :' description=$desc option array=$sectors.array
042 end
043
044 return $sectors.array
Download 'script' files from google code:
ZIP:
lib_All_sectors_array_ByRaceArra_xml
Script Code Snipets :
Get Ship Current Action Text :
001 $ship.current.action = $ship -> get current action
002 $ship.current.action.t.id = $ship.current.action + 350 ...
003 $ship.current.action.txt = read text: page= 14 id= $ship.current.action.t.id
Get Ship Command Text :
001 $ship.cmd = $ship -> get command
002 $ship.cmd.sub = get subtype of ware $ship.cmd
003 $ship.cmd.txt = read text: page= 2010 id= $ship.cmd.sub
Get the Ware Transport Class Abreviation : ('Extra Large Containers XL' becomes 'XL')
001 $t.class = get transport class of ware $ware
002 $t.class.abrev = read text: page = 1999 id= $t.class
(page 1999 is a stock Egosoft page file)
I will be adding quite a few more files here over time.
MarCon
Permissions :
You have my permission to use these Script Packages / Files / Demo's or part thereof in your your own work if you so wish. Please give credit if you do.
You can find an Unedited Permissions Statement Here :