Litcube's Missile Boat Add-On (Turret:V0.92b / Supply:V0.93b)

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
acgabs
Posts: 38
Joined: Sat, 19. Nov 11, 15:01
x3tc

Post by acgabs » Wed, 30. Nov 11, 23:59

I suppose it's really hard to balance ^^

Especially considering what M7Ms represent in the gameworld.. a revolution in warfare. They are that, which makes them propably too powerful unmodded.

If anyone read the Honor Harrington books, there's a similar situation there.. where one side decides to focus more in missiles which after several years leads to both sides in the war building almost purely missile-launching warships :) Range is everything.

Although in this case I'd say the biggest problem lies with the player essentially (if he/she planned correctly) having an unlimited supply of torpedoes thanks (if need be) to TLs following the M7M stacked with those dastardly things. Maybe if they'd be a lot scarcer.. but I suppose that isn't really anything that could be covered by this script :)

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Thu, 1. Dec 11, 00:09

True.

I think the assumption that one should be able to take out anything in a single ship regardless of its "health", simply by observing your M7M from a distance should probably be pointed to this script:

http://forum.egosoft.com/viewtopic.php?t=218752


Anyone else might want to consider other methods. Bring in a TL, like acgabs says, to supply the M7M, while your M1 launches fighters to distract the enemy. That's what all those XRM ships are there for, and why they were all balanced right. So you can use them.

HotSake
Posts: 472
Joined: Sun, 3. Jan 10, 22:15
x3tc

Post by HotSake » Thu, 1. Dec 11, 03:52

My first instinct, and I'm not suggesting anyone actually implement this (I recognize it's a lot of work), is to alter the missile script to generate metrics for its barrages. In other words, when the script launches a barrage, it also starts a helper script on the target to get its array of inbound missiles, parsing the list to find the missiles it launched itself (by range to missile vs. range to missile boat, most likely). Having a handle on the missile objects now, it can monitor their progress to see how many get within X distance of the target (say, the largest possible dimension of a big ship plus some padding). It can use the hit percentage of the last barrage to predict how many missiles it needs to launch for the next, given the target's remaining health.

Expensive? You betcha. Pain to write? Of course! :D But that's what popped into my head.

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Thu, 1. Dec 11, 15:26

There's no reliable way to track missile success once they're launched. Even if you had all the script cycle room in the world.

Firewrath
Posts: 121
Joined: Fri, 3. Aug 07, 05:49
x3tc

Post by Firewrath » Thu, 1. Dec 11, 15:47

just curious,
you mean theres no way to get like a list of missiles in the sector and their targets?

cause, if not, Demmit, >.<
there goes my missile hunting M5 script, =/

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Thu, 1. Dec 11, 15:57

Well, there is. You can cycle through all ships, and get "missiles aiming at me", and build a list that way. But that list is outdated just as fast. Depending on the missile, it'll find new targets once another is destroyed.

As HotSake said, it would be expensive as hell. Repetitively cycling through all ships in a sector is expensive, never mind going through their respective missiles.

If you're going to write a ship command that targets missiles only, I'd assign them to one ship only, and periodically check for "missiles incoming" to that specific ship only.

I was going to write something like that myself to make M5s useful in a fleet battle situation.

Firewrath
Posts: 121
Joined: Fri, 3. Aug 07, 05:49
x3tc

Post by Firewrath » Thu, 1. Dec 11, 16:08

hrm, well real quick just because i have to run, but want to toss this idea out,

it could start scanning only when theres an enemy ship in sector, and only through the M5's race, to make it less intense, 'player race only' would probably be good,
(could also give it a range limit and only scan ships within that range)
so have it scan once, get the closest missile, then do an attack, and disable scanning while attacking because itd be useless then anyways, ...maybe an interrupt in the attack if a missile is targeting the M5, but eh,
if it loses its target missile, scan again and repeat.

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Thu, 1. Dec 11, 16:11

Firewrath wrote:hit could start scanning only when theres an enemy ship in sector, and only through the M5's race, to make it less intense, 'player race only' would probably be good,
(could also give it a range limit and only scan ships within that range)
so have it scan once, get the closest missile, then do an attack, and disable scanning while attacking because itd be useless then anyways, ...maybe an interrupt in the attack if a missile is targeting the M5, but eh,
if it loses its target missile, scan again and repeat.
Yup, those are good saving features.

MegaBurn
Posts: 278
Joined: Mon, 30. Jan 06, 15:52
xr

Post by MegaBurn » Fri, 2. Dec 11, 11:10

On missile overkill: Its not only missile defense scripts, anything in with good flak coverage can survive sustained M7M volleys once the missile count drops. Might be more noticeable in XRM than vanilla due to turret mount arrangements. In my tests, with only XRM, cheat menu, and propmongler, almost all M2's survived with ~10-20% hull, regained full shields, and killed the opposing M7M. I'd assume the same applies to OWP, most M1, some M7's, and maybe a few others.

