Not a member yet? Why not Sign up today
Create an account  

  • 3 Vote(s) - 3.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 
Smart Lua Missile Guidance System v2.1.2

#1
Smart Lua Missile Guidance System

Feature Overview:
-Easily configurable, just edit the varaibles at the top of the code, should work on any vessel.
-Full guidance system for all lua enabled missiles, including missile interceptors.
-Highly accurate prediction system. (Uses second order mathematics and time-stepped modelling)
-Designates missiles to each enemy target based on thier score (score from mainframe).
-Different guidance styles:
  • Attack from above(Javelin style)
  • Attack from below
  • Direct engagement
  • Sea skimming
  • Anything else you can think of using the config variables
-Terrain aviodance system.
-Allied vessel avoidance system. (Accounts for velocity and bounding box with a time-stepped model)
-Safe detonation of missiles if there are no valid target.
-Can control some or all lua enabled missiles on a vehicle meaning different lua blocks with different settings can control different missiles.
-Missiles can be detonated when they are within a certain range of thier target.(By default turned off, by negative config value)
-Sea diving. If the target is in the water, dive into the water just before impact for explosives buff.
-Missile thrust control
  • Provides more thrust for faster targets
  • Provides boost thrust upon final closing for extra kinetic damage from Thumpers
or a different system that attempts to automatically find the best thrust values based off:
  • Predicted time till interception
  • Missile fuel left
  • Time till missile despawns (60 + (number of regulators * 180))


Links to 2.1.2 code:
.txt   FTD_Smart_Missile_Guidance_System_V2.txt (Size: 39.74 KB / Downloads: 1,186)
https://pastebin.com/yccQy1mG

Links to 1.4.0 code:
.txt   FTD_Smart_Lua_Missile_System.txt (Size: 20.73 KB / Downloads: 707)
http://pastebin.com/P2N9KyQb

   


*change notes*
17/10/2017 2.1.2
-Can now use weapon slots instead of weapons controller ID

09/09/2017 2.1.1
-Multitargetting can be turned off, if done everything targets the highest scoring enemy
-Minor fixes

30/08/2017 2.1.0
-Thrust levels can now be calculated using the fuel time left and the time till despawn of the missile. (Yes it accounts for any regulators you have)
-Calculates if the mssile can turn in time to hit the target, if not goes 'off course' till it can
-Missile can be detonated if it runs out of fuel

16/08/2017 2.0.1
-Fixed bug which was incorrectly deallocating usable lua transcievers

15/08/2017 2.0.0
-Huge rewrite of code
-Reworked and fixed the predictive algorithm
-Fixed the acceleration calculations
-Code can now control missile interceptors
-Missile thrust now also uses the angle to target in its calculations
-Missiles can now dive into the water just before impacting with a naval target for an explosives buff
-Choosing to a direct engagement guidance (putting the max crusing range higher than the max allowed range) will no longer disable ground aviodance

29/07/2017 1.4.0
-Missile thrust control (thanks to Aleksander Wit for pointing out this was possible, despite the lack of documentation on it)
-Provides more thrust for faster targets
-Provides boost thrust upon final closing for extra kinetic damage from Thumpers
-Rewritten en route cruising code

26/07/2017 1.3.1:
-Bug fixes thanks to evilebob.

20/03/17 1.3:
-Direct engagement range can now change dependant on target speed. (Useful for shooting down really fast targets)

08/03/17 1.2:
-Fixed lots of bugs.
-Code cleanup.
-Improved the prediction system. (Now accounts for the missile acceleration)
-Missiles can be detonated when they are within a certain range of thier target. (By default turned off, by negative config value)

06/03/17 1.1:
-Fixed bugs causing the guidance system to crash...usually causing the missile to do the same.
-Added user variables which enable use of torpedos
-Added function so each lua control block only controls lua transceivers near (user configured range) the associated missile control block.

05/03/17 1.0:
-Release
*end change notes*

Example missile cruiser, using two different types of missile in addition to torpedos all using this script with different user config files:
   
