EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
[Utility Scripts] MarCon utility files and Demo's
Post new topic Reply to topic
View previous topic :: View next topic
Author Message
mark_a_condren





Joined: 03 Aug 2005
Posts: 1384 on topic
Location: Newcastle - Australia
Thank you for registering your game
modified
PostPosted: Thu, 15. Jul 10, 16:00    Post subject: [Utility Scripts] MarCon utility files and Demo's Reply with quote Print

It seems i'm getting posts to links to some of my Utility Scripts and Demo files spread all through the forum threads. So to counter this and make any updates to them a whole lot easier, i'm going to post them in this thread and provide links to them from here.

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:



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 Wink )

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,


Tracking Aim,


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


Download 'script' files from google code:

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


_________________
MarCon Ind - S.O.C.S.I : | Game Start Sector Reveal : | Asteroid Fusion : | TC Stock Exchange | MarCon Utilities / Demos | Universal Banking | Ingame DevChat GUI


Last edited by mark_a_condren on Tue, 28. Dec 10, 03:12; edited 11 times in total
Back to top
View user's profile Send private message Send e-mail
mark_a_condren





Joined: 03 Aug 2005
Posts: 1384 on topic
Location: Newcastle - Australia
Thank you for registering your game
modified
PostPosted: Thu, 15. Jul 10, 16:00    Post subject: Reply with quote Print

Font Information :

Font colors available :

Using the \033... format, the following letters represent available colors. These color codes must be read in from a text file and will not work if entered directly into the script.

B = Blue
C = Cyan
G = Green (Lime)
K = Black
M = Magenta (Violet)
O = Orange
R = Red
W = White
Y = Yellow
Z = Grey

X = Turns color off

Using all letters from the alphabet, a test script was run to produce the following results,


Other font Information :
Further font information is displayed below, this information was also script generated to get as accurate information as possible actually using the script engine.







Note, the information above says character '1' is size 7, while all other numbers are size 8, however, the comparison displayed shows no apparent difference in its size.




_________________
MarCon Ind - S.O.C.S.I : | Game Start Sector Reveal : | Asteroid Fusion : | TC Stock Exchange | MarCon Utilities / Demos | Universal Banking | Ingame DevChat GUI


Last edited by mark_a_condren on Sat, 11. Dec 10, 18:29; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail
mark_a_condren





Joined: 03 Aug 2005
Posts: 1384 on topic
Location: Newcastle - Australia
Thank you for registering your game
PostPosted: Wed, 28. Jul 10, 17:34    Post subject: Reply with quote Print

MINI Scripts section Added

The first one is 'E Brake'
It adds 2 hotkeys for the player to use. 1 works on the playership and the other on the player tracking aim.

Hit the hotkey and you or your target (if it belongs to you) will come to a rapid stop. See OP for download links.

MarCon


_________________
MarCon Ind - S.O.C.S.I : | Game Start Sector Reveal : | Asteroid Fusion : | TC Stock Exchange | MarCon Utilities / Demos | Universal Banking | Ingame DevChat GUI
Back to top
View user's profile Send private message Send e-mail
Serial Kicked





Joined: 12 Aug 2005
Posts: 3470 on topic
Location: France
Thank you for registering your game
PostPosted: Wed, 28. Jul 10, 17:43    Post subject: Reply with quote Print

Thanks for this demo Smile

i had some difficulties finding my way around these functions, it will look great in ADS.


_________________
Pirate Guild 3 - Yaki Armada 2 - Anarkis Defense System
Anarkis Federation HQ - Includes news, releases and a development wiki.
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
mark_a_condren





Joined: 03 Aug 2005
Posts: 1384 on topic
Location: Newcastle - Australia
Thank you for registering your game
PostPosted: Mon, 22. Nov 10, 06:03    Post subject: Reply with quote Print

LIBRARY Scripts section Added

The first one is '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.




The second one is '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 either of these scripts, i would suggest a name change in case someone else uses it and mods the script.


See the OP to view the code and for download links.

MarCon


_________________
MarCon Ind - S.O.C.S.I : | Game Start Sector Reveal : | Asteroid Fusion : | TC Stock Exchange | MarCon Utilities / Demos | Universal Banking | Ingame DevChat GUI
Back to top
View user's profile Send private message Send e-mail
mark_a_condren





Joined: 03 Aug 2005
Posts: 1384 on topic
Location: Newcastle - Australia
Thank you for registering your game
PostPosted: Sat, 11. Dec 10, 18:33    Post subject: Reply with quote Print

Font information added.

This can be found in the second post.

I hope it helps someone.


MarCon


_________________
MarCon Ind - S.O.C.S.I : | Game Start Sector Reveal : | Asteroid Fusion : | TC Stock Exchange | MarCon Utilities / Demos | Universal Banking | Ingame DevChat GUI
Back to top
View user's profile Send private message Send e-mail
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 Wed, 19. Jun 13, 07:15

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.33521 seconds, sql queries = 38