[Script] - Logain Industries Capital Ship Energy Cell Generator (CSecG) v2 12/09/2010

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Fri, 17. Sep 10, 22:55

Coruskane wrote:ok a few comments:

1)

Your Cseg.check is returning the swapped round values (or from another perspective they are being interpreted wrongly). S, M and L sizes are being given the wrong charge multiplier. Lines 30-38 of Cseg.menu.

Just change them round.

2) Using propmongler, I was unable to see Cseg running on any AI ships, though looking at the script I am not sure why it would. Didn't you state this as an intention?

On the other hand, all the variables for the player ship and player-owned ships were fine when the ship was explicitly set up to run Cseg.

How about, when processing signal_attacked, if the capital ship is not player-owned it defaults to a randomly chosen capacitor size (including size 0, aka none) with a random amount of charge in it, and then is given a local variable array with the default values in.

3) Needs subtitles alerting at critical points, such as half energy used etc

4) Needs a line in the menu telling how much energy is charged

5) Too cheap. S should be around 2m, M ~5m and L ~10m (for a capital). Unfortunately, this makes it trickier to balance for M6s/M7s etc. Perhaps make the capacitor storage a hard value instead, so an M6 is comfortable with an S size, M7 for M size and M2 for L size. Values could be 1gj for S size, 5 GJ for M size, 10GJ for L size. This would enable higher price on the L size etc but still allow M6 to use an S sized comfortably.

6) I will check the scripts more later, but I just wanted to give it a whirl first :) So far, seems nice.

Point 1: Looks fine to me, it should return 1 for L, 2 for M and 3 for S sized Capacitors.
From CSecG.check:

Code: Select all

 $installed = [THIS]->get true amount of ware {Capacitor L} in cargo bay
  if $installed > 0 
    return 1
  else
    $installed = [THIS]->get true amount of ware {Capacitor M} in cargo bay
    if $installed > 0 
      return 2
    else
      $installed = [THIS]->get true amount of ware {Capacitor S} in cargo bay
      if $installed > 0 
        return 3
      else
      end
    end
  end
From CsecG.Menu:

Code: Select all

$type = [THIS]->call script 'plugin.LI.CSecG.Check' : check=3 
if $type > 0 
  $installed = [TRUE] 
  if $type == 1 
    $total = ( $max.s + $max.w ) * 3 
  else if $type == 2 
    $total = ( $max.s + $max.w ) * 2 
  else if $type == 3 
    $total = ( $max.s + $max.w ) 
  end
Point 2: The NPC part has not been completed yet and will come as a AL plug-in

Point 3: I can look at adding subtitles

Point 4: It already does, have a look at the menu. Its shows the Capacitor type & the current charge.

Point 5: Yes it's to cheap, I'll probably double the price. As for fixed storage values, there are balance issues that’s why I went for a multiplier of the ships power output.

You could have an M6 with a 10G capacitor owning M1 ships with fixed values, you can't limit the type of capacitor installed as they are currently XL sized.

Making the benefit tied into the overall ships power performance felt more logical at the time.
However its all early days.

Keep up the great feedback ;)

LA

Requiemfang
Posts: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Post by Requiemfang » Fri, 17. Sep 10, 23:21

Neat... I like the changes that are happening here :twisted:

Coruskane
Posts: 849
Joined: Fri, 13. Jun 08, 13:14
x4

Post by Coruskane » Sat, 18. Sep 10, 00:33

hmm, I will have to check my source of my belief that the values of L/M/S were mixed up :P

Then, regarding balance, I have to ask; why not do away with the whole capacitor thing and just have it consume/produce e-cells? The balance would then come naturally out of cargo hold size. It might make it feel more tangible to the player and more 'real', and less like magicking a battlefield advantage out of thin air - after all, with the turbo-booster and jumpdrive e-cells are a very fundamental part of the game. There could then be 3 versions of the E-cell generator itself that controls the rate of consumption/production. Just a thought heh..

I have been trying this with vanilla so far, but I might try it on my main install with CMOD; in combination with the significantly reduced damage CMOD has it could make battles last a satisfyingly long time :)

Requiemfang
Posts: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Post by Requiemfang » Sat, 18. Sep 10, 00:43

Battles will last even longer if you apply a mod that increases hull of ships :wink:

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Sat, 18. Sep 10, 10:59

Coruskane wrote:hmm, I will have to check my source of my belief that the values of L/M/S were mixed up :P

Then, regarding balance, I have to ask; why not do away with the whole capacitor thing and just have it consume/produce e-cells? The balance would then come naturally out of cargo hold size. It might make it feel more tangible to the player and more 'real', and less like magicking a battlefield advantage out of thin air - after all, with the turbo-booster and jumpdrive e-cells are a very fundamental part of the game. There could then be 3 versions of the E-cell generator itself that controls the rate of consumption/production. Just a thought heh..

