[MOD/WIP] Combat enhancement scripts - "Better turrets" overhaul

The place to discuss scripting and game modifications for X Rebirth.

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

beaver1981
Posts: 60
Joined: Wed, 22. May 13, 23:26
x4

[MOD/WIP] Combat enhancement scripts - "Better turrets" overhaul

Post by beaver1981 » Wed, 9. Mar 16, 18:44

Combat enhancement scripts

Steam-workshop
http://steamcommunity.com/sharedfiles/f ... =641563593

Nexus mods
http://www.nexusmods.com/xrebirth/mods/474

AI scripts & overhauled drones for a better combat experience. Based on "Better turrets" by Cicero111.

This is WIP but should work as intended. Please report if you see something strange.

***********************************************************************************************************
Please read description.
***********************************************************************************************************

What you need:

Defense-officers with at least 3 stars primary skills to show advanced combat-behaviour. They will perform better if they have more stars.
So I would suggest you use something like "autotrain", "autocrew" or "npcgainXP".

Unqualified DOs will show vanilla combat-behaviour and will not launch drones.



What it does:

- It changes targeting logic for the defense officer AI on all capital ships.

- Skill checks for detecting targets. Combat is the most important one, but leadership and morale are also used in the calculation.

- Line of sight check for all targets to minimize damage from friendly fire when flying in formation.

- Target priority logic for turrets (fighters -> cap surface elements -> hull). Similar logic when atacking stations.

- Separate target priority logic for "big guns" (i.e. IHC and torpedo launchers).

- Capital boarding support mode when the defense officer is in defensive mode.

- Station supression mode. When DO in defensive mode, only attack weapons (also valid with attack object).

NEW - All drones have more hull and shields added. Overrun MK2 URVs have guided missiles. Changed model of Assault URV to combat drone model and added torpedo launchers. Changed hull and on player-controlled drones and added shields.

NEW - Limits the defense-drone targets to be within 4.5km to avoid drones wandering off.

- Defense-drone wing size and launch delay based on DO skill and ship type.

NEW - L/XL ships will launch Assault URVs against L/XL ships and stations if they are more than 4.5km away and DO is in offensive mode. They are like a long-range first-strike weapon. They will bombard the hull with their torpedos. Within the 4.5km range defense-drones will take over and will support close-combat with target-priorisation as above.

- "Big gun" control (Balor/Sucellus). A defensive DO will not fire the "big guns" except on station hull/surface targets. In offensive no DO will fire those at fighters anymore, except skunk for NPC's.

- Capship wingmen wil "inherit" their leader DO offensive/defnesive (might take some seconds before they get the memo).

- Drone leaders will if their target is destroyed check with their DO for a new one before returning home.

- Player caps and friendly cap NPC's will stop shooting at target if it's is boarded by the player and hull gets below 50%. (NB: stations and fighters will still shoot at it).

NEW - Adds IZ ammo-check. Will make missile launchers work IZ. In fact that´s a cheat...

NEW - Ships with unqualified DOs will show vanilla combat-behaviour but launch no drones.

***********************************************************************************************************
This matches with XR 4.0 combat scripts and won´t work in earlier versions.
***********************************************************************************************************
Use at your own risk!
Potentially not savegame-safe!
***********************************************************************************************************
Feedback welcome!

Happy hunting!
Last edited by beaver1981 on Thu, 17. Mar 16, 15:08, edited 1 time in total.

beaver1981
Posts: 60
Joined: Wed, 22. May 13, 23:26
x4

Post by beaver1981 » Wed, 9. Mar 16, 18:44

I´ve been asked if CES is compatible with MICT/MOCT/MCT several times now…

Technically it is compatible with MICT but not MICT_supp7, therefore it is technically NOT compatible with MCT since this incorporates MICT_supp7. That´s because of w.evens and my changes to the assault URV which will overwrite each other.

But I think they are not compatible in terms of gameplay. Why ist that? MICT and CES are both about combat behaviour. They both offer a targeting logic which is more or less based on „Better turrets“, they both check skills and will only work or perform well if you have highly skilled NPC aboard your ships.

So if you install MICT and CES you will see MICT in action since it takes over at the same point, you will have no benifit from CES. There will be no synergy. That´s a technical problem.

There are obviously differences between both mods. A huge part of MICT is about movement, it speeds up combat by making your ship jump or boost into firing range and makes it stay there. If that is what you are looking for and that fits your needs go with MICT, you won´t need CES.