Download blueprint:
.blueprint   Hurricane.blueprint (Size: 643.11 KB / Downloads: 169)
(Note: Uses v1.3.0 which is bugged)

Updated version of the Hurricane which uses v2.0.0 code:
.blueprint   Maelstrom.blueprint (Size: 484.3 KB / Downloads: 105)



Example config setups for v2.1.2, just copy these over the existing config:

Long range attack from above cruise missile with sea diving(default):
Quote:--User Config Variables

--Launcher vehicle variables
MainFrameID = 0; --Which MainFrame to connect to
UseWeaponsSlots = false;
--If 'true' will use all weapons control blocks using the weapons slot of the variable 'WeaponID'
--If 'false' will use the weapons control block with the ID of the variable 'WeaponID'
WeaponID = 0;
MaxDistanceBetweenLuaTranscieverAndMissileControl = 10; --The maximum distnace between a lua transciever and its corrisponding missile control block.

--Missile variables
MissileInterceptor = false; --Set true if using being used for missile interception
TargetDetonationRange = -10; --If the distance between target and missile is below this value, blow up.

--Target acquisition variables
MultiTarget = true;
MaxRange = 4000; --Targets above this range from the missile launcher will be ignored.
MaxTargetHeight = 10000; --Targets above this height will be ignored.
MinTargetHeight = -20; --Targets below this range will be ignored.

--Safe detonation variables
SafeDetonteAltitude = 500; --If there are no target, goto and detonte at this altitude.
DetonateMissileUponEmptyFuel = true; --If the missile has run out of fuel, detonate?

--Missile boost variables
UseFuelDefinedThrustControl = true;
--If true: Uses the predicted time to intercept and the amount of remaining fuel to calculate thrust value. More adaptable to different ranges.
--If false: Uses the 'BaseMissileThrust' added to the target speed multiplied by 'MissileThrustTargetSpeedMultiplier' to calculate thrust.
--In both: If target is below 'BoostInterceptionTime' then thrust is multiplied by 'BoostThrustMultiplier'
BaseMissileThrust = 300; --Base thrust for missile.
MissileThrustTargetSpeedMultiplier = 10.0; --Value is multiplied by target's speed then added to base thrust of missile, useful for fast targets. Not used is UseFuelDefinedThrustControl = true.
BoostInterceptionTime = 6.0; --When the intercept time falls below this value,'BoostThrust' is added to missile thrust, useful for Thumpers.
BoostThrustMultiplier = 1.2; --Value multiplied to missile thrust once within boost range.

--Check angle to intercept variables
InterceptionTurnAngleTollerance = 5; --Added tollerance when calculating whether to steer away from target as interception is deemed currently impossible due to too steep an angle.

--Cruising variables
BaseDirectEngagementGroundRange = 240; --Below this ground range to target, head directly to target.
DirectEngagementGroundRangeSpeedMultipler = 0.6; --Added onto the engagement range after it has been multiplied by the target speed, used for fast targets.
CruisingAltitude = 250; --While en route travel at this altitude.
CruisingAltitudeAboveTerrain = 30; --If terrain nears cruising altitude, travel this heigh above the terrain.
MaxAllowedCruisingAltitude = 10000; --Missile will try and aviod going above this altitude
MinAllowedCruisingAltitude = 10; --Missile will try and aviod going below this altitude

--SeaDive variables
GroundRangeToTargetToSeaDive = 200;--Below this ground range to target, start diving underwater for explosives buff.
MaxTargetHeightForSeaDive = 5; --Max height of enemy aimpoint above the water to use seadiving on.
AdditionalSeaDiveDepth = 5; --Additional depth added to enemy aimpoint when seadriving.

--Anti ally collsion variables
AntiAlliedCollisionPredictionTimeLimit = 8; --Used to prevent missile-allied vessel collisions, number is seconds into the future predicted.
AntiAlliedCollisionPredictionTimeStep = 1; --The time step in seconds used to prevent missile-allied vessel collisions.
AntiAlliedCollisionAdditionalSafetyRange = 5; --Additional range to border of allies to avoid.