I have been trying this with vanilla so far, but I might try it on my main install with CMOD; in combination with the significantly reduced damage CMOD has it could make battles last a satisfyingly long time :)
The original version did use E Cells, but you would need a lot of E Cells to make any kind of difference (unless you give then some really high return value), and most ships don't have the storage space spare once kitted out.

A Capacitor is a known technology for storing energy, it's not a great leap to have specialised ones for augmenting ship systems.

LA

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Sun, 19. Sep 10, 21:19

@ Coruskane

The AL Plug-in for adding Capacitors to NPC ships in finished. Once I've run some tests I'll pm you an updated version. Should be tomorrow evening.

LA

Coruskane
Posts: 849
Joined: Fri, 13. Jun 08, 13:14
x4

Post by Coruskane » Mon, 20. Sep 10, 03:07

Logain Abler wrote: Point 1: Looks fine to me, it should return 1 for L, 2 for M and 3 for S sized Capacitors.
From CSecG.check:

Code: Select all

 $installed = [THIS]->get true amount of ware {Capacitor L} in cargo bay
  if $installed > 0 
    return 1
  else
    $installed = [THIS]->get true amount of ware {Capacitor M} in cargo bay
    if $installed > 0 
      return 2
    else
      $installed = [THIS]->get true amount of ware {Capacitor S} in cargo bay
      if $installed > 0 
        return 3
      else
      end
    end
  end
From CsecG.Menu:

Code: Select all

$type = [THIS]->call script 'plugin.LI.CSecG.Check' : check=3 
if $type > 0 
  $installed = [TRUE] 
  if $type == 1 
    $total = ( $max.s + $max.w ) * 3 
  else if $type == 2 
    $total = ( $max.s + $max.w ) * 2 
  else if $type == 3 
    $total = ( $max.s + $max.w ) 
  end
Coruskane wrote:hmm, I will have to check my source of my belief that the values of L/M/S were mixed up :P
Unfortunately, I found my source: https://www.humyo.com/FWQbYxl/Public/X3 ... mgB-0e3h5w :(

Coruskane
Posts: 849
Joined: Fri, 13. Jun 08, 13:14
x4

Post by Coruskane » Mon, 20. Sep 10, 03:10

Logain Abler wrote:@ Coruskane

The AL Plug-in for adding Capacitors to NPC ships in finished. Once I've run some tests I'll pm you an updated version. Should be tomorrow evening.

LA
great, I look forward to it.

As far as my above post: the wares are added via plugin manager and then in-game via Waremanager, yes? I am not sure how/why/if they are getting mixed up due to something in this area: I have no experience with adding wares through plugin manager as personally I prefer to get my mitts on the files themselves and install manually, so I know exactly what is going on (well, most of the time :P).

I tested on a copied clean install vanilla dir (+ req scripts/cheat pack/propmongler) and installed as per user instructions (i.e. through plugin manager). I am not sure where else I can provide info that can help on this particular issue.

edit: ignore the rather tell-tale sign of MARS etc in the photo; they were taken in a modded game, but I did originally see this phenomenon in the aforementioned testing environment

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Mon, 20. Sep 10, 10:49

Coruskane wrote:
Logain Abler wrote:@ Coruskane

The AL Plug-in for adding Capacitors to NPC ships in finished. Once I've run some tests I'll pm you an updated version. Should be tomorrow evening.

LA
great, I look forward to it.

As far as my above post: the wares are added via plugin manager and then in-game via Waremanager, yes? I am not sure how/why/if they are getting mixed up due to something in this area: I have no experience with adding wares through plugin manager as personally I prefer to get my mitts on the files themselves and install manually, so I know exactly what is going on (well, most of the time :P).

I tested on a copied clean install vanilla dir (+ req scripts/cheat pack/propmongler) and installed as per user instructions (i.e. through plugin manager). I am not sure where else I can provide info that can help on this particular issue.

edit: ignore the rather tell-tale sign of MARS etc in the photo; they were taken in a modded game, but I did originally see this phenomenon in the aforementioned testing environment
Strange that it only installed the ECG and one of the Capacitor types.
The setup.LI.CSecG xml handles this by calling the ware manager script, can you check via SE and ensure that the wares are showing correctly?

LA

Coruskane
Posts: 849
Joined: Fri, 13. Jun 08, 13:14
x4

Post by Coruskane » Mon, 20. Sep 10, 13:29

it installed all 3, however I will check what the IDs are.

