[SCR] Cargo Shield Array (v1.15 - 15.04.08)

The place to discuss scripting and game modifications for X³: Reunion.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

[SCR] Cargo Shield Array (v1.15 - 15.04.08)

Post by Gazz » Sat, 5. Jan 08, 21:21

(Das entsprechende deutsche topic ist hier.)

Cargo Shield Array... by Gazz

>>> You want? You click! <<<

This script allows you to connect additional shield units in you cargo hold to the installed shields of your ship.

1. Only the best shield type that can be installed on your ship is usable.

2. Each of these shields is worth fewer shield points than a normally installed shield.
The more extra shields you use, the worse this ratio gets, although every extra shield adds *something*.

3. These extra shields were never part of the original design and running the main shield controller far above design specs will result in a loss of recharge rate.
One or two extra shields will not be very noticable but it will always mean a loss of shield points regenerated per minute.

Since ship and shield types vary greatly, a message to your log will tell you exactly which effect you get from the current loadout.



INSTALLATION
============
- Using the ZIP file, copy everything into the main X3 folder, preserving paths.

- Using the SPK, double click it.

- Once in the game, assign the hotkey under
Controls - Interface - Extensions.


USAGE
=====
1. The only control for this script is one hotkey.

2. This script is always and only started on the PLAYERSHIP, the one you fly.
The script will however remain running on any ship once it has been started.

3. If you have a TRADING STATION targeted when using the hotkey, any and all instances of this script on all ships in your game will be terminated.
This process may take 2-3 minutes if some of them are in sleep mode.
You will not be able to start the script again until you save and reload the game.

4. Normally you get a message log entry with all the values whenever you alter the number of shields for such a ship.
If you have a SHIP YARD targeted when using the hotkey, the script will be muted and not write anything to your log until you repeat this.

5. If you remove the extra shields from the cargo hold the script will automatically go into sleep mode to save CPU power. It may take up to 2 minutes to wake up.
You can restart it immediately with the hotkey if you wish - at least on the ship you are flying.

The frequent calculations are kept simple so a few hundred of these scripts should not bog down your game.



Resources:
T-Page ID: 7027
Task ID (ships): 7027
Logfile (if enabled): 7027

Global array: GZ.SHIELDSUP.CONFIG (Index 2 contains the sole hotkey)

No command buttons or wares used.

Files:
scripts\plugin.gz.shieldsup.hotkey.xml
scripts\setup.plugin.gz.shieldsup.xml
scripts\plugin.gz.shieldsup.main.xml
t\447027.xml
t\497027.xml
Readme\Cargo-Shield-Array_EN.txt
Readme\Cargo-Shield-Array_DE.txt


Version history:
----------------------------------------------
1.00 First release. No bugs.
----------------------------------------------
1.10 I lied. Fixed integer overflow with large shields.
----------------------------------------------
1.15 Fixed rounding inaccuracy introduced in 1.10.
----------------------------------------------
Last edited by Gazz on Tue, 22. Apr 08, 00:42, edited 6 times in total.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Sat, 5. Jan 08, 21:22

(reserved)

User avatar
Jaga_Telesin
Posts: 435
Joined: Sat, 16. Sep 06, 22:48
x4

Post by Jaga_Telesin » Fri, 28. Mar 08, 01:44