--End of User Config Variables


Long range attack from below torpedo:
Quote:--User Config Variables

--Launcher vehicle variables
MainFrameID = 0; --Which MainFrame to connect to
UseWeaponsSlots = false;
--If 'true' will use all weapons control blocks using the weapons slot of the variable 'WeaponID'
--If 'false' will use the weapons control block with the ID of the variable 'WeaponID'
WeaponID = 0;
MaxDistanceBetweenLuaTranscieverAndMissileControl = 10; --The maximum distnace between a lua transciever and its corrisponding missile control block.

--Missile variables
MissileInterceptor = false; --Set true if using being used for missile interception
TargetDetonationRange = -10; --If the distance between target and missile is below this value, blow up.

--Target acquisition variables
MultiTarget = true;
MaxRange = 4000; --Targets above this range from the missile launcher will be ignored.
MaxTargetHeight = 30; --Targets above this height will be ignored.
MinTargetHeight = -5000; --Targets below this range will be ignored.

--Safe detonation variables
SafeDetonteAltitude = -500; --If there are no target, goto and detonte at this altitude.
DetonateMissileUponEmptyFuel = true; --If the missile has run out of fuel, detonate?

--Missile boost variables
UseFuelDefinedThrustControl = false;
--If true: Uses the predicted time to intercept and the amount of remaining fuel to calculate thrust value. More adaptable to different ranges.
--If false: Uses the 'BaseMissileThrust' added to the target speed multiplied by 'MissileThrustTargetSpeedMultiplier' to calculate thrust.
--In both: If target is below 'BoostInterceptionTime' then thrust is multiplied by 'BoostThrustMultiplier'
BaseMissileThrust = 500; --Base thrust for missile.
MissileThrustTargetSpeedMultiplier = 10.0; --Value is multiplied by target's speed then added to base thrust of missile, useful for fast targets.
BoostInterceptionTime = 6.0; --When the intercept time falls below this value,'BoostThrust' is added to missile thrust, useful for Thumpers.
BoostThrustMultiplier = 15; --Value multiplied to missile thrust once within boost range.

--Check angle to intercept variables
InterceptionTurnAngleTollerance = 5; --Added tollerance when calculating whether to steer away from target as interception is deemed currently impossible due to too steep an angle.

--Cruising variables
BaseDirectEngagementGroundRange = 240; --Below this ground range to target, head directly to target.
DirectEngagementGroundRangeSpeedMultipler = 0.8; --Added onto the engagement range after it has been multiplied by the target speed, used for fast targets.
CruisingAltitude = -180; --While en route travel at this altitude.
CruisingAltitudeAboveTerrain = 30; --If terrain nears cruising altitude, travel this heigh above the terrain.
MaxAllowedCruisingAltitude = -5; --Missile will try and aviod going above this altitude
MinAllowedCruisingAltitude = -5000; --Missile will try and aviod going below this altitude

--SeaDive variables
GroundRangeToTargetToSeaDive = -10;--Below this ground range to target, start diving underwater for explosives buff.
MaxTargetHeightForSeaDive = 0; --Max height of enemy aimpoint above the water to use seadiving on.
AdditionalSeaDiveDepth = 0; --Additional depth added to enemy aimpoint when seadriving.

--Anti ally collsion variables
AntiAlliedCollisionPredictionTimeLimit = 8; --Used to prevent missile-allied vessel collisions, number is seconds into the future predicted.
AntiAlliedCollisionPredictionTimeStep = 1; --The time step in seconds used to prevent missile-allied vessel collisions.
AntiAlliedCollisionAdditionalSafetyRange = 5; --Additional range to border of allies to avoid.

--End of User Config Variables

Short range direct engagement frag missile
Quote:--User Config Variables

--Launcher vehicle variables
MainFrameID = 0; --Which MainFrame to connect to
UseWeaponsSlots = false;
--If 'true' will use all weapons control blocks using the weapons slot of the variable 'WeaponID'
--If 'false' will use the weapons control block with the ID of the variable 'WeaponID'
WeaponID = 0;
MaxDistanceBetweenLuaTranscieverAndMissileControl = 10; --The maximum distnace between a lua transciever and its corrisponding missile control block.