Adding overkill would help, but it doesn't need expensive missile hit rate tests, practically all that would do is adjust volley count to maybe save a few missiles, and that savings is wasted, and then some, if the resulting final kill volley isn't enough to do the job. Keep it firing full volleys until the target is destroyed.

Balancing that isn't the missile boat's problem. If regular defenses aren't enough, add a countermeasure script, balanced so its a contest of CM vs missile inventory, works well enough in other games. For example: A combo ECM, decoy, flak mine - use a nav sat dumb prop, when deployed parent ship script marks the CM position, gets incoming missile list, randomly redirects a couple to the CM, polls for it to be destroyed while those missiles exist, when its destroyed the remaining redirected missiles within ~1km of the marked position are destroyed. Probably a better way to do it, without polling like that, but, point. Missile script could help NPC's via telling them they're being attacked by a missile boat.


Haven't had time to do more testing, or much of anything else with X, should have some time this weekend...
"Only the dead have seen the end of war." -Plato

paulwheeler
Posts: 8132
Joined: Tue, 19. Apr 05, 13:33
x3tc

Post by paulwheeler » Fri, 2. Dec 11, 15:05

Just a thought... is it possible that the crashes are not due to the missile boat script, but perhaps the changes made to CWP to accommodate M3Bs?

As the crash you experienced Litcube, happened when a missile boat spawned, that would suggest CWP rather than this script, and both were altered at around the same time...

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Fri, 2. Dec 11, 15:08

paulwheeler wrote:Just a thought... is it possible that the crashes are not due to the missile boat script, but perhaps the changes made to CWP to accommodate M3Bs?

As the crash you experienced Litcube, happened when a missile boat spawned, that would suggest CWP rather than this script, and both were altered at around the same time...

It's possible. I'm on site right now working, and I won't be flying back for another week or so. When I return, I'm going to run brute force testing on this thing, and come up with a cause.

r--x
Posts: 15
Joined: Tue, 25. Oct 05, 12:21
x3tc

Post by r--x » Sun, 11. Dec 11, 11:45

I started playing XRM 4 days ago, I have found this topic because of CTDs.

All I can say is:
1. All CTDs seems to be random (every 6h or 5 min).
2. I use latest X3TC patch.
3. Scripts used: NPC Bailing Addon, CPC, JSON (All newest).
4. Game is not installed in default loc. It is DVD version, not Steam, no bonus pack.
5. My comp. is Dell Studio 1747 (6GB of ram, Win7pro 64bit).
6. ALL my CTD logs starts with:

Code: Select all

Story call stack dump:
[000000]->[0351cc]#-26817(2023)[702].StartThisScriptID(3, {"!turret.killenemies.std",44,"Turret Kill all enemies (All Ships)",1,4,{...},{...},{...},0,100}, {4,3}, 0)
7. Here is a full dump in zip: http://spectrum7.pl/pliki/x3/X3Crash.zip

P.S.
I'm ready for testing if necessary.

Rx

User avatar
mr.WHO
Posts: 8577
Joined: Thu, 12. Oct 06, 17:19
x4

Post by mr.WHO » Fri, 30. Dec 11, 21:46

Hey Litcube, both Cadius pack and XRM introduce M3 size bombers (M3B)

I wonder if it would be possible to have some kind of script that check if M3B has no missiles and automaticaly force return to homebase/home ship?

For example:

1) M3B lock and loaded inside M1, homebase set to this M1
2) attack command for M3B (either manual or by fleet script)
3) M3B attack target A
4) M3B fire out all missiles --> force RTB script + save previous command
5) M3B return to M1.
6) If M3B has a setting to auto load missiles after dock it would reload and then initiated saved command (in this case attack target A)
7) script continue until:
a) M3B is destroyed
b) Target A is destroyed
c) home base/ship don't have any missiles to ressuply.

As to reduce CPU load I think that script shouldn't check conditions in real time, but once every 30-60 seconds.


Right now M3B are somehow limited in use coz:
- fully shielded and equipped they have like 10-20 missiles
- they often launch up to 4 missiles per salvo
- once they fire out missile they still attack like normal fighters, with poor results to M3B health, especiall when they attack capships they supose to deal with.
- it's pain in the ass to manually check if they have missiles and command them back to reload.

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Sat, 31. Dec 11, 04:38

I think M3 bombers are a horrible, horrible idea. :)

fobboy
Posts: 26
Joined: Mon, 12. Jan 09, 07:01
x4

Post by fobboy » Thu, 12. Jan 12, 06:30

How do I uninstall this script? This was added as part of XRM and I consistently get crashes related to this turret script.

deca.death
Posts: 2939
Joined: Mon, 28. Feb 11, 19:50
x3tc

Post by deca.death » Thu, 12. Jan 12, 07:43

r--x wrote:

Code: Select all

Story call stack dump:
[000000]->[0351cc]#-26817(2023)[702].StartThisScriptID(3, {"!turret.killenemies.std",44,"Turret Kill all enemies (All Ships)",1,4,{...},{...},{...},0,100}, {4,3}, 0)

Where I can find this info, to check my own CTD problem, which again, seems totally random.

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Thu, 12. Jan 12, 09:17