Having a problem with this script on capital ships. I can install as many cargo bay shields as I want and the script will start, but on a regular interval (didn't time it) it will drop a large portion of charged up shield strength, and start re-charging.

I have used the script with the Hyperion just fine, and didn't have problems until now with capital ship use.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Fri, 28. Mar 08, 12:29

My first guess would be some kind of integer overflow when very high shield strenghts are calculated.

Don't think I ever tested this with "real" cap ships but if it works with the Hyperion then the math can't be off by more than one digit.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
Jaga_Telesin
Posts: 435
Joined: Sat, 16. Sep 06, 22:48
x4

Post by Jaga_Telesin » Fri, 28. Mar 08, 19:15

The testing I did was on the Argon Titan, which normally carries 9 1GJ shields. And with just the one additional shield, it does the periodic shield resets. Adding in more shields sets the final shield strength right, but the periodic shield charge resets (drains) make it unusable with that cap ship (and possibly others).

I believe there are other ships in the X3 (I use XTM as well) universe that have well over 10GJ of shielding, so it must be somewhere in the logic or calculations?

One additional suggestion, is that the gains from each additional cargo bay shield are a bit too high. Without much trouble I have the Hyperion up over 6GJ, with only an overall 12% loss to recharge (25% to the new shields). I can take out quite a few capital ships with this configuration, and M3s mean nothing to it now (even dozens of them). You might want to consider dropping the shield gains a bit for balance.

Otherwise, a great script.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Mon, 14. Apr 08, 23:03

Version 1.10 released.

Integer overflow fixed.
Theoretical max shielding is around 1 TJ now.

Tried it with a Phoenix and got total shields just over 30 GJ. Too bad the recharge rate dropped below 50 %. That's a looooooong wait.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
Jaga_Telesin
Posts: 435
Joined: Sat, 16. Sep 06, 22:48
x4

Post by Jaga_Telesin » Mon, 14. Apr 08, 23:30

Thanks Gazz, I'll give it a try. By the way - did you add in compatibility for Military Shields in 1.10? It never worked before with non-standard shields.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Mon, 14. Apr 08, 23:35

Military Shields?
I've never heard about such a thing before.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
Jaga_Telesin
Posts: 435
Joined: Sat, 16. Sep 06, 22:48
x4

Post by Jaga_Telesin » Mon, 14. Apr 08, 23:37

It is possible it is part of the XTM package (I never play without it), and so not a standard shield item. They are basically same strength, faster recharge versions of the regular ones.

Needless to say it was sad to cap my first P in this latest game, only to find out it doesn't work with the cargo shielding due to only using the 125MJ Military Shields.

================

Edit: Here is the info on the Military and other type of shields from the XTM package:

- "Military 5MJ, 25MJ, 125MJ, 500MJ, 5GJ shields as well as special pirate and Sohnen shields"

It would be nice to have full compatibility with XTM, but I don't expect you to do a second script just for it. But I did want to point out that using your script with XTM makes certain ships the obvious advantage, and the new shield types nearly useless. :)

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Tue, 15. Apr 08, 22:35

Jaga_Telesin wrote:It would be nice to have full compatibility with XTM, but I don't expect you to do a second script just for it. But I did want to point out that using your script with XTM makes certain ships the obvious advantage, and the new shield types nearly useless. :)
Ah, I rather think it's the contrary.
With Mil shields you get faster recharge so actually more protection per hour.
With CSA you even get a reduction in recharge rate but a bigger buffer.

Depending on your playstile either can be "best". =)


BTW: Version 1.15 released.

Fixed a rounding inaccuracy that crept in with the alteration for higher shield capacities.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
Jaga_Telesin
Posts: 435
Joined: Sat, 16. Sep 06, 22:48
x4

Post by Jaga_Telesin » Wed, 16. Apr 08, 01:46

Yes, I understand your viewpoint. Smaller but much faster recharging, or much larger and way longer to recharge. I'll take the second any day of the week.

In my last game, the Hyperion I had with 6.6GJ of shielding could take out most capital ships 1v1 and smile while doing it. It felt good to have a strong cruiser that had that much protection, although a bit too well protected if you get my meaning. I don't think I could drop back to the old 3GJ, even if they were military shields. I don't see the advantage in faster recharging, as shields recharge inbetween battles. But that's my playstyle I guess.

Will go install 1.15 and see how she does. I have yet to get out of this Xenon P which has military shields and fly something I can use this script on.

User avatar
Jaga_Telesin
Posts: 435
Joined: Sat, 16. Sep 06, 22:48
x4

Post by Jaga_Telesin » Mon, 21. Apr 08, 01:50

Just some feedback, with a possible bug report.

Recently purchased a Galleon (XTM M1 carrier, 6x1GJ shielding) and dropped in 7 1GJ shields. Hit the hotkey to activate the script, and heard the typical sound. Noticed the shield strength dip down a bit as would be expected when adding an uncharged shield to the array.

However, I received no message in my log indicating that the new shield was increasing total shield strength, nor can I see any more GJ being added to the usual 6 in any display I use (sector info, ship info, etc). So from what I can tell, it beeps at me like it wants to work, but doesn't.