--Missile variables
MissileInterceptor = false; --Set true if using being used for missile interception
TargetDetonationRange = 10; --If the distance between target and missile is below this value, blow up.

--Target acquisition variables
MultiTarget = true;
MaxRange = 2000; --Targets above this range from the missile launcher will be ignored.
MaxTargetHeight = 10000; --Targets above this height will be ignored.
MinTargetHeight = -20; --Targets below this range will be ignored.

--Safe detonation variables
SafeDetonteAltitude = 400; --If there are no target, goto and detonte at this altitude.
DetonateMissileUponEmptyFuel = true; --If the missile has run out of fuel, detonate?

--Missile boost variables
UseFuelDefinedThrustControl = false;
--If true: Uses the predicted time to intercept and the amount of remaining fuel to calculate thrust value. More adaptable to different ranges.
--If false: Uses the 'BaseMissileThrust' added to the target speed multiplied by 'MissileThrustTargetSpeedMultiplier' to calculate thrust.
--In both: If target is below 'BoostInterceptionTime' then thrust is multiplied by 'BoostThrustMultiplier'
BaseMissileThrust = 750; --Base thrust for missile.
MissileThrustTargetSpeedMultiplier = 10.0; --Value is multiplied by target's speed then added to base thrust of missile, useful for fast targets.
BoostInterceptionTime = 5.0; --When the intercept time falls below this value,'BoostThrust' is added to missile thrust, useful for Thumpers.
BoostThrustMultiplier = 15; --Value multiplied to missile thrust once within boost range.

--Check angle to intercept variables
InterceptionTurnAngleTollerance = 5; --Added tollerance when calculating whether to steer away from target as interception is deemed currently impossible due to too steep an angle.

--Cruising variables
BaseDirectEngagementGroundRange = 2000; --Below this ground range to target, head directly to target.
DirectEngagementGroundRangeSpeedMultipler = 0.6; --Added onto the engagement range after it has been multiplied by the target speed, used for fast targets.
CruisingAltitude = 250; --While en route travel at this altitude.
CruisingAltitudeAboveTerrain = 30; --If terrain nears cruising altitude, travel this heigh above the terrain.
MaxAllowedCruisingAltitude = 10000; --Missile will try and aviod going above this altitude
MinAllowedCruisingAltitude = 10; --Missile will try and aviod going below this altitude

--SeaDive variables
GroundRangeToTargetToSeaDive = -10;--Below this ground range to target, start diving underwater for explosives buff.
MaxTargetHeightForSeaDive = 5; --Max height of enemy aimpoint above the water to use seadiving on.
AdditionalSeaDiveDepth = 5; --Additional depth added to enemy aimpoint when seadriving.

--Anti ally collsion variables
AntiAlliedCollisionPredictionTimeLimit = 8; --Used to prevent missile-allied vessel collisions, number is seconds into the future predicted.
AntiAlliedCollisionPredictionTimeStep = 1; --The time step in seconds used to prevent missile-allied vessel collisions.
AntiAlliedCollisionAdditionalSafetyRange = 5; --Additional range to border of allies to avoid.

--End of User Config Variables

Long range sea skimming/diving missile :
Quote:--User Config Variables

--Launcher vehicle variables
MainFrameID = 0; --Which MainFrame to connect to
UseWeaponsSlots = false;
--If 'true' will use all weapons control blocks using the weapons slot of the variable 'WeaponID'
--If 'false' will use the weapons control block with the ID of the variable 'WeaponID'
WeaponID = 0;
MaxDistanceBetweenLuaTranscieverAndMissileControl = 10; --The maximum distnace between a lua transciever and its corrisponding missile control block.

--Missile variables
MissileInterceptor = false; --Set true if using being used for missile interception
TargetDetonationRange = -10; --If the distance between target and missile is below this value, blow up.

