is it possibile to make a anti missile spider drone for cpt ships? read more
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 108
- Joined: Thu, 14. Sep 06, 01:04
is it possibile to make a anti missile spider drone for cpt ships? read more
just tossing a request out there but is it possible to make a anti-missile spider drones crawl around on the ship and shoot missiles? i think it would be really cool to see like 10 or 20 max spider things running all over a ship blasting missiles and things,
idk how to do this stuff but would it be possible to make a drone hover a certain distance from a ship but give it the sound a spider drone would make and leg animation to make it look likes its running on the ship instead of hovering? if someone could do this it would be really awesome!
idk how to do this stuff but would it be possible to make a drone hover a certain distance from a ship but give it the sound a spider drone would make and leg animation to make it look likes its running on the ship instead of hovering? if someone could do this it would be really awesome!
-
- Posts: 10522
- Joined: Fri, 12. Mar 04, 19:47
I am not sure that would be feasible via scripting, the type of motion you describe sounds too complex to me. What might be feasible is perhaps orbiting drones (each with a single fast-ish firing insta-hit laser) that only target enemy missiles (and perhaps drones).
I am thinking they could be designed like the practice drones Luke Skywalker practiced his light sabre skills against in Star Wars (i.e. a simple orb fast but manoeuvrable orb.
I am thinking they could be designed like the practice drones Luke Skywalker practiced his light sabre skills against in Star Wars (i.e. a simple orb fast but manoeuvrable orb.
Lenna (aka [SRK] The_Rabbit)
"Understanding is a three edged sword... your side, their side... and the Truth!" - J.J. Sheriden, Babylon 5 S4E6 T28:55
"May god stand between you and harm in all the dark places you must walk." - Ancient Egyption Proverb
"When eating an elephant take one bite at a time" - Creighton Abrams
"Understanding is a three edged sword... your side, their side... and the Truth!" - J.J. Sheriden, Babylon 5 S4E6 T28:55
"May god stand between you and harm in all the dark places you must walk." - Ancient Egyption Proverb
"When eating an elephant take one bite at a time" - Creighton Abrams
-
- Posts: 108
- Joined: Thu, 14. Sep 06, 01:04
yes or like the shield charging drones how they hover near the ship no matter how fast i go, and ya i guess u would have to make a whole new design and stuff and then add it in, but apart for the rest idk anything about this stuff so like you said, in other words, just cuz it sounds do-able doesn't mean it is. but making it hover close like a shield drone but make it look like its walking. but thats beyond coding in more 3d max i think. i just wish i knew more about this i would love to make mods.
Roger L.S. Griffiths wrote:I am not sure that would be feasible via scripting, the type of motion you describe sounds too complex to me. What might be feasible is perhaps orbiting drones (each with a single fast-ish firing insta-hit laser) that only target enemy missiles (and perhaps drones).
I am thinking they could be designed like the practice drones Luke Skywalker practiced his light sabre skills against in Star Wars (i.e. a simple orb fast but manoeuvrable orb.
-
- Posts: 10522
- Joined: Fri, 12. Mar 04, 19:47
The problem is not the animation of the model's legs (pretty much a piece of cake from a modelling perspective) but making the motion of the drone tally up with the movement of the legs and have it move along the surface of the hull.
In short, orbiting the model is very feasible but walking along the hull most probably is not.
In short, orbiting the model is very feasible but walking along the hull most probably is not.
Last edited by Sam L.R. Griffiths on Tue, 14. Apr 15, 18:54, edited 1 time in total.
Lenna (aka [SRK] The_Rabbit)
"Understanding is a three edged sword... your side, their side... and the Truth!" - J.J. Sheriden, Babylon 5 S4E6 T28:55
"May god stand between you and harm in all the dark places you must walk." - Ancient Egyption Proverb
"When eating an elephant take one bite at a time" - Creighton Abrams
"Understanding is a three edged sword... your side, their side... and the Truth!" - J.J. Sheriden, Babylon 5 S4E6 T28:55
"May god stand between you and harm in all the dark places you must walk." - Ancient Egyption Proverb
"When eating an elephant take one bite at a time" - Creighton Abrams
-
- Posts: 309
- Joined: Sun, 14. Feb 10, 17:47
-
- Moderator (Script&Mod)
- Posts: 14571
- Joined: Sun, 20. Nov 05, 22:45
currently experimenting with fighter-based missile defense for NPCs and it works far too good.. my Hellbusters dont even get 100m far before they are shot down..(although its always the same Fighter which gets selected for shooting Missiles - have to change this ^^) and manually shooting the Balor's Missiles down is also not that big problem, even without Targeting help (ok, you have to get quite close, but about 3 shots with the starting weapon are enough)oliverjanda wrote:It's not even possible to target missiles properly so I'd say this is (nearly) impossible atm.
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help

-
- Posts: 309
- Joined: Sun, 14. Feb 10, 17:47
Well we weren't talking about manually shooting missiles but that you solved the missile defense issue is great news!UniTrader wrote:currently experimenting with fighter-based missile defense for NPCs and it works far too good.. my Hellbusters dont even get 100m far before they are shot down..(although its always the same Fighter which gets selected for shooting Missiles - have to change this ^^) and manually shooting the Balor's Missiles down is also not that big problem, even without Targeting help (ok, you have to get quite close, but about 3 shots with the starting weapon are enough)oliverjanda wrote:It's not even possible to target missiles properly so I'd say this is (nearly) impossible atm.
So one had to make a drone ability out of that (dunno how diffcult that is) and put that on a shield drone to finish this.
-
- Posts: 31
- Joined: Fri, 27. Mar 15, 20:58
have you tried making it based on officer skill?UniTrader wrote:currently experimenting with fighter-based missile defense for NPCs and it works far too good.. my Hellbusters dont even get 100m far before they are shot down..(although its always the same Fighter which gets selected for shooting Missiles - have to change this ^^) and manually shooting the Balor's Missiles down is also not that big problem, even without Targeting help (ok, you have to get quite close, but about 3 shots with the starting weapon are enough)oliverjanda wrote:It's not even possible to target missiles properly so I'd say this is (nearly) impossible atm.
you can negate most ships from acknowledging the threat if you make it based on crew skill.
this.defensible.defencenpc.skill.combat
then to make it so missiles have a better chance to get through make it random chance of failure.
chance has to be a number less than 100 i think or it doesn't matter it always happens. i would make it based on crew skill...<do_if value="***incoming missle***" chance="$skill">
if it gets here you target it
</do_if>
hope that helps ps i would love to see you code im now rewriting the entire combat script to make it where the guns don't override my attempt to kill the missiles.... its a pain.
-
- Moderator (Script&Mod)
- Posts: 14571
- Joined: Sun, 20. Nov 05, 22:45
its not that much.. i just hacked in a new signal handler into move.patrol, which checks if one of the escort Ships is currently closer to the missile as the targeted ship (and some other checks), checks if this.ship.mayattack.{$missile} and if necesary sets the missle to foe for a split-second (<-- that was the biggest problem i had because it was not obvious this is necesary
) and signals the escort Ship to attack the Missile.. all in about 50 lines - it works, but not really something i would release as mod yet ^^
move.patrol.xml
and before i add fancy stuff like skills i would like to implement other stuff like importance of the missile... but need to know how i can get its damage value before i can implement anything like priorities... also interceptor choice needs improvements ^^

move.patrol.xml
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<diff>
<add sel="//interrupts">
<handler>
<conditions>
<event_object_incoming_missile object="this.ship"/>
</conditions>
<actions>
<!-- object = target object, param = target component, param2 = missile, param3 = missile source - find someone to kill it -->
<set_value name="$missiledistance" exact="event.param.distanceto.{event.param2}"/>
<set_value name="$subordinates" exact="this.$escortgroup"/>
<do_if value="$subordinates.count == 0">
<create_group groupname="$subordinates"/>
<add_to_group groupname="$subordinates" list="this.ship.subordinates"/>
</do_if>
<debug_text filter="general" text="'Incoming Missile: %1 %2 %3 %4 subordinates count: %5'.[event.object.knownname,event.param.knownname,event.param2.knownname,event.param3.knownname,$subordinates.count]"/>
<!-- find the first FIGHTER which is NEARER to the Missile than the Missile Target and ESCORTING this ship -->
<do_all exact="$subordinates.count">
<set_value name="$interceptor" exact="$subordinates.random" />
<do_if value="$interceptor.isclass.ship_s or $interceptor.isclass.ship_m">
<debug_text filter="general" text="'Found S/M Ship: %1'.[$interceptor]"/>
<do_if value="$interceptor.primarypurpose == objectpurpose.fight">
<debug_text filter="general" text="'with Purpose Fight'"/>
<do_if value="$interceptor.distanceto.{event.param2} lt $missiledistance or true">
<debug_text filter="general" text="'in Range => sending it!!!!!!!!'"/>
<do_if value="not this.ship.mayattack.{event.param2}">
<add_relation_boost object="this" otherobject="event.param2" value="this.owner.relation.kill.max" decay="1" delay="0.01s" silent="true"/>
</do_if>
<set_value name="$interceptor.pilot.$goattack" exact="true"/>
<signal_objects object="$interceptor" param="'attack'" param2="event.param2"/>
<do_if value="event.param2.isoperational">
<debug_text filter="general" text="'event.param2.isoperational'"/>
</do_if>
<do_if value="this.ship.mayattack.{event.param2}">
<debug_text filter="general" text="'this.ship.mayattack.{event.param2}'"/>
</do_if>
<do_if value="$interceptor.pilot.$goattack">
<debug_text filter="general" text="'$interceptor.$goattack'"/>
</do_if>
<break/>
</do_if>
</do_if>
<!--( $subordinates.{$i}.ship.isclass.ship_s or $subordinates.{$i}.ship.isclass.ship_m ) and
( $subordinates.{$i}.ship.primarypurpose == objectpurpose.fight ) and
( $subordinates.{$i}.ship.distanceto.{event.param2} lt $missiledistance ) and
( $subordinates.{$i}.command == command.escort ) and
( $subordinates.{$i}.command.param == this.ship )">-->
</do_if>
<remove_from_group group="$subordinates" object="$interceptor" />
</do_all>
</actions>
</handler>
</add>
</diff>
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help

-
- Posts: 31
- Joined: Fri, 27. Mar 15, 20:58
wow, ok i didn't see that one coming.. i thought you some how figure out how to launch a drone from the drone bay and speed it to the missile and kill it...
my very crude efforts to do this consistently look like this. and i put this code in defend.capital
my very crude efforts to do this consistently look like this. and i put this code in defend.capital
<handler>
<conditions>
<event_object_incoming_missile object="this.ship"/>
</conditions>
<actions>
<find_object name="$missle" class="class.missile" space="this.zone" multiple="true">
<match_distance object="this.ship" max="15km"/>
</find_object>
<activate_flaks object="this.ship" />
<set_turret_targets object="this.ship" target="$missle.list"/>
<debug_text text="'%1 at player age %2 have %3 and %4'.[this.ship.knownname, player.age, event.param, event.param2 ]" chance="100"/>
</actions>
</handler>
<handler>
<conditions>
<event_player_launched_missile object="this.ship"/>
</conditions>
<actions>
<find_object name="$result" class="class.missile" space="this.zone" multiple="true">
<match_distance object="this.ship" max="15km"/>
</find_object>
<do_if value="$result.count gt 0">
<do_all exact="$result.count" counter="$x" reverse="true">
<do_if value="$result.{$x}.target == this.ship">
<debug_text text="'Player shot missle %1 at %2 at at a ship named %3 and i do not know what this last data bit means %4'.[$result.{$x}, player.age, this.ship.knownname, event.param2 ]" chance="100"/>
</do_if>
<do_elseif value="$result.{$x}.target == null">
<transform_position name="$Position" refposition="$result.{$x}.position" refrotation="$result.{$x}.rotation">
<position x="0m" y="0m" z="$result.{$x}.distanceto.{this.ship}"/>
</transform_position>
<do_if value="this.ship.distanceto.{$Position} lt this.ship.size">
<!-- Missile is aimed at us -->
<debug_text text="'Player may have shot missle %1 at %2 at at a ship named %3 and i do not know what this last data bit means %4'.[$result.{$x}, player.age, this.ship.knownname, event.param2 ]" chance="100"/>
</do_if>
<do_else>
<!-- someone else is the unlucky one -->
</do_else>
</do_elseif>
</do_all>
</do_if>
<do_else>
<!-- <debug_text text="'Player did not shoot at %1 at player age %2 have %3 and %4'.[this.ship.knownname, player.age, event.param, event.param2 ]" chance="100"/> -->
</do_else>
</actions>
</handler>
-
- Posts: 452
- Joined: Mon, 7. May 07, 05:17
I don't known if this is already made/or a feature on the game, but could be also possible to make a code for the turrets fire against mines (minefields) too?UniTrader wrote:currently experimenting with fighter-based missile defense for NPCs and it works far too good.. my Hellbusters dont even get 100m far before they are shot down..(although its always the same Fighter which gets selected for shooting Missiles - have to change this ^^) and manually shooting the Balor's Missiles down is also not that big problem, even without Targeting help (ok, you have to get quite close, but about 3 shots with the starting weapon are enough)oliverjanda wrote:It's not even possible to target missiles properly so I'd say this is (nearly) impossible atm.
-
- Moderator (Script&Mod)
- Posts: 14571
- Joined: Sun, 20. Nov 05, 22:45
possible yes, you just have to get the Mines into a var and give the command to attack them.. (and maybe take care of some other quirks like the .mayattack i mentoined earlier)
ps @bradines
did my code snippet help you?
ps @bradines
did my code snippet help you?

if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help

-
- Posts: 31
- Joined: Fri, 27. Mar 15, 20:58
yes it helped thank you, was different from what i expected, but enlightening...
is there a way for us to ask what macro an object is using if its like a class ship or missile?
if so can't we use a case statement to figure out how bad the missile will be when it hits... obviously you can only use this for default missile in the game and i guess i would use if its not caught by the other missile types assume its a mod and target it as highest priority because i have only seen a few mods that are well balanced and if a modded missile gets through it will likely be devastating.
is there a way for us to ask what macro an object is using if its like a class ship or missile?
if so can't we use a case statement to figure out how bad the missile will be when it hits... obviously you can only use this for default missile in the game and i guess i would use if its not caught by the other missile types assume its a mod and target it as highest priority because i have only seen a few mods that are well balanced and if a modded missile gets through it will likely be devastating.
-
- Moderator (Script&Mod)
- Posts: 14571
- Joined: Sun, 20. Nov 05, 22:45
that would have been my fallback plan.. but a one i dont like since i try to make it as general as possible (eg should also work with total conversions)
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