I'd be glad to give more info if you need it.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Mon, 21. Apr 08, 02:12

There is a way to mute those log messages. See the first post under "Usage".

Other than that it sounds normal.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
Jaga_Telesin
Posts: 435
Joined: Sat, 16. Sep 06, 22:48
x4

Post by Jaga_Telesin » Mon, 21. Apr 08, 02:24

Yep, that was it - I had somehow (unintentionally) activated the hotkey with a yard targeted, and it muted all messages. While that's a decent feature to have, it does pose possible problems like I ran into (and I'm not a complete dunce). :)

Thanks for pointing it out Gazz, all appears to be working well!

User avatar
Jaga_Telesin
Posts: 435
Joined: Sat, 16. Sep 06, 22:48
x4

Post by Jaga_Telesin » Tue, 29. Apr 08, 04:02

Quick update for you Gazz in regard to some XTM stuff I noticed and the results from the Cargo Shields:

Picked up a Poseidon (XTM M2) that uses 5GJ shields, and the message from the script seems to think that 2x5GJ = 20GJ. Example: if I drop in 4 5GJ shields it wants to report the "normal" shield strength (of the 2x5GJ) as 20GJ. I think it is confused about the nonstandard shields and reporting them as 10's. They are not military shields, just normal 5GJ ones.

I don't have a way of sensing what the actual final shield strength with the script running is, other than the message, which appears incorrect.

bp2019
Posts: 402
Joined: Mon, 13. Nov 06, 02:54

Post by bp2019 » Tue, 29. Apr 08, 05:51

Unfortunately (me not being a script genius) I believe XTM added in NEW shields, and might of POSSIBLY shuffled the old shields into new slots in order to do so, the script will likely get confused on this and give out strange readings.

Even if this is not the case, the only real way to get this script to work properly under XTM would be to go a much different way of calculating using more CPU power, or creating a version specifically for XTM with the added shield levels, perhaps get this script working with VANILLA shielding and then ask nicely for XTM compatibility?

EDIT: thinking about it I dont think the shields would of moved slots, however as a 5gj is not a vanilla shield then it probably isn't in the scripts maths, therefore as its bigger than a 1gj the script seems to have no alternative but to assume or treat it as a 10.

However an XTM version would require a script modification to deal with these new shielding values, both total power and recharge rates.

User avatar
Jaga_Telesin
Posts: 435
Joined: Sat, 16. Sep 06, 22:48
x4

Post by Jaga_Telesin » Tue, 29. Apr 08, 05:55

Didn't think I was asking in an un-nice way at all. In fact, I didn't specifically *ask* for anything. I give feedback based on my play experiences, so that scripters can improve their work. As a modder for other games I can fully say that this kind of feedback is one of the most desirable and necessary if a piece of work is truly to succeed.

Short story - Gazz is free to do whatever he wants with the script, as it is his creation. I am merely giving info on what I see, that might affect others.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Tue, 29. Apr 08, 12:36

I did indeed take a shortcut by hardcoding the 6 basic shields and just typing in their sizes.

The alternative would be to create a dummy ship of the same type, add 1 shield of "best" size and get the shield value.
However, I don't know if the script function would return the newly modded shields at all or if these newfangled shields even have a higher shield value to qualify for the function.
With me not using XTM this probably isn't going to happen.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

bp2019
Posts: 402
Joined: Mon, 13. Nov 06, 02:54

Post by bp2019 » Tue, 29. Apr 08, 16:31

I wasn't trying to say you didn't ask nicely, I was merely saying that scripts generally have to be tested on vanilla X3 first and once that runs, iron out any issues with mod compatibility, while other scripts simply work with mods.

Sorry if I made you think I was trying to insult you or something. :oops:

Once the script is 100% which shouldn't be far off if it isnt already then perhaps ask if you can modify the script yourself for XTM compatibility and post that version in this same thread? 8)

User avatar
Sartorie
Posts: 389
Joined: Sat, 10. Apr 04, 13:05
x3tc

Post by Sartorie » Tue, 29. Apr 08, 18:22

The order of shields in XTM is a bit messed up ... the 5GJ was inserted before the 10GJ (thereby taking its positon) and the other new shields are at the end of the file ...

Post Reply

Return to “X³: Reunion - Scripts and Modding”