paulwheeler wrote:Just a thought... is it possible that the crashes are not due to the missile boat script, but perhaps the changes made to CWP to accommodate M3Bs?

As the crash you experienced Litcube, happened when a missile boat spawned, that would suggest CWP rather than this script, and both were altered at around the same time...
if the crash log is showing below, then its likely not CWP, but defintly cant rule out M3B's.

Code: Select all

[000000]->[0351cc]#-26817(2023)[702].StartThisScriptID(3, {"!turret.killenemies.std",44,"Turret Kill all enemies (All Ships)",1,4,{...},{...},{...},0,100}, {4,3}, 0)
[03538b]->[035fcd]#-26817(2023)[702].__runScript({19347562,0,3,7,{...},{...},0,3,{...},100,0,0,0}, {"Lib.Cmd.Turret.Barrage",44,"Lib Cmd: Main turret barrage",53,0,{...},{...},{...},{...},911}, 65542, -26817, {4,3}, 0)
[060427]->[0aa6fd]#-26817(2023)[2004].ShootMissileSECOBID(13870, 3, 29, 0)
The stack dump clearly states that the error is occuring somewhere within the ShootMissileSECOBID

i think it means the following: SECBOID: SEC( Sector ) BO( Body ) ID( Identification )

My best guess based on the code i have infront of me is that the error is occuring after the KC code calls a C++ API function of SA_ShootMissile with arg4 being null(0)

edit: scratch that, arg4 is set as 0 a few times when called, so its probably not that

There are no obvious errors within the KC code related to this function and a script call should never be able to crash the game - so its already an error in the engine itself by default - Notifying egosoft of these crashes would be a good idea, without a extreamly relyable test case its almost impsoable to poinpoint this type of error, if you wish to try:

Have Fun :wink: http://pastebin.com/HEy4JB4g
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

garrry34
Posts: 911
Joined: Sun, 17. Jul 05, 14:43
x3tc

Post by garrry34 » Thu, 12. Jan 12, 09:42

my advice is to download it individulaly from here, oppen teh scrpit folder for AP or TC and dop the scripts for the zips in the folder then they wil be highlited then just hit delete...
PhenomII X4 940 black edition
8GB DDR2
ATI HD4890
Windows 7 64bit

ivanwong1989
Posts: 110
Joined: Tue, 14. Feb 12, 13:00

Post by ivanwong1989 » Fri, 2. Mar 12, 10:01

Hello guys,

I have a questions... hope people can help...


using IR 15.29, enemy m7ms are now deadly as ever BUT can't be said about my own remotely controlled m7ms.... they are large dumb space hulks... any script to make my owned m7ms behave better?( i don't understand fully whether Litcube's script is only for NPC m7ms or for my m7ms... that's why..)
To Infinity, And Beyond!

xxxxxxx7
Posts: 6
Joined: Fri, 6. Jan 12, 17:19

Post by xxxxxxx7 » Fri, 6. Apr 12, 20:24

ivanwong1989 wrote:.... they are large dumb space hulks... any script to make my owned m7ms behave better?
Hello,
the script works for NPC ships and player ships.

If you run this script you need to set some options. You can find these options in the ship command console (key 'c') of the ship.
- Set the command of missile turrets of your m7m or m8 to "attack my target" or "kill all ememies". Your m7m will now launch missiles at the enemies, too. Don't confuse it with the '2. combat ...' menu. That's wrong. It's a turret command.
- Set the missile shot probability of the m7m from '5%' (default) to '100%'. This increases the missile fire rate.
You don't have to be on board of your m7m (or m8 ). But the script only works only for m7m that are in the sector as you are (In Sector)

---------------------------------------------------------

About the these Crash To Desktop (CTD) problems (the games crashes when running this script):

Code: Select all

Story call stack dump:
[000000]->[0351cc]#-26817(2023)[702].StartThisScriptID(3, {"!turret.killenemies.std",44,"Turret Kill all enemies (All Ships)",1,4,{...},{...},{...},0,100}, {4,3}, 0)
[0354c8]->[03610a]#-43004(2142)[702].__runScript({16078717,0,2,3,{...},{...},0,2,{...},101,0,0,0}, {"Lib.Cmd.Turret.Barrage",50,"Lib Cmd: Main turret barrage",64,0,{...},{...},{...},{...},911}, 65542, -43004, {4,2}, 0)
[060564]->[0aa873]#-43004(2142)[2004].ShootMissileSECOBID(12, 2, 29, 0)
I play the XRM mod which uses this script and figured out that the crash always happens if a bomber that is running this script is docked - and tries to fire missiles while docked! :o That blows up everything.

Am imserted check in the script file "Lib.Cmd.Turret.Barrage.xml", line 16 to 20, solves the problem.

Code: Select all

... 
while [TRUE] 
  if is a new script version available
    return 1
  end
   
  * check if ship is docked so the game does not crash
  if [THIS]->is docked
    = wait 30000 ms
    continue
  end
   
  if not [THIS]->is in active sector
    = wait 30000 ms
    continue
  end
...

Post Reply

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