What is bizarre is that the SPK package is fine, your install is fine, yet mine is messing up Ware IDs. In a minute (currently CPU is locked up in a process) I will check in TC and add some debug lines to the script to print the Ware ID that is being seen by plugin.csesg scripts and by the game itself. If that too is also consistent with what is expected then I am really at a loss for ideas :P

Failing that, I would suggest we just forget about this issue and put it down to the random hand of GOD; spending more time trying to work it out for what may just be an issue on my end is probably not constructive; I will get on with trying out the NPC aspect and so on.

p.s. any thoughts about a new name?

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Mon, 20. Sep 10, 14:08

Coruskane wrote: p.s. any thoughts about a new name?
Some good ones ;)

How about:
AdvSPM (Advance Ship Power Management)
AdvSPS (Advance Ship Power Storage)
AdvSPA (Advance Ship Power Augmentation)

LA

Coruskane
Posts: 849
Joined: Fri, 13. Jun 08, 13:14
x4

Post by Coruskane » Mon, 20. Sep 10, 17:23

sounds good, but the "Adv" bit is a bit of a mouthful when in shortened form.

ASPS rolls off the tongue nicely though; could also be Advanced Ship Power Strategy/System

ASPA is also nice.

https://www.humyo.com/FWQbYxl/Public/X3 ... 0H1is_B5t0

some info on the wares. It is meaningless to me, and I checked the TwareT added by the plugin manager, and the plugin manager text file and it is all fine. So..assume for now that it is a local issue ^^.

User avatar
TrixX
Posts: 2035
Joined: Wed, 18. Aug 10, 14:28
x3tc

Post by TrixX » Mon, 20. Sep 10, 17:38

ASPS sounds the best, it's like a bunch of snakes storing power for ya :lol:
"If you’re not prepared to be wrong, you’ll never come up with anything original."
Sir Ken Robinson

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Sat, 25. Sep 10, 13:10

CSecG 3 Beta

This version adds two new power management features and a AL Plug-in which adds the new features to NPC Capital ships.

For the player, there are three new Capacitors added as wares via the .spk file:
Capacitor L which stores 3 * maximum Shield & Laser power and costs 3.3 mil
Capacitor M which stores 2 * maximum Shield & Laser power and costs 2.2 mil
Capacitor S which stores 1 * maximum Shield & Laser power and costs 1.1mil

When fitted the player owned ship can change the Capacitors with the EGC, this saved energy can then be used to boost the ship Shield & Weapons power.

The AL Plugin is used to add the Shield & Power boost feature to NPC capital ships.
Just turn on the AL Plug-in and open the options menu via Community Plugin Configuration.

The options are:
Add to NPC Ships:
None – Won't add on next scan
The next ones are based on a random number between 0 & 100
Low – will add if random number id less than 20
Medium – will add if random number id less than 40
High– will add if random number id less than 80
All – will add to all

Race:
Selected Races will be added to the search/scan

Type/Class:
This says type but it means class (will correct for release)
The selected classes will be added to the search/scan

The scan is currently every 5 minutes.
If you add to the selection it will affect the next scan. If you remove from the selection it is removed straight away.
Allocated Capacitor type is also random.
The NPC ships will have a recharge task until full then it exits (keep task load down, although initially it will be high)
Secondary Attack signal is added, when this exits it will start the above task to recharge the capacitors, rinse & repeat.

Requires Community Plugin Configuration by Cycrow.

I'm classing this as a beta to get feedback any issue and to see if the task runs none obstructively in the background.

Once I'm happy the OP will be updated.

Download via Google Code


LA

Sorenson
Posts: 340
Joined: Thu, 9. Apr 09, 00:43
x3tc

Post by Sorenson » Thu, 30. Sep 10, 06:42

There any chance you could provide a link to version 1 in the OP? I made use of it quite a lot for dealing with my TL fleet and patrolling frigates and destroyers, but some of the stuff in the new versions kinda' worry me: half because I don't really care about the extra functionality like in V3 and dislike baggage getting added like in V2, and half because it seems like some of this stuff ain't workin' properly - wares having empty name entries and being worth 28 spacebucks and other stuff that gets me all paranoid and stuff. Luckily I've got a backup, but I'll bet quite a few folks get the same thing or just want the straight deal that V1 gives them.
X3TC Naval Shuffle: My ships are fast; my shields are strong; and my guns are very, very large.

Wintersdark
Posts: 238
Joined: Thu, 15. Jan 09, 17:12
x4

Post by Wintersdark » Thu, 30. Sep 10, 08:24

Yeah, while I can see the gnarliness of the new stuff, I honestly preferred the original as well. Nice, simple e-cell generation, no software or what have you to deal with.

Coruskane
Posts: 849
Joined: Fri, 13. Jun 08, 13:14
x4

