Weapon stats all screwed up [AP]

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

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

User avatar
TECSG
Posts: 1610
Joined: Tue, 17. Feb 04, 22:06
x3tc

Weapon stats all screwed up [AP]

Post by TECSG »

Not sure if this is a bug or what, but after investigating why my 'equip ship' command suddenly started outfitting fighters and freighters with Mobile Drilling Systems I did a bit of searching and found out the two commands for getting a weapons hull/shield damage now return completely different values to what is listed in the in-game encyclopaedia.

For example, I was equipping a Mistral Super Freighter which can support the following weapons:
  • Impulse Ray Emitter
    Particle Accellerator Cannon
    Mobile Drilling System
    Tractor Beam
    Repair Laser
    Phased Repeater Gun
    Ion Disruptor
My script should (and used to in TC) detect the PRG as the best (ie, most powerful) weapon to equip, but instead it now selects the MDS.

After checking the stats for the weapons and comparing them to the results returned by the 'get hull damage of laser <xxx>' and 'get shield damage of laser <xxx>' I found the following:

Code: Select all

Impulse Ray Emitter         (reports 21/220,    should be: 140/1400)
Particle Accelerator Cannon (reports 143/1155,  should be: 748/6000)
Mobile Drilling System      (reports 6500/2362, should be: 325/118)
Tractor Beam                (reports 0/0,       should be: 0/0)
Repair Laser                (reports 40/0,      should be: 200/0)
Phased Repeater Gun         (reports 72/680,    should be: 765/7200)
Ion Disruptor               (reports 5/1575,    should be: 10/3300)
The first two values are what the 'get damage' commands return (hull, then shield) and the second two are the values from the encyclopaedia. As you can see, the MDS reports to have a Hull Damage of 6500, thereby making it the most powerful of the weapons. Can anyone else confirm these figures (or is my game (and a clean 'vanilla' install) totally screwed)?

If this is correct, are the two commands

Code: Select all

<RetVar> = get shield damage of laser <Var/Ware>
<RetVar> = get hull damage of laser <Var/Ware>
completely useless now? (and if so, how do you detect the best weapons?)

Appreciate any help!
User avatar
Tiek
Posts: 166
Joined: Sun, 15. Aug 04, 12:21
x3tc

Post by Tiek »

Hi TECSG,

I am not sure but since in AP has been introduced a new system for the calculation of the damage OOS, can not be that the presence of at least two different scales of damage affecting the scripts for the selection of lasers based on the damage itself?
User avatar
TECSG
Posts: 1610
Joined: Tue, 17. Feb 04, 22:06
x3tc

Post by TECSG »

Hi Tiek,

I would think that the commands for returning the hull/shield damage values would read it from the cat/dat TLASER file(s) so that the command would also work for modded/new weapons. It shouldn't be specific to any particular version of X or mods/expansions/patches installed.

As you cannot specify IS/OOS status, I assume that shouldn't be a factor either.

Could be wrong though!
User avatar
Tiek
Posts: 166
Joined: Sun, 15. Aug 04, 12:21
x3tc

Post by Tiek »

The commands in question seeking data in TLaser or Tbullets? Because in TBullets (ver. AP) has indicated two distinct values ​​of damage IS and OOS. The same commands what value search?
User avatar
TECSG
Posts: 1610
Joined: Tue, 17. Feb 04, 22:06
x3tc

Post by TECSG »

I would think it's looking in TLaser, but maybe someone can confirm that one way or the other.
User avatar
Tiek
Posts: 166
Joined: Sun, 15. Aug 04, 12:21
x3tc

Post by Tiek »

I seem to recall that the new damage system is by Gazz; he could clarify the mechanics involved.
User avatar
apricotslice
Posts: 14163
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice »

I've seen a similar issue in game.

In red and plot sectors, my modified PBE's are hopelessly ineffective, where in all other sectors they kick arse.

What you posted suddenly made me wonder which set of figures are being access when, because the oos values for my guns would equate to about what I was experiencing.

Makes me wonder if there is some bugs in the relevant commands.
User avatar
TECSG
Posts: 1610
Joined: Tue, 17. Feb 04, 22:06
x3tc

Post by TECSG »

Hi apricotslice,

Should IS/OOS be relevant when (if) applied to these commands though, surely 'get best weapon' should return the most powerful (ie, that does the most damage) weapon irrespective of the situation.

The values returned do not match the stats for the weapons and, more importantly, are not all 'out' by the same amount.

The game returning 6500 for the MDS makes my script think it is the most powerful weapon that it can fit when in reality, it's one of the worst, I can't believe this is some 'supped-up' MDS for OOS combat but even if it is, the PRG or even PAC should still be more powerful.
User avatar
apricotslice
Posts: 14163
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice »

TECSG wrote:Hi apricotslice,

Should IS/OOS be relevant when (if) applied to these commands though, surely 'get best weapon' should return the most powerful (ie, that does the most damage) weapon irrespective of the situation.

The values returned do not match the stats for the weapons and, more importantly, are not all 'out' by the same amount.

The game returning 6500 for the MDS makes my script think it is the most powerful weapon that it can fit when in reality, it's one of the worst, I can't believe this is some 'supped-up' MDS for OOS combat but even if it is, the PRG or even PAC should still be more powerful.
The thing is, they added in the oos combat settings. Who knows what they did to the code to make that work, and what bugs they left in it.

