EnglishGermanFrenchRussianItalianSpanish
Log inRegister
 
[SCR] [TC/AP] Equip ships v6
Post new topic Reply to topic Goto page 1, 2  Next
View previous topic :: View next topic
Author Message
chms





Joined: 21 Oct 2004
Posts: 164 on topic
Location: Terra - mangels Alternative ;)
Thank you for registering your game
modified
PostPosted: Sun, 5. Feb 12, 20:43    Post subject: [SCR] [TC/AP] Equip ships v6 Reply with quote Print

This script allows equipment of ships almost automatically:
(Almost because of a few menus to configure equipment)


Version 6

Alternative download link from xdownloads:


Even there are significant costs for equipment You might see this script as a cheat because there is no check of reputation or availability of goods at the equipment dock.

Screenshots can be found within the German discussion at: http://forum.egosoft.com/viewtopic.php?t=316370


What are the different scripts for?
Quote:
1. Main-script "CS.LOOP.Schiffe.ausruesten"
Parameter: none

The script runs in an continuous loop and checks two conditions:
Are there more than 100.000 credits at player's account and is the player's ship docked at any station?
In this case You will get a list to select a ship waiting at an equipment dock to be equipped.
The script decides by name of ship whether a ship needs equipment or not (equipped ships carry a '°' in their names).
The selected ship will be equipped using the following scripts and all turrets will be set to 'missile defense' (!turret.missiledefense.std).

If no ship was selected the menu will not re-appear before the player docks at another station.

Quote:
2. The script for extensions "CS.SUB.Erweiterungen"
Parameter: The ship to be equipped

This script is called from the main script and equips the ship after showing a selection menu.

Quote:
3. The script for shields "CS.SUB.Schilde"
Parameter: The ship to be equipped

This script is called from the main script and equips the ship with the maximum installable shields.
Weaker shields are removed.

Quote:
4. The script for lasers "CS.SUB.Laser"
Parameter: The ship to be equipped

This script - the most complicate of all my scripts - is called from the main script and checks for a present configuration which will be shown to the player in order to decide whether to change it - or not.
Without changes the ship is automatically equipped with the pre-set lasers.
To change You'll be shown a menu with all turrets (only by numbers, no directions like 'front' or so) and lasers installed (or not).
For all changes are made within the ship (install and remove) changing of weapons directly will result in costs.
If possible all empty slots can be filled with ONE type.
The menu can only be left if there are no empty slots.
Configuration is stored in a global variable.
Unfortunately I found no way to write AND read configuration to/from a file...
Therefor with EVERY new game You will have to reconfigure.


How are costs calculated?
For every piece of equipment installed the MAXIMUM price is added to total.
For every piece of equipment removed the MINIMUM price is deducted from total.
As a result it can happen the total amount of a laser is 0 costing 100.000 Credits...

As additional charge 20% of the total amount - at least 1000 credits - are added.

If You are unable to pay all the price at once for each hour (in-game-time) there is an interest of 1% to the remaining amount.

As long the order isn't completely payed there no new orders can be given.

How do I install the scripts?
UnZIP the file and put the scripts into TC's and/or AP's scripts-folder(s).
The language file(s) have to be located to the corresponding t-folder(s).

How do I start the scripts?
On activation of the script-editor the script "setup.CS.Schiffsausruester" will ask You if the script shall be run - now, later or not.
Running later as global script can be done by a "Re-Init Script Caches" or executing script "CS.LOOP.Schiffe.ausruesten".

How to uninstall the scripts?
Normally I would say: delete them.
The script checks "Am I still here?" and ends itself if not. (I hope problems are avoided that way.)
Version 5 adds a check for the version of the script engine disabling the file-check for TC.
Therefore there's no warranty deleting of files will be enough or even damage Your savegame. (A hint from experienced scripters would be helpful here. Thanks.)

Does the script run with TC?
With Version 5 it should run on TC (see above)

Problems with other scripts?
Not tested.
But as the equipment is checked only by the name of a ship (with or without "°"), there might be problems with scripts or mods "messing around" with the ship-names.

There was a message like "xxx destroyed". How do I restore my equipment?
Rename the ship by removing the "°". (e.g. make "Your Buster°" "Your Buster"again.)
And - of course - send the ship to an equipment dock.
Warning: If You changed the default armament the lasers will be equipped using the new configuration (additional costs).


