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: Scripting / Modding Moderators, Moderators for English X Forum

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

Post by Litcube »

I stopped using 7-zip months ago on account of it closely resembling a huge pile of shit. I'm a right wing coder: I feel open source can be the doom of well intentioned coding projects.
User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR »

Litcube does this script fill the ship to max capacity with missiles? I ran into several xenon caps that were stuffed with all sorts of missiles along with their lasers. Also a xenon G (SRM) had a cargohold full of various fireable missiles but only launched 1 hammerhead at me in a 3 minute fight.
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

joelR wrote:Litcube does this script fill the ship to max capacity with missiles? I ran into several xenon caps that were stuffed with all sorts of missiles along with their lasers. Also a xenon G (SRM) had a cargohold full of various fireable missiles but only launched 1 hammerhead at me in a 3 minute fight.
Weird. If this script was running on that ship, that wouldn't happen.
User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR »

Litcube wrote:
joelR wrote:Litcube does this script fill the ship to max capacity with missiles? I ran into several xenon caps that were stuffed with all sorts of missiles along with their lasers. Also a xenon G (SRM) had a cargohold full of various fireable missiles but only launched 1 hammerhead at me in a 3 minute fight.
Weird. If this script was running on that ship, that wouldn't happen.
Ok ill check if its running on it tomorrow. Time to sleep!
djrygar
Posts: 1842
Joined: Mon, 10. Aug 09, 02:09
x3ap

Post by djrygar »

Mizuchi wrote:Edit: Well, scratch that. :cry:

Code: Select all

Story call stack dump:
[000000]->[0351cc]#-25272(2142)[702].StartThisScriptID(97046, {"plugin.gz.mars.lib",44,"MARS - Library",494,0,{...},{...},{...},{...},0}, {5,"missile.supply",0,0,0,0,0,0,0,0}, 0)
[03538b]->[035fcd]#-25272(2142)[702].__runScript({3026183,0,0,3,{...},{...},0,97046,{...},0,0,0,0}, {"plugin.gz.mars.lib",44,"MARS - Library",494,0,{...},{...},{...},{...},0}, 65542, -25272, {5,"missile.supply",0,0,0,0,0,0,0,0}, 0)
[060427]->[0aa6fd]#-25272(2142)[2004].ShootMissileSECOBID(44038, 1, 32, 0)
They always seem to be turret-related: sometimes it lists Missile Defense MK2 scripts, sometimes it lists Vanilla turret-scriptsm and sometimes (as above) it includes MARS.

The last three crashes (updated!) have been the same report as above, though.
I've thought that it's Missile Boat Addon fault (or conflict with IR), but today I got CTD with ONLY
ShootMissileSECOBID on stack. Without any 'wrapper' (ie no turret command etc)
probably missile was shot directly during attack or by IR script controlling ship. SO, ShootMissileSECOBID is only common thing. NOw, what the hell does it mean... already excluded tmissiles.txt modifications as cause (well, I havent tried vanilla missiles but i doubt it makes difference)

ie. this script only causes bug to appear faster, but is not real reason
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

A similar crash was reported in the Smart Turrets thread.

Code: Select all

Story call stack dump: 
[000000]->[0351cc]#-199751(2023)[702].StartThisScriptID(3, {"plugin.gz.missile.load.att.e.std",42,"Start Attack Enemies - player",1,0,0,{...},0,0,100}, {4,3}, 0) 
[03538b]->[035fcd]#-199751(2023)[702].__runScript({27437161,0,3,3,{...},{...},0,3,{...},100,0,0,0}, {"Lib.Cmd.Turret.Barrage",44,"Lib Cmd: Main turret barrage",46,0,{...},{...},{...},{...},911}, 65542, -199751, {4,3}, 0) 
[060427]->[0aa6fd]#-199751(2023)[2004].ShootMissileSECOBID(3962, 3, 29, 0)
If that last param is the refobj, could be that [THIS] is null.

ShootMissileSECOBID(3962, 3, 29, 0)

comes from:

= [THIS] -> fire missile $Missile from turret $Task on $Enemy