CES instead is just about targeting logic (MICT already offers similar things), but targeting logic also effects the usage of drones or URVs as they are called. While vanilla XR and MICT only know defense- and offense-drones (Assault URV) they make no use oft hat. In vanilla XR the Assault URV also is quite without function. CES defines different roles for defense- and offense-drones, defense drones will support your ship in every close-combat situation, offense-drones (Assault URV, that has undergone some changes) is now like a first strike weapon which is launched if your ship is not in firing range, knows the enemy and is in offensive mode. This makes combat slower since your ship will use vanilla movement scripts but is also nice to watch. Since this mechanism is radar-range dependent you will have no problem dealing with enemies that are far away. Another difference ist hat CES offers improvements for drones like more hull and shields. They are not invincible but won´t be killed that fast… …they are more like cheap fighters. If you are looking for somthing like that go with CES, you won´t need MICT.

So please read the description of both mods carefully and decide what fits your needs! If you want to test them install only one of them to see full effects! …and BACKUP YOUR SAVEGAMES!!! …or start a new game or use a seperate save.

MOCT is about OOZ-combat CES is about IZ-combat, so yes, they are compatible (technically and in terms of gameplay).

And to point that out clearly, this is not about I don´t like MICT. MICT is an awesome and very complex mod and w.evans deserves respect for creating that. It offers so much and I like that it is modular (manual install), so I can pick what fits my needs -> great job!

Personally I used the whole package for a long time. I even had MICT in mind when I created my other mod „Canteran ship pack“ (the ships are designed to take over certain roles and I thought of how that will work in conjuction with MICT). Now I still use MICT_supp2, MICT_supp3, MOCT and MOCT_supp4.
Last edited by beaver1981 on Thu, 10. Mar 16, 11:21, edited 1 time in total.

desan77332
Posts: 15
Joined: Fri, 4. Mar 16, 13:04

Post by desan77332 » Wed, 9. Mar 16, 21:14

Hi. CES work with Better Turrets? Or i need disable BT before activate CES?

vadiolive
Posts: 304
Joined: Wed, 18. Dec 13, 05:36
x4

Post by vadiolive » Wed, 9. Mar 16, 21:32

work with Miscellaneous IZ Combat Tweaks & Miscellaneous OOZ Combat Tweaks ?

w.evans
Posts: 2962
Joined: Tue, 18. Nov 14, 17:23
x4

Post by w.evans » Wed, 9. Mar 16, 22:00

cool! you got BT working again!

@vadiolive, if it's set up the same way BT was, there shouldn't be a compatibility problem. MICT defence officers will run the MICT fight script while everyone else will run this.

michaelbm71
Posts: 7
Joined: Sun, 19. May 13, 11:05
x4

Post by michaelbm71 » Wed, 9. Mar 16, 22:18

(Copy from Steam Workshop to this forum)

Hello beaver1981, thank you for your work.
I have not tried your mod, because i suspect its use might be limited by the missing autosupply function for drones for the DO. :?
Now did/could you add an onboard drone assembly/generator/cheater to add a drone supply to player-owned ships? That would be perfect. I am thinking along the lines of the mod DCS / Drone Carrier Software by DRBullwinkle for X3.
All the best, Michael

beaver1981
Posts: 60
Joined: Wed, 22. May 13, 23:26
x4

Post by beaver1981 » Wed, 9. Mar 16, 23:02

@michaelbm71: Answered you in steam workshop.

@w.evans: Thanks :)

@vadiolive: At the moment I´m only using MICT_supp 2 and 3, so I don´t know that. But it is set up the same way as BT and should work with MICT. The problem is that regarding NPC skills the point when BT or my mod start to perfom well is quite the same when MICT takes over... ...MICT_supp 7 (that one that changes the assault drone) breaks assault drones... ...MOCT works (tested with MOCT and MOCT_supp 4).

@desan77332: It´s a new version of BT, so you have to disable or uninstall that.

vadiolive
Posts: 304
Joined: Wed, 18. Dec 13, 05:36
x4

Post by vadiolive » Wed, 9. Mar 16, 23:21

i use version MICT and MOCT from steamworkshop.. i guess safe?

beaver1981
Posts: 60
Joined: Wed, 22. May 13, 23:26
x4

Post by beaver1981 » Wed, 9. Mar 16, 23:49

@vadiolive: I think that includes MICT_supp7 and breaks assault drones.

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

Post by Requiemfang » Thu, 10. Mar 16, 05:43

So basically this mod will work with MICT so long as you don't have the supp 7 optional file installed.

w.evans
Posts: 2962
Joined: Tue, 18. Nov 14, 17:23
x4

Post by w.evans » Thu, 10. Mar 16, 07:50

beaver1981 wrote:@vadiolive: I think that includes MICT_supp7 and breaks assault drones.
I don't get it. How does MICT_supp7 break assault drones? All it does is change the armament of Assault URVs to torpedoes.