Have fun.

BTW: I'd be happy about ANY responses (Happy about ANY? Not really but... Wink)

Changelog:
v4.01: In v4 the laser slots where empty or the existent lasers were shown instead of the lasers to be installed when asking to use saved configuration. Fixed.


Edit [1st December 2015]: added alternative download link from xdownloads. X2-Illuminatus



Last edited by chms on Mon, 30. Jul 12, 21:13; edited 4 times in total
Back to top
View user's profile Send private message
chms





Joined: 21 Oct 2004
Posts: 164 on topic
Location: Terra - mangels Alternative ;)
Thank you for registering your game
modified
PostPosted: Thu, 8. Mar 12, 01:30    Post subject: Reply with quote Print

Version 5 has arrived - and should run with TC now:

<Link removed - please use recent link>

Changelog:
  • File-check skipped within TC (for use with TC).



_________________
Inactive atm due to very slow internet access (via cell phone).


Last edited by chms on Mon, 30. Jul 12, 21:19; edited 2 times in total
Back to top
View user's profile Send private message
chms





Joined: 21 Oct 2004
Posts: 164 on topic
Location: Terra - mangels Alternative ;)
Thank you for registering your game
PostPosted: Mon, 30. Jul 12, 21:10    Post subject: Reply with quote Print

Version 6 is available for download.

Changes:

  • In TC the laser configuration was not shown – fixed
  • In case of turrets with no compatible lasers (e.g. „Minotaurus“ in German version) the configuration menu could not be left – fixed
  • There now is an option to put every available equipment into a ship – with a few restrictions (e.g. the „carrier software“ cannot be installed into a ship with less than 10 docking slots)
  • Ships can also be equipped when docked at a shipyard or the player's headquarter


Have fun - and please report errors You discover. Thanks


_________________
Inactive atm due to very slow internet access (via cell phone).
Back to top
View user's profile Send private message
vukica





Joined: 10 Aug 2008
Posts: 1307 on topic
Location: Croatia
Thank you for registering your game
PostPosted: Tue, 28. Aug 12, 15:32    Post subject: Reply with quote Print

this is what i was looking for! will try it out

EDIT: OK, it works good but i just wish it worked as a ship command, and not something automatic and namechanging. also once it's activated you need to select something for the equipment. would be useful if you could skip any stage.


_________________
Split say NEED MORE FIREPOWER!!
Back to top
View user's profile Send private message
chms





Joined: 21 Oct 2004
Posts: 164 on topic
Location: Terra - mangels Alternative ;)
Thank you for registering your game
PostPosted: Tue, 28. Aug 12, 22:54    Post subject: Reply with quote Print

vukica wrote:
i just wish it worked as a ship command, and not something automatic and namechanging.

I was thinking of making this a ship command but when I wrote the script I just ran into trouble with possible destruction of ship and payment - and somehow "ignored" the ability to use global variables. (a)
The namechanging was made for the script AND the user to easily know which ships are already equipped. (b)

vukica wrote:
also once it's activated you need to select something for the equipment. would be useful if you could skip any stage.

see (b) as well...


  1. I will check if I can change this.
    If it is necessary to do again from scratch: No way - sorry.
  2. If I do the above I also will try to add commands to make these things optional like

    • View/Change equipment for this ship
    • Equip this ship automatically (if configuration is available)
    • Disable renaming of equipped ships
    • Allow renaming of equipped ships

But it can take some time depending on spare time and mood Wink


_________________
Inactive atm due to very slow internet access (via cell phone).
Back to top
View user's profile Send private message
vukica





Joined: 10 Aug 2008
Posts: 1307 on topic
Location: Croatia
Thank you for registering your game
PostPosted: Tue, 28. Aug 12, 22:55    Post subject: Reply with quote Print

thanks for the response, i hope you do it Smile


_________________
Split say NEED MORE FIREPOWER!!
Back to top
View user's profile Send private message
AerrorKen





Joined: 25 May 2013



PostPosted: Thu, 30. May 13, 02:18    Post subject: Reply with quote Print

I like the idea of this script. In Vanilla, it seems we are restricted to only a select few ships, when it comes to easily equipping large fleets with attached eq docks. The idea of using this script to experiment with hordes of different ship types is appealing.

However, when I go to download, rapidshare displays an error and then goes to a page with a red box with the following info:

The download for this file has not been enabled. Only the user who uploaded it, can enable the download option.

