|
|
 |
View previous topic :: View next topic |
 |
|
|
|
|
Author |
Message |
|
|
|
|
|
apricotslice
Joined: 16 May 2004 Posts: 10955 on topic Location: Mapping beyond the Unknown Regions.

 |
Posted: Mon, 15. Oct 07, 10:06 Post subject: [Mod] Apricot Salvage Mod (Beta) |
|
|
Apricot Salvage Mod
by Apricotslice
In the Office of John Slice, CEO, Apricot Mapping Service
Ah, pilot, come in, sit down.
I have all your scores here in front of me, and I was at a loss what to do with you. You are an average pilot, useless marksman, overuse the auto pilot, tend to damage ships for no particular reason, useless mechanic, should I go on ? Hmmmm, no.
The question was what to do with you.
Well, that answer came this morning on my way to work. Your going to clean this universe up !
No, wipe that smirk off your face, it doesnt mean your going to be sheriff. I mean your going to be a janitor to the whole universe and clean up all the debris, derelict ships, containers and whatnot that are left lying around all over the place.
I'm sick to death of having all this debris cluttering up the space ways and making coming to work a hazard instead of a joy. Your going to clean it up for me !
We've outfitted a Disco for you with some pretty nifty software.
Your ship will be updated with the locations of all known derelict ships, and a new command has been added to take you right there so you can salvage the ship. Its up to you what you do with them, but get them off the space lanes !
You have also been given software to help you claim without leaving your ship, up to a distance of 5km.
Also, you have been entrusted with the software to automate a ship into clearing the debris in the asteroid fields. And the new advance in HQ software that allows stations to be set up within the HQ instead of complexing them.
Ok pilot, you have a lot of work to do, get out there and do it !
-------------------------------------------------------
Download : http://circleofatlantis.com/games/X3/salvage.html
Install using Cycrows X Plugin Manager.
Uses 10cat/10.dat.
Copy the 00.save file in the X3 directory to your save file directory.
-------------------------------------------------------
Apricot Salvage Mod.
Task 1 : Collect Derelict Ships.
The X universe is a very dangerous place. But one of its oddities is that only ships being fired apon by the player will be abandonned by their pilot. This just isnt real. In reality, all sorts of reasons would have all sorts of pilots abandonning ship on a constant basis. So with this in mind, .....
Every time the game is started, 12 derelict ships will be created in random locations with random damage and fittings. This can be altered by either copying the main setup script in the script editor a few more times to get more, or deleting a few to get less - 1 ship per script.
A new command is on the Nav menu to jump your ship to a random derelict ship. Apricot Mapping Service makes no warranty about soiled underwear should you find yourself in a sea of red dots all of a sudden. The command is rinky dink, and does not check for the existance of a jumpdrive or enough ecells. If you dont have them, you dont go anywhere, simple as that. Where you go, is entirely random ! What you do when you get there is your problem.
Task 2 : Asteroid Debris Clearing.
Since 1.4, the universe has been filled with debris that makes flying around sectors dangerous.
So your job is to assign ships to clear the debris and sell it or stockpile it.
Task 3 : Container Clearing.
There is garbage being dropped all over the universe by careless ships that manage to get themselves destroyed through sheer stupidity. Make sure it all gets collected up and disposed of efficiently.
Scripts Included :
Apricot Beamdock (Apricot's private version)
Apricot Jump to Derelict Ship
Apricot mess up the universe with derelict ships
Cycrow System Override Software Mk2
Auto Debris Harvestor v2.0 by Nividium
Install Station to PHQ by MJALowe
Mod Included :
PHQ with 50 Mil in storage space, but no blueprints.
Save Included :
00.sav
Start Position :
The save game bypasses the Aspiring Explorer Start, putting you in a Disco in CBSE, with a few extra goodies in the cargo hold. You are just 1 jump away from your first salvage operation.
Beta version and my first attempt at a spk distrubution file, so please let me know if it works ok.
----------------------------------------------------
Original OP follows :
I just want to make a quick and dirty script that will find all ships in the universe with a neutral race, and print the sector onto the logbook. Position in sector optional.
I can learn how to embellish the message later, but for now, I just need the code to just find the ships and display in the log the sector they are in.
Anyone help ? Much appreciated if you can. 
_________________ Apricot Mapping Services HQ
CLICK HERE for : X3 Handbook; Guides; X3TC Apricot Mapping Service (Gunbus) Mod v2.12; X3TC Scripts; X3 Mods & Scripts.
Apricot X3 Forum
Apricot Download Mirror Site
Last edited by apricotslice on Fri, 19. Oct 07, 08:17; edited 3 times in total |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
LV Moderator


Joined: 06 Nov 2002 Posts: 5581 on topic Location: The Dark Side

|
Posted: Mon, 15. Oct 07, 10:31 Post subject: |
|
|
| Code: |
007 $input.array = array alloc: size=0
008 $ships = get ship array: of race Neutral class/type=Moveable Ship
010
011 $as = size of array $ships
016
017 while $as > -1
018 $single = $ships[$as]
019 if $single -> exists
020 $sec = $single -> get sector
023 append $single to array $input.array
024 append $sec to array $input.array
028 end
029 @ = wait 1 ms
030 dec $as =
031 end
032
write to logbook $input.array |
That will return each ship and it's sector to log
for pos use get x,y,z in second general menu (press page down 2x to find)
_________________ Simple and Free Script Hosting
LV's TC Scripts
You Post, Therefore I Am.... (in spain at the moment) |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Nividium

Joined: 21 Aug 2007
|
Posted: Mon, 15. Oct 07, 10:46 Post subject: |
|
|
Here's my version of the find abandon ships code:
| Code: |
001 $ship.array = get ship array: of race Neutral Race class/type=Moveable Ship
002 $ship.array.size = size of array $ship.array
003 while $ship.array.size > 0
004 dec $ship.array.size =
005 $ship = $ship.array[$ship.array.size]
006 $x = $ship -> get x position
007 $y = $ship -> get y position
008 $z = $ship -> get z position
009 $sector = $ship -> get sector
010 write to player logbook: printf: fmt='Ship = %s, Sector = %s, X = %s, Y = %s, Z = %s', $ship, $sector, $x, $y, $z
011 @ = wait 2 ms
012 end
013
014
015 return null |
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
apricotslice
Joined: 16 May 2004 Posts: 10955 on topic Location: Mapping beyond the Unknown Regions.

|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
TycHouse
Joined: 06 Nov 2002 Posts: 416 on topic Location: North Wales

|
Posted: Mon, 15. Oct 07, 12:11 Post subject: |
|
|
Could i just point out that in LV's script the 'dec $as' statement on line 030 should be on line 018 ie before the '$single = $ships[$as]' statement.
Edit: also noticed that the 'while' statement should just be 'while $as' (or perhaps 'while $as > 0').
Reasons ? An array of 4 elements is actually element [0] - [3] therefor you need to decrement the count before you assign the ship object otherwise you are trying to perform '$single = $ships[4]' in the first iteration which is clearly wrong.
{sorry LV, not trying to insult you just thought i'd clear that up for others reading}
_________________ AMD Phenom 9950 2.6ghz quad core
MSI K9N2 Diamond Motherboard
4gb DDR2 800mhz matched memory
Geforce GTX260 896mb DDR3
Creative X-Fi Soundcard
Windows Vista Ultimate 32bit |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
apricotslice
Joined: 16 May 2004 Posts: 10955 on topic Location: Mapping beyond the Unknown Regions.

|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Carlo the Curious

 
Joined: 05 Mar 2007 Posts: 13804 on topic Location: London, UK

|
Posted: Mon, 15. Oct 07, 12:53 Post subject: |
|
|
Further down in Universe/Sector commands.
_________________
 |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
apricotslice
Joined: 16 May 2004 Posts: 10955 on topic Location: Mapping beyond the Unknown Regions.

|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Carlo the Curious

 
Joined: 05 Mar 2007 Posts: 13804 on topic Location: London, UK

|
Posted: Mon, 15. Oct 07, 13:00 Post subject: |
|
|
There's more than one variant in Universe commands - look harder!
I think there is an external editor around someplace, but I don't have the link.
_________________
 |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
apricotslice
Joined: 16 May 2004 Posts: 10955 on topic Location: Mapping beyond the Unknown Regions.

|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
apricotslice
Joined: 16 May 2004 Posts: 10955 on topic Location: Mapping beyond the Unknown Regions.

|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
B-O'F
Joined: 21 Feb 2004 Posts: 719 on topic

|
Posted: Mon, 15. Oct 07, 13:47 Post subject: |
|
|
Hi apricotslice,
Use the command:-
write to log file #<Var/Number> append=<Var/Number> printf: fmt=<Var/String>, <Value>, <Value>, <Value>, <Value>, <Value>
instead of the:-
write to player logbook: printf: fmt=<Var/String>,<Value>,<Value>,<Value>,<Value>,<Value>
It needs a numeric input for the 'log file #<Var/Number>' - I normally use the date, like 1015.
The rest of the information can be the same as used in the write to logbook command (you can pretty it up later).
Then just alt-tab out of the game and look for 'log1015.txt' in the reunion folder - it should have all your data ready for word processing or printing.
Hope that this helps,
Boron - Ol Fh'art
_________________ Public Service announcement
Growing old is not a disease - it is a delayed symptom of birth trauma. |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
apricotslice
Joined: 16 May 2004 Posts: 10955 on topic Location: Mapping beyond the Unknown Regions.

|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
B-O'F
Joined: 21 Feb 2004 Posts: 719 on topic

|
Posted: Mon, 15. Oct 07, 17:56 Post subject: |
|
|
Hi apricotslice,
Headings and footings can be handled in the same script as the rest.
script
$message1 = 'string of stuff for the heading'
$message2 = 'string of stuff for the footing'
* write the heading
* change the TRUE to FALSE to start a new log
write to log file # 1015 append=[TRUE] value= $message1
the rest of your script to write stuff out
* write the footing
write to log file # 1015 append=[TRUE] value= $message2
End of script
You can make things easier by defining $log.id = 1015, and then using $log.id instead of entering 1015 in the write to log commands - this means that you can write data from each run to a different log file just by changing the $log.id = command. This is handy if you want multiple versions.
You can prettify things by using correct spacing - this works for a log file as it is monospaced - have a quick look at Prices of all wares for examples of spacing.
Any help,
Boron - Ol Fh'art
_________________ Public Service announcement
Growing old is not a disease - it is a delayed symptom of birth trauma. |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
LV Moderator


Joined: 06 Nov 2002 Posts: 5581 on topic Location: The Dark Side

|
Posted: Mon, 15. Oct 07, 22:52 Post subject: |
|
|
| TycHouse wrote: |
| Could i just point out that... |
No worries, i've written every script that i have in that format because if it aint broke......
I know how arrays work now but it's down to the fact it works for me as i always have null checks
_________________ Simple and Free Script Hosting
LV's TC Scripts
You Post, Therefore I Am.... (in spain at the moment) |
|
|
|
|
|
|
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
|
 |
|
|
|
|
|