[Script]RS.Turret Defence

The place to discuss scripting and game modifications for X³: Reunion.

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

Post Reply
User avatar
Red Spot
Posts: 3224
Joined: Fri, 4. Feb 05, 14:44
x3

[Script]RS.Turret Defence

Post by Red Spot » Wed, 15. Mar 06, 01:05

New script .. new topic .... :roll:


This 'project' I actually started for 2 reasons;
-wanted to see if I could improve to NPCs turrets
-get some 'knowhow' on how to make someting similair for the player


well I found out the use of turrets is something really balanced ..
a few shots to many and your out of energy ..
a couple to few and you die with energy at max level ......

anyway to not bother you with boring details ...
I believe I made a rather good and balanced ..
but above all *fast* turret command ...

expect my scripts to make use of this ..... :twisted:

the end result is that it isnt *better* ..
it just does it different ... and fast ..
and to my taste its much fun .... :D
-RS.Turret Defence-



This script combines energy managment, target tracking and weapon switching.
And makes a turret have a bit more of a bite than it now does.
This will not improve the turrets ability to hit something.


This script tries to keep the ships energy level up,
but as shields and/or hull might go down energy becomes less of a priority.
When the ships energy is low it will start firing in 'pulses',
meaning it will fire a few shots at a time making sure the energy level isnt going 'critical'.


There are 2 ways of using this command on your turrets.
Set the missile fire probability over 80% and the turret doesnt care about 'friendly fire',
set it at 80% or lower and it will keep an eye on what weapon to use.
Do note; the turret finds itself more important than any 'friendly',
if it has the choice of no weapon or an aera-effect weapon, than it will pick the area-effect weapon.


Mass Drivers are a 'special' among 'the specials'.
If a ships energy is low, or the target is a missile, M4, M5 or Drone,
the turret will *always* try switching to Mass Drivers.
If it has energy or the target is a missile it will fire with or without Mass Drivers.
If energy is low and the target is in Mass Driver fire-range, you can watch the ships hull go down ...
It will NOT try swiching to Mass Drivers when fighting larger ships if it still has energy,
it would simply waste ammo wich could be needed an other time.


The turret will first of all give priority to an incoming missile,
than to a possible enemy the player has targeted,
after that it will look for a 'targeted enemy'.
This means it will see if any other turret is tracking a target and will check if it can 'combine fire'.
After that it will see if the ship has an attacker, attack target or if there is any other enemy near the ship.


If an enemy has been found the turret will always start tracking it,
but when the target gets in firingrange the turret will have a very small 'delay'.
This delay will make sure less energy is wasted on 'long range fire' where it could be more effective in closer range.


The overall result of this command is that a turret will fire sooner (yep .. even with a delay its firing before others),
it will fire with the *best* weapon it has to use (it will switch weapons between shots if needed),
it will drain energy at a pretty good pass, but will never let it go 'critical' while shields and hull are up.


When equipping a ship equip it like the following to get maximum result;
when you equip a ship that has lets say 8 guns in each turret than dont give it 12 of a weapon.
Give it 8, 16, 24 or 32, anything with steps of 8 will have the *best* result.
For a ship like an M2, designed for heavy duty combat,
I'd advise to equip about 16 units of each weapontype it can install.
(I'd forget the Flak as it simply drains a lot of energy)
And give it maximum weapons for each turret.

A couple of weapons no ships should leave home without are;
the PBE's and Mass Drivers, make sure your ship has them, they are life-savers ..


This script will replace the "Turret attack enemies" command.
When you install this than when you use the "Turret attack enemies" command you will use this script.
to install just copy or move the files found in the 'scripts' folder to your 'X3 scripts' folder ...
NO new command will show .. it will replace the 'current' turret attack enemies command ...


get it here;
http://www.geocities.com/g5_11/X3/RS.Tu ... ev3.15.zip


G
Last edited by Red Spot on Fri, 24. Mar 06, 16:30, edited 1 time in total.

alphalvr
Posts: 1519
Joined: Sun, 13. Nov 05, 19:19
x3ap

Post by alphalvr » Wed, 15. Mar 06, 01:37

i hope it 1.4 compatible....use your psycic powers :D

i think i may have misunderstood you last time we spke.

when you say npc this time it looks like you refer to player ships (ie my ships or wingmen) so sorry to ask again but to clarify....do enemy npc ships use it as well?
Last edited by alphalvr on Wed, 15. Mar 06, 01:41, edited 1 time in total.

User avatar
Red Spot
Posts: 3224
Joined: Fri, 4. Feb 05, 14:44
x3

Post by Red Spot » Wed, 15. Mar 06, 01:39

I dont see any reason why it would not be ...

afaik the way I did it you can actually have a 'weapon-rebalance' without upsetting the script ... :)
(as long as MDs stay MDs ...)


G

Heretic666
Posts: 461
Joined: Fri, 20. Feb 04, 18:30
x3tc

Post by Heretic666 » Wed, 15. Mar 06, 02:46

Does this script require any input from the player or is it automatically running in the background?

Because I get no new commands when I go to my ship menus..

alphalvr
Posts: 1519
Joined: Sun, 13. Nov 05, 19:19
x3ap