Post by Coruskane » Thu, 30. Sep 10, 20:44

@Sorenson:

The new one is quite nice...try it :)

But, if you really want one without wares and so on you can edit v3 to that state in about 2 mins:

1) open up the spk in spk packager (*not spk explorer*) and remove the wares from Cycrow's ware tab.

2) open up plugin.LI.CSecG.Check.xml in the Script Editor

3) Line 005 (because you removed the reference to the ware) will probably look something like this:

Code: Select all

$installed = [THIS]->get true amount of ware {?} in cargo bay
4) use your arrow keys to scroll right and highlight the ware parameter and hit enter

5) scroll down the list of valid variables until you see Var/Ware

6) select it and scroll through the list of wares until you find Supply Command Software

7) bingo...you now have what is functionally the same as v1. (check that the CSecG options have all the Capacitor/NPC features etc turned off in the config, and the relevant processes will exit near immediately removing most all of the (already very reasonable) overhead.)

Iirc LA (usefully) refers to the state of the $install variable rather than hardcoding checking for the ware in the script routines, therefore it is easy peasy to change the conditions for $install.

Hth...

@LA: see pm. Hope I was even remotely useful.

Sorenson
Posts: 340
Joined: Thu, 9. Apr 09, 00:43
x3tc

Post by Sorenson » Thu, 30. Sep 10, 21:18

Functionally, yes, but as I said that's only half the issue: I see these gaping, glaring holes when I try to use the script and that instantly sets off a bunch of alarms, even if it may just be the case of a text file failing to load properly: "something is wrong here, something isn't working right, whatever it is may interfere with other stuff."
X3TC Naval Shuffle: My ships are fast; my shields are strong; and my guns are very, very large.

Coruskane
Posts: 849
Joined: Fri, 13. Jun 08, 13:14
x4

Post by Coruskane » Fri, 1. Oct 10, 00:14

ok, you need to provide more info on the problem then (if only for the sake of others :P)

By empty name you mean e.g. SS_Ware_XX or simply just no string at all?

If the former then it is possibly an issue with TWareT. If the latter then it is possibly an issue with the text file being referenced for the name of the ware. The ware should reference Cycrows plugin manager text file (I forget its number). Can you see if the entries are correct in there and correspond to what TwareT is expecting?

What version of plugin manager are you using? LA uses the current beta version, and I have seen issues regarding spks packaged in the beta being installed with the stable release. If you wish to not use the plugin manager then you must manually append the wares to whatever the highest TwareT is, and change the name references to something that exists.

In X3 editor could you load up the VFS and see what is being used for TWareT.

The plugin manager, if the spk has installed correctly, *should* in theory take highest precedence TWareT, append the spk-added ware entries to it, then package it as pck and stick it in TC\Types. As such, wares added through this method should be compatible with other mods that modify TWareT so long as the plugin manager has been loaded at least once since any other modifications were installed. (though I must admit that I have had problems in this regard :D)

I realise you have a lot of experience with the Types files :) but..humans can be human..^^

edit: but yeah, I see your point for two versions. In a way, the two aspects could be completely decoupled into seperate 'modules', which for convenience could share the same core scripts but differ in that one is a mod and one is not.

Sorenson
Posts: 340
Joined: Thu, 9. Apr 09, 00:43
x3tc

Post by Sorenson » Fri, 1. Oct 10, 00:46

Coruskane wrote:ok, you need to provide more info on the problem then (if only for the sake of others :P)

By empty name you mean e.g. SS_Ware_XX or simply just no string at all?
See for yourself:
[ external image ]
If the former then it is possibly an issue with TWareT. If the latter then it is possibly an issue with the text file being referenced for the name of the ware. The ware should reference Cycrows plugin manager text file (I forget its number). Can you see if the entries are correct in there and correspond to what TwareT is expecting?
I'm using EMP 2, if that's somehow got to do with it.
What version of plugin manager are you using? LA uses the current beta version, and I have seen issues regarding spks packaged in the beta being installed with the stable release. If you wish to not use the plugin manager then you must manually append the wares to whatever the highest TwareT is, and change the name references to something that exists.
I've had trouble with both the stable and beta builds: heck, the Beta at least gave me Capacitor M and XL, after I went to the beta, nothin'.

As for the rest of the stuff like asking me to check the VFS and all that, maybe it's the sunus attack I'm havin', but it's more or less going right over my head, so at this time methinks all I'm good for is pointing my finger and saying a few vague-ass things.
I realise you have a lot of experience with the Types files :) but..humans can be human..^^
Yeah, forgive me if I come off as a dick or anything, I'm just blunt as a sack of hammers.
X3TC Naval Shuffle: My ships are fast; my shields are strong; and my guns are very, very large.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”