Pretty please, re-enable the download?

Back to top
View user's profile Send private message
chms





Joined: 21 Oct 2004
Posts: 164 on topic
Location: Terra - mangels Alternative ;)
Thank you for registering your game
PostPosted: Fri, 31. May 13, 22:16    Post subject: Reply with quote Print

Corrected a setting I can't remember of changing it.


Please try again


_________________
Inactive atm due to very slow internet access (via cell phone).
Back to top
View user's profile Send private message
Pontiac





Joined: 11 Jul 2013
Posts: 12 on topic

Thank you for registering your game
PostPosted: Thu, 11. Jul 13, 00:19    Post subject: Reply with quote Print

Is there a way to see how much more is still owed for the parts purchased, or, do I get a notification when I'm done paying it off?

[Edit] You're notified. WOULD be nice to see a tally while you're paying the thing off so you know how often you get neutered to 10k cr. Wink

Back to top
View user's profile Send private message
Pontiac





Joined: 11 Jul 2013
Posts: 12 on topic

Thank you for registering your game
PostPosted: Tue, 26. Nov 13, 06:16    Post subject: Reply with quote Print

I found a bug with this script and the Valhalla.

This particular ship has 12 guns available for front, right and left turrets. If I go to equip slot 10 or 11, slot 1 actually gets the upgrade. Now, I'd give this up to just trimming too much of the string and the text "Laser #10" is being seen as "Laser #1". I can deal with that, however, there is a problem with the logic of "Requiring every slot to be filled to "quit"".

The Valhalla uses two different sets of guns for the front, left, and right, versus the top, rear, and bottom. The option to "Fill with a gun of a particular type if possible" will not work. So I can't just default to whatever is available because there are no common guns between the two sets. Ok, fine, however, since the first paragraph indicates a problem with equipping laser #10 and 11, and I'm forced to fill out the load out which I cannot complete, so I'm stuck and cannot abort the script.

So I'm asking for one of two things;

I'm a developer and have looked at your code, but its still murky as I'm not familiar with the language and structure Egosoft is using. First question is, where abouts would I remove the logic that the load out MUST have full guns fitted, or where can I see the error with the slot number its trying to load to? Honestly, the restriction of requiring a full load out kind of seems rather odd since perhaps I just want a fully fitted ship with no guns as it'll be just used for ferrying between two points of interest.

Second, after the fix is done, what is the procedure to unload the script from my current saved game, then re-apply the fix? Do I just use the "delete files, save, load, install, load, re-save" method?

Fortunately, I saved just before I bought the Valhalla, so I'm not screwed yet. Wink

Back to top
View user's profile Send private message
chms





Joined: 21 Oct 2004
Posts: 164 on topic
Location: Terra - mangels Alternative ;)
Thank you for registering your game
PostPosted: Tue, 26. Nov 13, 16:28    Post subject: Reply with quote Print

Bad timing Wink

As I'm playing X:R and don't have x3 installed at the moment it's hard to detect an error by using a simple xml-editor.

All the stuff referring to the lasers is done within the script "CS.SUB.Laser.xml".

The easiest way to avoid problems here <u>for now</u> might be the following - if You decide to completely ignore the lasers:

Edit (ingame) the file "CS.LOOP.Schiffe.ausruesten.xml"
Make the line calling the script for lasers a comment (should be the key [.])
Increase the version number by 1
Save file and exit the script-editor.

With the increased version number the script will restart itself (as far as I remember)


As soon as I pause X:R and re-install TC/AP I will have a closer look at this problem - but might take a while Wink


_________________
Inactive atm due to very slow internet access (via cell phone).
Back to top
View user's profile Send private message
Pontiac





Joined: 11 Jul 2013
Posts: 12 on topic

Thank you for registering your game
PostPosted: Tue, 26. Nov 13, 17:29    Post subject: Reply with quote Print

I kind of figured that XR would be my downfall the MOMENT I found this problem. Wink

German is probably in my blood from about 5 generations ago, and I barely even remember the swear words I learned from when my family was here so many years ago... If I can't remember swear words, just think of how well I'm going to remember REGULAR words. Wink So, I'mma gunna have fun with translating some of these variable names to figure out what goes where. :]