I've been trying to tell them that red sectors have something wrong with them. What if this is tied up with the crash issues that I've been having with red sectors, as well as my guns not firing effectively.

I dont know how, but what your suggesting seems to indicate that there is code issues somewhere.

I might up the oos values on my guns to match the IS values and see what happens.
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

MDS has always had a high dmg per shot afaik, it's the overall DPS that sucks because it has a low fire rate.

What you might want to do is compare laser DPS rather than than dmg per shot, to get the most powerful laser. In AP you can get the laser refire delay in milliseconds using the following command:

Code: Select all

$Laser.Delay = get default launch time difference for missile type: $Laser
Then calculate DPS:

Code: Select all

$Laser.ShotsPerMinute = 60000 / $Laser.Delay

$Laser.Shield.Shot = get shield damage of laser $Laser
$Laser.Hull.Shot = get hull damage of laser $Laser

$Laser.Shield.DPS = ($Laser.Shield.Shot * $Laser.ShotsPerMinute) / 60
$Laser.Hull.DPS = ($Laser.Hull.Shot * $Laser.ShotsPerMinute) / 60
Beware though this doesn't work in TC, as the launch difference command does not return the laser refire delay like it does in AP. There's no way to get DPS in TC.
User avatar
apricotslice
Posts: 14163
Joined: Sun, 16. May 04, 13:01
x4

Re: Weapon stats all screwed up [AP]

Post by apricotslice »

TECSG wrote:

Code: Select all

Mobile Drilling System      (reports 6500/2362, should be: 325/118)[/quote]

Actually, I was just looking at the file, and that is what is there.

Hull damage = 6500
Sheild damage = 2362
OOS hull = 1756
OOS sheild = 638

And that is the same figures from TC cat 03 as well. 

So maybe they fixed a bug with AP and didnt change the specs to compensate ?
User avatar
TECSG
Posts: 1610
Joined: Tue, 17. Feb 04, 22:06
x3tc

Post by TECSG »

Hi Shimrod,

Is that an AP specific command, as I want to retain TC compatability?

@apricotslice,

Where did you find that data, I opened TLaser.pck in X3Editor2 and couldn't find any damage info.?
User avatar
apricotslice
Posts: 14163
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice »

tbullets


edit : I just did a test with the normal hull and shield damage in the oos values as well, and my guns were definitely back to what they should have been.

Something screwy somewhere.
User avatar
TECSG
Posts: 1610
Joined: Tue, 17. Feb 04, 22:06
x3tc

Post by TECSG »

That's strange, according to TBullets, the MDS is more powerful than most of the M3 class weapons (and does nearly 20x the hull damage of HEPTs and 45x the damage of PACs)!

Surely that can't be right???

I'm sure the commands worked in (original) TC (not 'AP' TC) and would properly report the most powerful weapon that could be fitted to a ship though...
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

The command is in TC too, but in AP it was extended so passing in a laser ware type returns the refire delay. In TC it returns random data.

As a TC fallback you could sort lasers based on their ware prices, perhaps more reliable than using individual bullet damage to gauge what the best laser is.
Last edited by Shimrod on Sat, 10. Mar 12, 18:05, edited 1 time in total.
User avatar
TECSG
Posts: 1610
Joined: Tue, 17. Feb 04, 22:06
x3tc

Post by TECSG »

Typical!
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

It would be nice to have documentation of the changes made for OOS Rebalance in AP, so that scripters would, at least, know what to watch for. Gazz did document his TC-based experiments in the OOS Rebalance v2 thread.

The essence of OOS Rebalance is that it has two different sets of TBullet data (for IS and OOS). In the TC version, it then uses weapon-swapping code to swap weapons when switching between IS and OOS. I would expect that the AP version does not need to switch weapons since TBullets has been expanded to include those OOS values (but I cannot confirm that).

I noticed that (in TC), the weapon-swapping is unreliable. As stated in the thread (above), the system was never completed for TC. Could Apricotslice's experience be due to similar bugs? Tip: Notice whether the ships you test are IS or OOS.

Also note that the system modifies some stock scripts. Again, the only documentation that I have is the unfinished OOS Rebalance 2 thread, which lists the following modified files. If you have another mod that modifies the scripts below, then you might check them for compatibility with AP's OOS Rebalance:

!turret.swaptask.adv.pck
!fight.attack.object.std.pck
!plugin.acp.fight.attack.object.pck
!fight.attack.object.owp.pck

Mod Files

\types\Globals.txt
\types\TBullets.txt
\types\TLaser.txt

(The change in Globals is to make SG_OOS_FIGHT_MODE = 1 rather than the TC default of 0).

@Shimrod: Your DPS calculation would make a nice library script. Is there a way to test the IS vs OOS return values? Is it as simple as testing an object that is OOS (or IS)? Or is there more to it?
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

In AP, those DPS calculations only reflect in-sector laser strengths.

For OOS, use the following:

Code: Select all

= get OOS shield damage of laser $Laser
= get OOS hull damage of laser $Laser
My understanding is these APIs return damage per unit of time equivalent rather than per shot, so can be compared directly to get the strongest OOS laser.

In my turret script if the ship running Smart isn't in the active sector ([PLAYERSHIP]->get sector != [SECTOR]) then I swap in best OOS laser based on above APIs.

IS it's more interesting as you don't want to shoot fighters with PPC, even if they have better DPS than FAA, whereas OOS I think only the OOS damage value is a factor.

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