--Target acquisition variables
MultiTarget = true;
MaxRange = 4000; --Targets above this range from the missile launcher will be ignored.
MaxTargetHeight = 10000; --Targets above this height will be ignored.
MinTargetHeight = -20; --Targets below this range will be ignored.

--Safe detonation variables
SafeDetonteAltitude = 500; --If there are no target, goto and detonte at this altitude.
DetonateMissileUponEmptyFuel = true; --If the missile has run out of fuel, detonate?

--Missile boost variables
UseFuelDefinedThrustControl = false;
--If true: Uses the predicted time to intercept and the amount of remaining fuel to calculate thrust value. More adaptable to different ranges.
--If false: Uses the 'BaseMissileThrust' added to the target speed multiplied by 'MissileThrustTargetSpeedMultiplier' to calculate thrust.
--In both: If target is below 'BoostInterceptionTime' then thrust is multiplied by 'BoostThrustMultiplier'
BaseMissileThrust = 500; --Base thrust for missile.
MissileThrustTargetSpeedMultiplier = 10.0; --Value is multiplied by target's speed then added to base thrust of missile, useful for fast targets.
BoostInterceptionTime = 6.0; --When the intercept time falls below this value,'BoostThrust' is added to missile thrust, useful for Thumpers.
BoostThrustMultiplier = 15; --Value multiplied to missile thrust once within boost range.

--Check angle to intercept variables
InterceptionTurnAngleTollerance = 5; --Added tollerance when calculating whether to steer away from target as interception is deemed currently impossible due to too steep an angle.

--Cruising variables
BaseDirectEngagementGroundRange = 240; --Below this ground range to target, head directly to target.
DirectEngagementGroundRangeSpeedMultipler = 0.6; --Added onto the engagement range after it has been multiplied by the target speed, used for fast targets.
CruisingAltitude = 15; --While en route travel at this altitude.
CruisingAltitudeAboveTerrain = 30; --If terrain nears cruising altitude, travel this heigh above the terrain.
MaxAllowedCruisingAltitude = 10000; --Missile will try and aviod going above this altitude
MinAllowedCruisingAltitude = 5; --Missile will try and aviod going below this altitude

--SeaDive variables
GroundRangeToTargetToSeaDive = 200;--Below this ground range to target, start diving underwater for explosives buff.
MaxTargetHeightForSeaDive = 5; --Max height of enemy aimpoint above the water to use seadiving on.
AdditionalSeaDiveDepth = 5; --Additional depth added to enemy aimpoint when seadriving.

--Anti ally collsion variables
AntiAlliedCollisionPredictionTimeLimit = 8; --Used to prevent missile-allied vessel collisions, number is seconds into the future predicted.
AntiAlliedCollisionPredictionTimeStep = 1; --The time step in seconds used to prevent missile-allied vessel collisions.
AntiAlliedCollisionAdditionalSafetyRange = 5; --Additional range to border of allies to avoid.

--End of User Config Variables

Short range direct engagement missile interceptor
Quote:--User Config Variables

--Launcher vehicle variables
MainFrameID = 0; --Which MainFrame to connect to
UseWeaponsSlots = false;
--If 'true' will use all weapons control blocks using the weapons slot of the variable 'WeaponID'
--If 'false' will use the weapons control block with the ID of the variable 'WeaponID'
WeaponID = 0;
MaxDistanceBetweenLuaTranscieverAndMissileControl = 10; --The maximum distnace between a lua transciever and its corrisponding missile control block.

--Missile variables
MissileInterceptor = true; --Set true if using being used for missile interception
TargetDetonationRange = 4; --If the distance between target and missile is below this value, blow up.

--Target acquisition variables
MultiTarget = true;
MaxRange = 2000; --Targets above this range from the missile launcher will be ignored.
MaxTargetHeight = 10000; --Targets above this height will be ignored.
MinTargetHeight = -20; --Targets below this range will be ignored.

--Safe detonation variables
SafeDetonteAltitude = 1000; --If there are no target, goto and detonte at this altitude.
DetonateMissileUponEmptyFuel = true; --If the missile has run out of fuel, detonate?