I have the X3 script editor running, and it seems that the script does get changed periodically. I found out that your script forces an hour delay between refits (Escaping the initial request doesn't count it seems) and I just couldn't wait to refit this ship I stole. So dug in, found the time out, set it to 30 seconds, and saved it without changing the version number. This was a few weeks ago. Today, I just activated the script editor in game and noticed my change.

That all said, I'm going to have to run against the language file to see whats what, and go from there.

The other thing I'm wondering is to set a hot-key to activate this script when docked, but I'll save that for another day.

Edit:
So I found the code, and it skips the laser part. [edit-removed commentary about my screw up]. I just have to go find the weaponry for this, or, mess with the script some more to see if I can get it to quit. Wink



Another question. Would it be possible for the "Autofit" window to list all available guns to the ship, but only fit what is allowed in each slot? So I'll get the list of 7 guns available, but when I select a particular type, the script will loop through all slots with no gun mounted, verify that the slot is able to take the gun, then attach it if it will work.

(Once XR gets to a certain stage, I might buy it. I've been watching video streams and I'm not completely sold on it yet.)

Back to top
View user's profile Send private message
chms





Joined: 21 Oct 2004
Posts: 164 on topic
Location: Terra - mangels Alternative ;)
Thank you for registering your game
PostPosted: Wed, 27. Nov 13, 05:13    Post subject: Reply with quote Print

Pontiac wrote:
Another question. Would it be possible for the "Autofit" window to list all available guns to the ship, but only fit what is allowed in each slot? So I'll get the list of 7 guns available, but when I select a particular type, the script will loop through all slots with no gun mounted, verify that the slot is able to take the gun, then attach it if it will work.


I'm not sure if I understand this right, so I create a simple example Wink
Let's say we have 3 turrets.
#1 can carry type A and B, #2 type A and C, #3 B and C.
If I'm right You want a list showing A,B and C at one time to install Your preferred gun in as many slots as possible.
I'm sure this can be done but I don't know if this will need a simple change only or a complete rewrite.

When I get the time I will also look at this.

So the ToDo reads
correct weaponry for ships like Valhalla
complete list of lasers
create/optimize notification


_________________
Inactive atm due to very slow internet access (via cell phone).
Back to top
View user's profile Send private message
Pontiac





Joined: 11 Jul 2013
Posts: 12 on topic

Thank you for registering your game
PostPosted: Wed, 27. Nov 13, 20:34    Post subject: Reply with quote Print

Yeah, that is what my thought was. If the bug of not being able to fit slot 10 and 11 can't be fixed due to in-game restrictions, I think the "QUIT" option will have to allow the user to continue "as fit", or just allow the user to continue "as fit" as the script stands.

ABSOLUTELY NO RUSH on this. Enjoy XR. I'm probably one of the last few that are playing X3 instead of XR. Wink

If you don't want to do this, that'll be OK with me as well. I can always go through the script and convert the German variables to English so that I can probably work through the logic.

Edit:
Oh, the other thing I think you might want to do is in your "Check.Version" section in the LOOP script is add a title to the error section so that IF something goes missing, the user might be able to figure out what went missing. I had an issue with a script screwing up XRM, and it screwed over the Jonferco station. When I went to restage all my mods, I kept getting the error "Main file missing" error, and I had NO idea what it was. So what I did was modify your version to prefix the "Main file missing" with the name of your script, JUST in case something else gets buggered later on down the road and I have to restage. :]

Code:

if not does script exist: 'CS.LOOP.Schiffe.ausruesten'
[PLAYERSHIP]-> send incoming message: text='Equip Ships - Main file missing. Stopping script for equipment of ships' temporary=[TRUE]


Back to top
View user's profile Send private message
chms





Joined: 21 Oct 2004
Posts: 164 on topic
Location: Terra - mangels Alternative ;)
Thank you for registering your game
PostPosted: Thu, 28. Nov 13, 06:40    Post subject: Reply with quote Print

Pontiac wrote:
ABSOLUTELY NO RUSH on this.
...
If you don't want to do this, that'll be OK with me as well.

I will work over the script as soon as I find the time when the "hot phase" for XR is over - if I don't forget about it Wink

Pontiac wrote:
add a title to the error section

Very good idea - I never thought of that because when I started writing the script I didn't think of sharing it.


_________________
Inactive atm due to very slow internet access (via cell phone).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic Goto page 1, 2  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 Wed, 13. Dec 17, 09:29

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.27421 seconds, sql queries = 29