Post by alphalvr » Wed, 15. Mar 06, 03:08

Heretic666 wrote:Does this script require any input from the player or is it automatically running in the background?

Because I get no new commands when I go to my ship menus..
there are no new commands, it explains better in the readme but ive checked it and it covers what you have asked :)

you use your normal turret commands and the missile use %

Heretic666
Posts: 461
Joined: Fri, 20. Feb 04, 18:30
x3tc

Post by Heretic666 » Wed, 15. Mar 06, 03:11

Aha!

Curse my non-reading...ness... :oops:

Thanks for that..

It also says that at the bottom of the original post
This script will replace the "Turret attack enemies" command.
When you install this than when you use the "Turret attack enemies" command you will use this script.
Do'h! :lol:

That makes it a lot easier to use..1 more question..will this work in any ship?

User avatar
Red Spot
Posts: 3224
Joined: Fri, 4. Feb 05, 14:44
x3

Post by Red Spot » Wed, 15. Mar 06, 13:07

yep it req. player input .. the player has to make sure to equip the ship ..
thats enough input ...;)


this script is 'just' for the player ...
it does NOT change the turretcommands for your every day NPC
(only the NPCs in 'my scripts' will be using the same commands)

and no it does not work on any ship ..
ever seen an M5 with a turret ?!? .... :roll:



G

Heretic666
Posts: 461
Joined: Fri, 20. Feb 04, 18:30
x3tc

Post by Heretic666 » Wed, 15. Mar 06, 13:31

Ok great thanks for that using it already :D

User avatar
Red Spot
Posts: 3224
Joined: Fri, 4. Feb 05, 14:44
x3

Post by Red Spot » Wed, 15. Mar 06, 15:34

just to have it said ...

v1.4 compatibillity .... :thumb_up:



G

User avatar
Deta7
Posts: 54
Joined: Fri, 2. Dec 05, 23:40
x3

Post by Deta7 » Sat, 18. Mar 06, 18:38

Looks nice, sounds nice downloading now ;) - thanx for sharing

SkyLeach
Posts: 116
Joined: Mon, 20. Mar 06, 23:44
x3tc

Post by SkyLeach » Wed, 22. Mar 06, 06:00

Popping this in to try it on my Titan
-SL

gray1107
Posts: 85
Joined: Fri, 4. Nov 05, 17:25
x3

Post by gray1107 » Wed, 22. Mar 06, 15:46

First of all great script! Just a quick question:

This script swaps weapons between cargo and turrets yes? I know you can do this manually but it's almost cheating IMHO.

Have you considered having each turret only fire weapons that are installed? Say half of the weapons in a particular turret are anti-capship this would certainly fix the energy drain problem and over time could still deal a comparable amount of damage since the energy drains slower.

I think it would also add an extra level of depth aswell, so you could have more say in the way your turrets operate. For instance do you assign 1 mass driver to all turrets or maybe 2 to your left and right turrets?

By the way I will be installing this script either way, my only problem is finding all the extra weapons! :D

User avatar
Red Spot
Posts: 3224
Joined: Fri, 4. Feb 05, 14:44
x3

Post by Red Spot » Wed, 22. Mar 06, 16:09

I can do that ... and it would mean;
-you lozing each and every cap. ship battle you start
-wasting ammo and energy with each and every shot
(as the turret will fire when the biggest gun is in range .. and all the smaller guns just drain energy and ammo for .. ehmm .. the light show ?!?)



as it is the NPCs cap. ships already switch weapons
the only one left out is the player ..

also note that I've been tweaking and testing this for about 2 weeks before I was 'happy' with it ..
and I can assure you that its not a 'cheat' ...

as I've said in the first post ... this script is not *better* ..
it just works diff. .. it puts its prio. diff. than ES' 'advanced turret script' ...
the end result is *about* the same ...

imo you could call this aegis for X3 without the 'taking it to the max' bit ..
(as in going over the top .. and as end result being a cheat)
ooohh .. and its not even half as demanding as aegis for X2 was/is ..



G

Zipholm
Posts: 11
Joined: Sun, 11. Jul 04, 21:49
x3

Post by Zipholm » Wed, 22. Mar 06, 18:16

Hej Red Spot,

Thanks for yet another great script.

Is there any way of making a similar script for non-turret weapons (Front lasers on smaller fighters)?

It's not for my personal ship, but for my wingmen. I would like them to switch between HEPTs and PACs, depending on their target. I don't believe that such a script exists currently.

Regards,
Zip

gray1107
Posts: 85
Joined: Fri, 4. Nov 05, 17:25
x3

Post by gray1107 » Wed, 22. Mar 06, 18:41

Red Spot wrote:I can do that ... and it would mean;
-you lozing each and every cap. ship battle you start
-wasting ammo and energy with each and every shot
(as the turret will fire when the biggest gun is in range .. and all the smaller guns just drain energy and ammo for .. ehmm .. the light show ?!?)
Ah I was thinking of weapons groups, but it's all good especially since
Red Spot wrote:as it is the NPCs cap. ships already switch weapons
the only one left out is the player ..
:o

... Anyway top work!

Post Reply

Return to “X³: Reunion - Scripts and Modding”