[SCR] Missile Safety (v1.12)

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

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

[SCR] Missile Safety (v1.12)

Post by Gazz » Sat, 7. Mar 09, 14:25

English / Deutsch

Missile Safety
  • This script is compatible with TC and AP.
  • Especially when flying a fighter it is not uncommon that missiles that you launch are immediately destroyed by enemy fire - or by your own cockpit guns / turrets.
  • This script provides a missile safety so the warheads are armed after the missile is at least 200m clear of your ship.

    Note that this is not foolproof. A lucky shot can still detonate a missile even if the warhead isn't armed.
    (Firing at warheads is neither safe nor recommended by the manufacturer)
  • This only affects missiles that
    • are launched by the playership
    • have a target
    • are of the type that is selected as current missile in the cockpit
  • The missiles do not have to be launched manually as long as they meet the aforementioned conditions and are launched at the current cockpit target.
    Scripts like Missile Barrage or MEDUSA could make use of this.
  • This ignores missiles fired by huge ships (M1, M7M...) because these simply do not have the problem of missiles instantly being destroyed on launch.
    It is a fighter issue.
    And I wanted to exclude massive missile barrages. =)
  • This is an AL plugin. It can be turned on/off under Gameplay / AL Plugins.
  • In X3:AP, this script can be enabled for the AI as well.
    Copy the contents of the scripts\X3AP_Missile_Safety_AI folder into \scripts\.
    In the long run this is only going to work with Steam in Offline mode (or with updates disabled for AP) because it is necessary to overwrite vanilla files... which Steam would "fix" again.
  • For scripters:
    To use Missile Safety for any AI ship, insert one script call before the actual launch instruction.

    Code: Select all

    020 skip if not get global variable: name='GZ.MSL.SAFETY'
    
    021    @ = [THIS] -> call script 'al.plugin.gz.missile.safety' :  plugin ID=null  plugin event='launch'  Missile launched=$Missile  Target Old=$Target
    
    022   = [THIS] -> fire missile $Missile on $Target
[url=http://forum.egosoft.com/viewtopic.php?t=238904]How To Use AL Plugins[/url]

Image Download: ZIP


Installation
Copy the contents of the zip into the X3_TC folder
or in the case of X3:AP, into ... \Steam\SteamApps\common\x3 terran conflict\addon


Deinstallation
  • Turn off the AL plugin under Gameplay / AL Plugins.
  • Save.
  • Delete TC\scripts\al.plugin.gz.missile.safety.xml
Resources used:
Task ID 47050 and 57050 on the playership.
Last edited by Gazz on Tue, 27. Dec 11, 05:44, edited 14 times in total.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Sat, 7. Mar 09, 14:25

* * reserved * *

argon_emperor
Posts: 1221
Joined: Mon, 12. Dec 05, 08:41
x4

Post by argon_emperor » Sat, 7. Mar 09, 14:57

Sounds good, will give it a spin tonight.

Lancefighter
Posts: 2936
Joined: Sun, 19. Dec 04, 03:41
xr

Post by Lancefighter » Sat, 7. Mar 09, 23:05

a question from a technical standpoint:

its an AL plugin...
I was under the impression those are only run every 1 minute at most, yet i assume it works on missiles as soon as they launch

So erm how does it actually work?

I tried to take a look at the file but it makes no sense in notepad2 or the ms xml editor...
(whats a good out of game editor type thing for x3tc files?)
in the market for a new sig, willing to pay 1 billion credits for a proper sig...

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Sun, 8. Mar 09, 01:00

Lancefighter wrote:its an AL plugin...
I was under the impression those are only run every 1 minute at most, yet i assume it works on missiles as soon as they launch

So erm how does it actually work?
Hahaha!
Since AL plugins already have a library structure this single script runs in 3 different ways in 3 different places/tasks.
Up to 2 of them run on the playership...
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Lancefighter
Posts: 2936
Joined: Sun, 19. Dec 04, 03:41
xr

Post by Lancefighter » Sun, 8. Mar 09, 01:03

erm.

Ill take your word that it will work then :?
in the market for a new sig, willing to pay 1 billion credits for a proper sig...

User avatar
LV
Sith Lord
Posts: 6362
Joined: Wed, 6. Nov 02, 21:31
x3tc

Post by LV » Sun, 8. Mar 09, 01:18

Lancefighter wrote:(whats a good out of game editor type thing for x3tc files?)
to view the best thing is firefox or ie as long as the script is in the same folder as the x2script.xsl found in your scripts folder ( i have a temp folder with that file in to view scripts while keeping them away from the game directory)


to edit, the script editor, unless i've missed something seriously major there is no stable standalone editor, alterations via the script editor are the only way i know of
LV's TC Scripts
Readme's For All My Scripts


I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced

si tacuisses, philosophus mansisses

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Sun, 8. Mar 09, 01:33

Just follow the tasks...
At the Work: part it starts spawning into different places and it eventually runs on 3 different timers simultaneously.

Sure, I could have split it into 3 scripts but since AL plugins are already perfectly suited to act as their own library I just wrapped it all in one.

Since it's a very small project (1-2 pages of script per task) there was no danger of losing track of things. In fact I wrote it, turned it on, and it worked...
It's really very simple once you acquire the proper multiple schizophrenia.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

pelador
Posts: 1230
Joined: Wed, 6. Nov 02, 21:31
x3tc

Post by pelador » Sun, 8. Mar 09, 01:40

Exscriptor - works well as an external editor (so far I have found it to be relatively stable)

Fightin 501st
Posts: 8
Joined: Sat, 28. Feb 09, 14:20

Post by Fightin 501st » Sun, 8. Mar 09, 11:34

[angelic choir]alleuiaaaaaaaaa[/angelic choir]
A dog isn't a mans best friend;

A gun is.

INSTG8R
Posts: 163
Joined: Sun, 30. Jul 06, 09:04
x3tc

Post by INSTG8R » Sun, 8. Mar 09, 18:32

Fightin 501st wrote:[angelic choir]alleuiaaaaaaaaa[/angelic choir]
Amen to that!

Thanks so much Gazz for making this Script!!! :D 8)

adecoy
Posts: 203
Joined: Wed, 24. Jan 07, 07:26
x3tc

Post by adecoy » Mon, 27. Apr 09, 20:18

thanks for this! no longer will i be afraid to use missiles! :thumb_up:
Image

User avatar
Predator02
Posts: 483
Joined: Sat, 28. Jul 07, 00:05
x3tc

Post by Predator02 » Mon, 27. Apr 09, 23:39

This is a wonderful script, especially with heavy explosive torpedoes.

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Sat, 16. May 09, 17:38

Version 1.05 released.

Prepared script to be used by AI ships.

They will not actually make use of it until the script call is tied into the fight scripts.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

aka1nas
Posts: 1382
Joined: Thu, 7. Jul 05, 05:17
x4

Post by aka1nas » Mon, 18. May 09, 00:28

Gazz wrote:Version 1.05 released.

Prepared script to be used by AI ships.

They will not actually make use of it until the script call is tied into the fight scripts.
Woohooo! Can't wait until it's ready! Is that going to be a part of your OOS redux?

Post Reply

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