--Missile boost variables
UseFuelDefinedThrustControl = false;
--If true: Uses the predicted time to intercept and the amount of remaining fuel to calculate thrust value. More adaptable to different ranges.
--If false: Uses the 'BaseMissileThrust' added to the target speed multiplied by 'MissileThrustTargetSpeedMultiplier' to calculate thrust.
--In both: If target is below 'BoostInterceptionTime' then thrust is multiplied by 'BoostThrustMultiplier'
BaseMissileThrust = 600; --Base thrust for missile.
MissileThrustTargetSpeedMultiplier = 10.0; --Value is multiplied by target's speed then added to base thrust of missile, useful for fast targets.
BoostInterceptionTime = 8.0; --When the intercept time falls below this value,'BoostThrust' is added to missile thrust, useful for Thumpers.
BoostThrustMultiplier = 1; --Value multiplied to missile thrust once within boost range.

--Check angle to intercept variables
InterceptionTurnAngleTollerance = 5; --Added tollerance when calculating whether to steer away from target as interception is deemed currently impossible due to too steep an angle.

--Cruising variables
BaseDirectEngagementGroundRange = 2000; --Below this ground range to target, head directly to target.
DirectEngagementGroundRangeSpeedMultipler = 0.6; --Added onto the engagement range after it has been multiplied by the target speed, used for fast targets.
CruisingAltitude = 250; --While en route travel at this altitude.
CruisingAltitudeAboveTerrain = 30; --If terrain nears cruising altitude, travel this heigh above the terrain.
MaxAllowedCruisingAltitude = 10000; --Missile will try and aviod going above this altitude
MinAllowedCruisingAltitude = 10; --Missile will try and aviod going below this altitude

--SeaDive variables
GroundRangeToTargetToSeaDive = -10;--Below this ground range to target, start diving underwater for explosives buff.
MaxTargetHeightForSeaDive = 5; --Max height of enemy aimpoint above the water to use seadiving on.
AdditionalSeaDiveDepth = 5; --Additional depth added to enemy aimpoint when seadriving.

--Anti ally collsion variables
AntiAlliedCollisionPredictionTimeLimit = 8; --Used to prevent missile-allied vessel collisions, number is seconds into the future predicted.
AntiAlliedCollisionPredictionTimeStep = 1; --The time step in seconds used to prevent missile-allied vessel collisions.
AntiAlliedCollisionAdditionalSafetyRange = 5; --Additional range to border of allies to avoid.

--End of User Config Variables

Please report any bugs or problems and feel free to give suggestions for further features.
I consider my ambassadors to be the best in the world, they always seem to come to a successful resolution, I just wish they could learn to use a few less missiles on passing seagulls.
Reply

#2
Just a reminder, I do check this post every few days, so if you do have an idea, or you have found a bug please do comment, it won't be long till I see it.
I consider my ambassadors to be the best in the world, they always seem to come to a successful resolution, I just wish they could learn to use a few less missiles on passing seagulls.
Reply

#3
So I tried your code out, and it worked really well... for the first salvo. After that I get constant "Controller holding fire due to failsafe". No idea what is causing it.
Reply

#4
(2017-03-26, 02:28 PM)Wraith Wrote: So I tried your code out, and it worked really well... for the first salvo. After that I get constant "Controller holding fire due to failsafe". No idea what is causing it.
Well since my code doesn't actually fire the missiles, it just aims them in-flight, I don't think it's a problem with the code. If the game is working properly you should only be getting that message if the missile gauntry is pointing at a part of your own vehicle.
If this isn't the cause could you please give me some more information, just so I can confirm it isn't my code...and if it somehow is, I can get to work debugging the issue.
Thanks for the feedback, I hope we can solve this issue quickly.
I consider my ambassadors to be the best in the world, they always seem to come to a successful resolution, I just wish they could learn to use a few less missiles on passing seagulls.
Reply

