[script] Turret Missile Defense Mk2 v1.01 [link updated]

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

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

fud
Posts: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

[script] Turret Missile Defense Mk2 v1.01 [link updated]

Post by fud » Thu, 21. Dec 06, 13:46

This is a "simple" edit to the egosoft turret missile defense. If you've ever been annoyed that the missle defense setting reverts to shooting at enemies when no missles are flying, this is for you.

Turret command is titled "Advanced Missile Defense" when you're selecting it. Works the same as the regular, requires fight command mk2 to be an option.


Thanks goes to Red Spot and Eladan for their input on this. :)


Missile Def Mk2.spk
Last edited by fud on Tue, 9. Jan 07, 14:02, edited 1 time in total.

nNemethon
Posts: 452
Joined: Thu, 31. Mar 05, 12:09
x3ap

Post by nNemethon » Thu, 21. Dec 06, 14:15

Cheers heaps Fud, I'll be looking forward to running it! :D Free M1 for you. Gotta go snooze now, Christmas waits for no tradesman, or do the clients. :(
"Although that question is less stupid, it was asked in a profoundly stupid manner." - Prof Farnesworth
----------
A diff signature every few months (not guaranteed, warranteed or warranted) ;)

Cisor
Posts: 287
Joined: Sat, 25. Sep 04, 15:06
x4

Post by Cisor » Thu, 21. Dec 06, 16:01

No special Wares required?

In any event, I'm looking forward to this. It'll make capturing a bit easier.

fud
Posts: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud » Thu, 21. Dec 06, 16:07

Cisor wrote:No special Wares required?

Just fight command mk2, like the other turret commands. :)

JMCorp
Posts: 1422
Joined: Thu, 21. Apr 05, 21:48
x4

Post by JMCorp » Thu, 21. Dec 06, 16:12

while you're at it make an "attack enemies" that shoots at enemy ships but targets missiles first? the default attack enemies ignores missiles completely. the default missile defense will not attack an enemy until it has shot at you and HIT first. really annoying.

fud
Posts: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud » Thu, 21. Dec 06, 17:41

That's sort of how the ego missle defense works. I know what you're getting at, but the ego version does about the same thing. If there are no missles to shoot at, it'll shoot at nearby enemies.

JMCorp
Posts: 1422
Joined: Thu, 21. Apr 05, 21:48
x4

Post by JMCorp » Fri, 22. Dec 06, 20:24

the stock missile defense will not target an enemy ship unless they've scored a successful hit. while it's "about" the same thing, it's not the same thing. i could fly around for hours waiting on some of these idiot AI ships to hit my titan a few times so the turrets will attack them. so i just leave it on attack enemy and absorb the missiles. luckily i've never had anyone firestorm me.

fud
Posts: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud » Fri, 22. Dec 06, 20:47

This script was more suited towards the people that were fed up with their turrets shooting up ships that were potential bail outs. *My* reasoning for pursuing it, was having your own missles shot down by them, as they were shooting at enemy ships when no missles were there.

WarmMachineME
Posts: 119
Joined: Mon, 9. Jan 06, 03:19
x3tc

Post by WarmMachineME » Fri, 22. Dec 06, 21:20

fud wrote:This script was more suited towards the people that were fed up with their turrets shooting up ships that were potential bail outs. *My* reasoning for pursuing it, was having your own missles shot down by them, as they were shooting at enemy ships when no missles were there.
As well as those of us who also don't want their MD turrets wasting ammo on anything that isn't a missile. I've got 4 streams of searing, radioactive plasma washing over them, I don't need any help from my li'l turret buddies...

Thanks much, fud. :thumb_up: Now I can carry half the ammo crates and save that much cargo space, among other benefits.

User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 » Wed, 27. Dec 06, 04:10

I'm not being an ass... but it's spelt missile :D

Is the word spelt missle in the entire script?

Computertech
Posts: 87
Joined: Sun, 21. Mar 04, 23:18

Post by Computertech » Wed, 27. Dec 06, 04:35

JMCorp wrote:while you're at it make an "attack enemies" that shoots at enemy ships but targets missiles first? the default attack enemies ignores missiles completely. the default missile defense will not attack an enemy until it has shot at you and HIT first. really annoying.
I would like to have a script like that as well. shoots ememies but also shoots missiles as well. Not just wait until i'm hit. Would be nice having a nice amount of turrent scripts...

fud
Posts: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud » Wed, 27. Dec 06, 14:01

arcana75 wrote:I'm not being an ass... but it's spelt missile :D

Is the word spelt missle in the entire script?

:shrug:


I was in a hurry, and was more concerned with getting it functioning.

User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 » Thu, 28. Dec 06, 05:03

LOL no worries fud... a small edit in the t file fixed it up!

BTW fud is it possible to change the missile script NOT to shoot Hammerhead missiles? Otherwise it's an awesome script, 100% of the time enemy-fired missiles blow up in their face!

fud
Posts: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud » Thu, 28. Dec 06, 05:43

I'm not sure there's any way to discriminate missile types. It just looks for a missile object.

User avatar
Red Spot
Posts: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

Post by Red Spot » Fri, 29. Dec 06, 00:19

fud wrote:I'm not sure there's any way to discriminate missile types. It just looks for a missile object.

*out of the naked brain coding ....*

at the top of the script where it looks for a missile ..
add something under it like this;

if $missile exists
$type get type of ware; $missile
skip if $type != [not to shoot at type]
$missile == null
end



G

fud
Posts: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud » Fri, 29. Dec 06, 03:25

Well, there ya go. :P

This is why I'm a student, and you're the professor. :)

User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 » Fri, 29. Dec 06, 03:37

Excellent thanks RS! I'll give that a shot... shooting an ass-slow Hammerhead to close range is ... auto-suicide!

User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 » Fri, 29. Dec 06, 06:24

Would this be about right...

Code: Select all

$victim = [THIS] -> find nearest missile aiming to me
010     if $victim -> exists
011      
012      if $victim == Hammerhead Missile
013       break
014      end
015      
016      set script command target: $victim

User avatar
Red Spot
Posts: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

Post by Red Spot » Sat, 30. Dec 06, 03:20

arcana75 wrote:Would this be about right...
Does it look remotly as what I showed ... :roll:

Also note the word "add" in my previous post .. its there cause of a reason ..;)

(there are much better ways of implementing it than that I showed, but the way I showed should be a good "start" .. Once you have it working without causing infinite loops you may want to try and optimize the script, altho it would have little use, besides being a good experiance, as I already stipped all mumbo-jumbo from the from the script when I cut the lines to stop it targeting ships)



G

User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 » Sat, 30. Dec 06, 04:18

Red Spot wrote:
arcana75 wrote:Would this be about right...
Does it look remotly as what I showed ... :roll:

Also note the word "add" in my previous post .. its there cause of a reason ..;)

(there are much better ways of implementing it than that I showed, but the way I showed should be a good "start" .. Once you have it working without causing infinite loops you may want to try and optimize the script, altho it would have little use, besides being a good experiance, as I already stipped all mumbo-jumbo from the from the script when I cut the lines to stop it targeting ships)
Actually I have no clue what you typed, I'm not a scripter :cry:

Post Reply

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