w.evans
Posts: 2962
Joined: Tue, 18. Nov 14, 17:23
x4

Post by w.evans » Thu, 10. Mar 16, 08:45

Ah, now I see. MICT_supp7 would break the CES Assault URVs because it modifies the connection where the vanilla weapons are placed and that's where you put the engines.

Hm. I don't think I can fix that incompatibility without maintaining the functionality of making Assault URVs functional for people who don't have CES.

If you want, one thing you could do would be to add an optional dependency to MICT and MCT. That way, your mod would load after mine and you'd be sure that your changes to Assault URVs override mine. I don't think it would work the other way around since that would change your Assault URVs' engine into a torpedo tube.

Also, I think the only thing that makes this require the save flag is your added torpedo type. (missile_launcher_torpedo_ces_macro). If you were to modify one of the Drostan's torpedoes and use that instead, then I don't think you'd need the save flag anymore. Would have the side effect of making the Drostan more powerful though, and I understand how you probably won't want that.

beaver1981
Posts: 60
Joined: Wed, 22. May 13, 23:26
x4

Post by beaver1981 » Thu, 10. Mar 16, 11:45

@w.evans: I think for now there is no need for the mods to be compatible because they support different styles of gameplay. See second post in thread.
Integration of both mods could be a thing but rather complicated... ...my idea of the usage of the Assult URV does right now not match with your idea of how ships jump directly into close-combat.

beaver1981
Posts: 60
Joined: Wed, 22. May 13, 23:26
x4

Post by beaver1981 » Thu, 10. Mar 16, 15:06

@w.evans:

Added to MICT.move.attack.object.capital:

Code: Select all

<do_elseif value="this.ship.availableunits.{unitcategory.attack}.count gt 0">
   <set_value name="$MICT_MaxAimDist" exact="10000m" />
   <set_value name="$MICT_MinAimDist" exact="10000m * 0.5f" />
   <set_value name="$MICT_MaxJumpDist" exact="10000m * (1.9f - ((this.skill.navigation + this.skill.morale)f / 10.0f))" />
   <set_value name="$MICT_MinJumpDist" exact="10000m * (0.3f * (1.0f + (1.0f * ((this.skill.navigation + this.skill.morale)f / 10.0f))))" />
   <set_value name="$MICT_MaxShortAimDist" exact="3570m * (2.0f - ((this.skill.navigation + this.skill.morale)f / 10.0f))" />
   <set_value name="$MICT_MinShortAimDist" exact="3570m * (0.1f * (1.0f + (1.0f * ((this.skill.navigation + this.skill.morale)f / 10.0f))))" />
</do_elseif>
Deleted:
fight.attack.object.capital
MICT.fight.attack.object.capital
fight.defend.capital

So cap-ship is running your movement scripts and my combat script.
Ship jumpend, launched assault drones and did not really move into firing range.
Is it possible to make it jump into a distance of i.e. 10-12km to enemy and make it then move into firing range?

w.evans
Posts: 2962
Joined: Tue, 18. Nov 14, 17:23
x4

Post by w.evans » Thu, 10. Mar 16, 19:29

Was about to say fair enough, but I see you have a suggestion. Would be possible but not like that. at the moment, min/maxjumpdist is used for the desired distance to go to while min/maxaimdist is the distance to maintain before deciding to move again, unless a ship decides to retreat.

First inclination would be to add yet another min/max dist value which would have the present jumpdist values and lock the jumpdist to 10k. Would complicate the script even further though. (If you tried to slough through it, you probably know what I'm talking about.)

If all you want to do is keep them from jumping in combat though, all you have to do is set the single line that says this:

Code: Select all

<set_value name="$MICT_JumpActive" exact="true"/>
to this:

Code: Select all

<set_value name="$MICT_JumpActive" exact="false"/>
.......
but if you go that route, might as well just delete the whole

Code: Select all

<find_object_component class="class.jumpdrive" object="this.ship" name="$MICT_JumpDrive"/>
<do_if value="@$MICT_JumpDrive.isfunctional and this.ship.cargo.{ware.fuelcells}.count gt 500 and player.age gt (@$MICT_JumpStartTime + @$MICT_JumpTimer)">
	<set_value name="$MICT_JumpActive" exact="true"/>
	<remove_value name="$MICT_JumpStartTime"/>
</do_if>
<remove_value name="$MICT_JumpDrive"/>
finds can get somewhat expensive when done on a regular basis. And if the ship's not going to be using its jump drive, the captain doesn't have to know whether or not it's working.

Post Reply

Return to “X Rebirth - Scripts and Modding”