#5
Still playing around with it... wasn't working for the most part but then I found a bug in the code that you might want to update.
On this line:

if NegativeAviodCoOrdinates.y < MinAllowedCruisingAltitude then
AimPoint.y = MinAllowedCruisingAltitude.y;

Since MinAllowedCruisingAltitude isn't an object, just a flat value it won't have a .y so it should be
if NegativeAviodCoOrdinates.y < MinAllowedCruisingAltitude then
AimPoint.y = MinAllowedCruisingAltitude;

So far it aimed well from your test base, but I'm still playing around with it in other ships.

found another one:

for n=0, NumTargets-1 do
Target = I:GetTargetInfo(MainFrameID,TargetIDList[n]);
if TargetVelocityArray[TargetIDList[n]] ~= nil then
TargetAcceleration[n] = (Target.Velocity - TargetVelocityArray[TargetIDList[n]]) / (I:GetTime() - PreviousTimeForTargets);
else
TargetAcceleration[n] = Vector3(0,0,0);
end
TargetVelocityArray[TargetIDList[n]] = Target.Velocity;
end

recommended to change to:

for n=0, NumTargets-1 do
Target = I:GetTargetInfo(MainFrameID,TargetIDList[n]);
if TargetVelocityArray[TargetIDList[n]] ~= nil then
TargetAcceleration[n] = (Target.Velocity - TargetVelocityArray[TargetIDList[n]]) / (I:GetTime() - PreviousTimeForTargets);
TargetVelocityArray[TargetIDList[n]] = Target.Velocity;
else
TargetAcceleration[n] = Vector3(0,0,0);
end
end

reason: it is possible to assign a nil value to = Target.Velocity; which halts the code Sad
Reply

#6
Thanks for the help evilebob, if i'm being honest I didn't put that much effort into this code.

Once again thanks for the help.
I consider my ambassadors to be the best in the world, they always seem to come to a successful resolution, I just wish they could learn to use a few less missiles on passing seagulls.
Reply

#7
I would like to use this code for thumper missiles, could you add an opinion to increase or decrease thrust at certain ranges from the enemy? I would like 100% thrust before my missiles hit, it would also be nice to have an opinion to make the missiles fly straight at the enemy like default missiles do (still with avoidance and stuff). Some of these things may already be in the code, I do just not know how to use it. Btw, do atheist missiles fly straight for the enemy mainframe?
Reply

#8
Wink 
Hey Aleksander,

First, in terms of missile thrust, really good idea, can't believe I didn't think of it...however, after some testing, the current games API doesn't let you change the missile thrust in any way...

In terms of directly aiming at the enemy however,
Just change the value on line 26:
BaseDirectEngagementGroundRange = 240;

To beyond the max range of your missile, something like 5000, should mean that the missile will head directly towards the target while still avoiding allied constructs. But this will mean the ground aviodance won't work properally, if thats what you want, just ask as I do have alot of spare time at the moment.

In terms of does it aim for the mainframe?
Yes, sort of. The code uses the position provided from you're mainframe, which gives the position of the enemy mainframe +/- error from the sensors...

Anyway if you have any further questions, feel free to ask.


(2017-07-28, 04:12 PM)Aleksander Wit Wrote: I would like to use this code for thumper missiles, could you add an opinion to increase or decrease thrust at certain ranges from the enemy? I would like 100% thrust before my missiles hit, it would also be nice to have an opinion to make the missiles fly straight at the enemy like default missiles do (still with avoidance and stuff). Some of these things may already be in the code, I do just not know how to use it. Btw, do atheist missiles fly straight for the enemy mainframe?
I consider my ambassadors to be the best in the world, they always seem to come to a successful resolution, I just wish they could learn to use a few less missiles on passing seagulls.
Reply

#9
I think i have heard of missile thrust editing lua?... I am just saying that it could make thumper missiles usable if it get huge speed the last 0.5 sec before it hits. Mabye Nick got an idea on how to do it?
Reply

#10
You could mabye also make the LUA able to target different blocks like firing pieces or detection equipment! It could be very good to have.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)