EnglishGermanFrenchRussianItalianSpanish
Log inRegister
 
[Mod] Apricot Salvage Mod (Beta)
Post new topic Reply to topic Goto page 1, 2, 3  Next
View previous topic :: View next topic
Author Message
apricotslice





Joined: 16 May 2004
Posts: 13629 on topic
Location: In the Hunter Legacy Universe
Thank you for registering your game
modified
PostPosted: Mon, 15. Oct 07, 10:06    Post subject: [Mod] Apricot Salvage Mod (Beta) Reply with quote Print

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. Smile


_________________
Apricot Mapping Services HQ
CLICK HERE for X3 Handbook; TC and AP Guides, Mods, Scripts & Downloads


Last edited by apricotslice on Fri, 19. Oct 07, 08:17; edited 3 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
LV
Sith Lord




Joined: 06 Nov 2002
Posts: 6359 on topic
Location: The Dark Side
Thank you for registering your game
PostPosted: Mon, 15. Oct 07, 10:31    Post subject: Reply with quote Print

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)


_________________
LV's TC Scripts
Readme's For All My Scripts


I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced

si tacuisses, philosophus mansisses
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Nividium





Joined: 21 Aug 2007



PostPosted: Mon, 15. Oct 07, 10:46    Post subject: Reply with quote Print

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
View user's profile Send private message
apricotslice





Joined: 16 May 2004
Posts: 13629 on topic
Location: In the Hunter Legacy Universe
Thank you for registering your game
PostPosted: Mon, 15. Oct 07, 11:01    Post subject: Reply with quote Print

Thankyou Smile


_________________
Apricot Mapping Services HQ
CLICK HERE for X3 Handbook; TC and AP Guides, Mods, Scripts & Downloads
Back to top
View user's profile Send private message Send e-mail Visit poster's website
TycHouse





Joined: 06 Nov 2002
Posts: 486 on topic
Location: North Wales
Thank you for registering your game
PostPosted: Mon, 15. Oct 07, 12:11    Post subject: Reply with quote Print

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 FX-8350 Eight-Core 4.0GHz Processor
ASrock Extreme 3 R2.0 Motherboard
8Gb memory
2 x AMD HD7770 Graphics (Crossfire not enabled)
Windows Vista Ultimate 64bit SP2
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
apricotslice





Joined: 16 May 2004
Posts: 13629 on topic
Location: In the Hunter Legacy Universe
Thank you for registering your game
PostPosted: Mon, 15. Oct 07, 12:45    Post subject: Reply with quote Print

This is what I hate about this editor.

I know what to put, but where do I find the stupid line ?

Quote:
$ship.array = get ship array: of race Neutral Race class/type=Moveable Ship


The only thing remotely like it is in universe but logic dictates it should be in general, arrays.

But nothing seems to allow this line to be built as written.

Embarassed

HELP !

This call for help was brought to you by the Apricot Salvage Service, a wholey owned subsiduary of the Apricot Mapping Service.


_________________
Apricot Mapping Services HQ
CLICK HERE for X3 Handbook; TC and AP Guides, Mods, Scripts & Downloads
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Carlo the Curious





Joined: 05 Mar 2007
Posts: 15622 on topic
Location: London, UK
Thank you for registering your game
PostPosted: Mon, 15. Oct 07, 12:53    Post subject: Reply with quote Print

Further down in Universe/Sector commands.

Back to top
View user's profile Send private message Visit poster's website
apricotslice





Joined: 16 May 2004
Posts: 13629 on topic
Location: In the Hunter Legacy Universe
Thank you for registering your game
PostPosted: Mon, 15. Oct 07, 12:58    Post subject: Reply with quote Print

I found that one, but it doesnt construct the same line.

It wants a variable, so I type in ship.array, then it wants an object of some kind, and thats it. Nothing about race or class.

I cant find any other command line that has get ship array in it.


_________________
Apricot Mapping Services HQ
CLICK HERE for X3 Handbook; TC and AP Guides, Mods, Scripts & Downloads
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Carlo the Curious





Joined: 05 Mar 2007
Posts: 15622 on topic
Location: London, UK
Thank you for registering your game
PostPosted: Mon, 15. Oct 07, 13:00    Post subject: Reply with quote Print

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
View user's profile Send private message Visit poster's website
apricotslice





Joined: 16 May 2004
Posts: 13629 on topic
Location: In the Hunter Legacy Universe
Thank you for registering your game
PostPosted: Mon, 15. Oct 07, 13:03    Post subject: Reply with quote Print

External editor ????????

Where, gimme gimme gimme

Smile

Edit :

Yay, crowd goes wild Smile

Yes it was further down. The manual didnt say there were 2 variations either. Sad


_________________
Apricot Mapping Services HQ
CLICK HERE for X3 Handbook; TC and AP Guides, Mods, Scripts & Downloads
Back to top
View user's profile Send private message Send e-mail Visit poster's website
apricotslice





Joined: 16 May 2004
Posts: 13629 on topic
Location: In the Hunter Legacy Universe
Thank you for registering your game
PostPosted: Mon, 15. Oct 07, 13:30    Post subject: Reply with quote Print

Touch down !!!!

Crowd goes absolutely berzerk !

Next problem Smile

What do I change to get it to print to an external file ?

Damn thing came back with more than I expected and I really need to print them out. Smile


_________________
Apricot Mapping Services HQ
CLICK HERE for X3 Handbook; TC and AP Guides, Mods, Scripts & Downloads
Back to top
View user's profile Send private message Send e-mail Visit poster's website
B-O'F





Joined: 21 Feb 2004
Posts: 719 on topic

Thank you for registering your game
PostPosted: Mon, 15. Oct 07, 13:47    Post subject: Reply with quote Print

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
View user's profile Send private message
apricotslice





Joined: 16 May 2004
Posts: 13629 on topic
Location: In the Hunter Legacy Universe
Thank you for registering your game
PostPosted: Mon, 15. Oct 07, 14:04    Post subject: Reply with quote Print

Thanks. Got that working Smile

Only thing thats not working now is putting a heading and footing on it. Do I need to do that in onother script and call this one from it ?

Just putting the heading at the top and footing at the bottom printed the heading half way down the report and no footing at all.

Hey, I'm learning this ! Smile


_________________
Apricot Mapping Services HQ
CLICK HERE for X3 Handbook; TC and AP Guides, Mods, Scripts & Downloads
Back to top
View user's profile Send private message Send e-mail Visit poster's website
B-O'F





Joined: 21 Feb 2004
Posts: 719 on topic

Thank you for registering your game
PostPosted: Mon, 15. Oct 07, 17:56    Post subject: Reply with quote Print

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
View user's profile Send private message
LV
Sith Lord




Joined: 06 Nov 2002
Posts: 6359 on topic
Location: The Dark Side
Thank you for registering your game
PostPosted: Mon, 15. Oct 07, 22:52    Post subject: Reply with quote Print

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


_________________
LV's TC Scripts
Readme's For All My Scripts


I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced

si tacuisses, philosophus mansisses
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic Reply to topic Goto page 1, 2, 3  Next
 
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 Sun, 17. Dec 17, 11:54

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2017
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.12790 seconds, sql queries = 29