Suggesting:
[THIS] = null
$Missile = 29 (spectre)
$Task = 3 (turret 3)
$Enemy = 3962 (maybe game's hashcode for a sector object)
Sn4kemaster
Posts: 1014
Joined: Wed, 17. Jun 09, 18:29
x4

Post by Sn4kemaster »

Hi Litcube

Just downloading the missile supply scripts over to include with the XRM (plus the XRM recommend scripts), as i was just using the missile boat attack script until now on its own......but when i copy the Lib.Gen.RunScriptWhenFinished over to the script directory it states their is already a version of this in there......

So am i right to assume this is an generic identical script and there is no reason to copy over the original script of this name?

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

Post by Litcube »

Sn4kemaster wrote:So am i right to assume this is an generic identical script and there is no reason to copy over the original script of this name?
Correct!
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

Missile Boat Turret Overwrite Update

0.9b:
- Near total rewrite



New rules as of V0.9
- A volley is defined as missile launches between respected missile ROF + ship's assigned Missile Fire Probability Delay.
- The Missile Fire Probability Delay is equal to 11.5 seconds - (ship's assigned Missile Fire Probability * 100).
- Missile Fire Probability is set in the ship's command console (delay examples: %5: 10 sec, 100%: 0.5 sec)
- By default, AI ship's have a 5% Missile Fire Probability.
- Turrets can fire at only one target per volley.
- To mitigate overkill and waste, not all pods are used in a volley, depending on target "hit points"
- Multiple turrets can attack a single target, if the expected damage output is appropriate per "hit points"

Missile selection:

- Highest damage missile that is 20% faster than the target's speed
- If target range is more than 90% of missile range, the missile is skipped for fire
- If no missile is found that meets speed requirements, pick fastest missile
- If no missile is found that meets range requirement, NO missile is returned (thus barrage will not fire)
Gerry Howarth
Posts: 21
Joined: Thu, 12. Feb 04, 21:16
x4

Post by Gerry Howarth »

Download Link in first post still points to 0.8b which is unavailable. Copied shortcut and changed target to 0.9b and downloaded OK.

Is 0.9b the latest revision as I see the supply scripts are 0.92b?
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

Thanks for the heads up, fixed that.


Yes, the current listed versions are the latest.
User avatar
Tiek
Posts: 166
Joined: Sun, 15. Aug 04, 12:21
x3tc

Post by Tiek »

Hi Litcube, congratulations for the great script. I have a question: the script "Lib.Gen.GetBestMissileForTarget" at line 80 calls the script "Lib.Gen.Arrays.SortByElement" that is missing in the package. This script is essential for the correct execution of other scripts? Thanks.
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

Tiek wrote:Hi Litcube, congratulations for the great script. I have a question: the script "Lib.Gen.GetBestMissileForTarget" at line 80 calls the script "Lib.Gen.Arrays.SortByElement" that is missing in the package. This script is essential for the correct execution of other scripts? Thanks.

Thank you!


Missile Boat Turret Overwrite Update

0.91b:
- Packing issue. Forgot a file. Very important.
deca.death
Posts: 2939
Joined: Mon, 28. Feb 11, 19:50
x3tc

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

Post by deca.death »

Litcube wrote: Rename the stock !turret.missileattack.pck to something else. Copy the !turret.missileattack.xml included in this package to the scripts directory.
So.... All files that we find in folder must go in 'scripts', right? Just checking, since you mention only one file ...
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

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

Post by Litcube »

deca.death wrote:
Litcube wrote: Rename the stock !turret.missileattack.pck to something else. Copy the !turret.missileattack.xml included in this package to the scripts directory.
So.... All files that we find in folder must go in 'scripts', right? Just checking, since you mention only one file ...


Missile Boat Turret Overwrite Update

0.92b:
- Compressed the !turret.missileattack.xml to a .pck for easier installation.


This will overwrite your !turret.missileattack.pck in your scripts directory. Back it up if you want the option to revert later.
Mad_CatMk2
Posts: 518
Joined: Sun, 22. Feb 09, 20:13
x4

Post by Mad_CatMk2 »

How often will you synchronize with paul for XRM for updates? (i.e. you just did a double update...) :)
I fly an OWP. What about you?
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

Well, I think that whoever includes my script in the package should probably include the version of the package in their updates so that users will know if they should go to the source for newer packages.
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

Hey. I've been working on enhancing missile boat AI in MBR (just making them keep their distance from their target), so have had a look at the vanilla as well as your script. Despite being much better than vanilla, there is a problem of targeting with both.

Currently, the turret script only targets the nearest enemy ship. Preferably it would target the nearest Huge, then Big, then Fighter, then Station, then other ship (e.g. freighter). Also, it would be great if the turret could take into account the ship's attacker and attack target, before finding it's own target.

This targeting issue is especially evident with my changes to flight logic. The boat will now keep it's distance from that big M1/2/7, but there are often a bunch of freighters/civilians/whatever nearby, so the actual attack target is never fired at.

I think since the script only runs in sector, some better targeting logic wouldn't be too expensive?

Anyway, let me know if you intend to do something about targeting, otherwise I will write a custom script for MBR.
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

ThisIsHarsh wrote:Anyway, let me know if you intend to do something about targeting, otherwise I will write a custom script for MBR.


Fighters are just as much a valid target as huge ships, when you consider the benefits of multiple turrets (multi-tracking) on a boat, and flail type missiles. This last point (multi-tracking) mitigates the usefulness of using the ships 'attack target'.

If you want to control this on your own ships, use attack target as the turret command.
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

Litcube wrote:
ThisIsHarsh wrote:Anyway, let me know if you intend to do something about targeting, otherwise I will write a custom script for MBR.


Fighters are just as much a valid target as huge ships, when you consider the benefits of multiple turrets (multi-tracking) on a boat, and flail type missiles. This last point (multi-tracking) mitigates the usefulness of using the ships 'attack target'.

If you want to control this on your own ships, use attack target as the turret command.
Point taken. However, looking at 'Lib.Cmd.Turret.Barrage', the '!turret.attacktarget.std' behaviour only works for player tracking aim, not for the ship's command/attack target.

What would be really good, as a cross-compatible solution, would be to have a local variable 'preferred.target' (or something), where the turret will attack that target if possible.

If it is OK with you, and you are not planning further updates, I would like to make this script a required/recommended prerequisite for Military Base Response revamp, but use a custom targeting script?
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.

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