Login  Register
 



Post new topicReply to topic
 
Author Message
 PostPosted: 20 Jun, 2012 
 

Joined: 16 Jun, 2012
Posts: 11
Offline
1. What is the most reliable way to control missile trajectories? For example I want to be able to fire high altitude, long range bombardment missiles as well as ocean hugging anti ship missiles. I've had some moderate success modifying the missile projectile .bp and .script but it never really achieves what I want to do. Does anyone have any pointers?

2. Speaking of Hugging terrain, is there any way for low altitude cruise missiles to "hug" land terrain like fast aircraft so they can also target land? Because a cruise missile(s) streaking down a valley from a cruiser off the coast would be pretty epic but if I make it a low altitude missile it simply just impacts the land the moment there's elevation c hange.

3. Inaccuracy: Is there any way for homing missiles ("TrackTargetsGround = false" method for homing... which is rather counter-intuitive really) to have some inaccuracy in its detonation point? I think Aeon Serpentine tacs somewhat do this due to its sway but that just looks silly. Is there a way to accomplish this? Would it work for non-homing missiles? I am trying to make some rocket/missile aircraft that track ground targets but giving them perfect accuracy would require a significant numbers nerf, and since one of the goals of the mod is slightly more realistic damage, I don't want it to take 5 "heavy" missiles to kill a tank. 2 shot down by PD, 2 miss by enough to avoid splash, 1 direct hit for kill would be much more preferable.

Thanks for any advice you guys have ^^


Top
 Profile  
 PostPosted: 21 Jun, 2012 
 

Joined: 05 Oct, 2007
Posts: 16425
Location: camping near the biggest power-up
Offline
darchseraph wrote:
1. What is the most reliable way to control missile trajectories? For example I want to be able to fire high altitude, long range bombardment missiles as well as ocean hugging anti ship missiles. I've had some moderate success modifying the missile projectile .bp and .script but it never really achieves what I want to do. Does anyone have any pointers?

It would be best done with two different weapons, each firing a different missile.

The Sky Slammer is a really good example of this.

darchseraph wrote:
2. Speaking of Hugging terrain, is there any way for low altitude cruise missiles to "hug" land terrain like fast aircraft so they can also target land? Because a cruise missile(s) streaking down a valley from a cruiser off the coast would be pretty epic but if I make it a low altitude missile it simply just impacts the land the moment there's elevation c hange.

As far as I know, the only thing that can hug terrain is an aircraft. If you were up to the challenge, you could create a temporary, invisible, aircraft, and glue the missile to it (perfectly possible, to my knowledge). Then instruct the aircraft to fly to the destination, and detach the missile at the point you want it to stop terrain hugging.

darchseraph wrote:
3. Inaccuracy: Is there any way for homing missiles ("TrackTargetsGround = false" method for homing... which is rather counter-intuitive really) to have some inaccuracy in its detonation point? I think Aeon Serpentine tacs somewhat do this due to its sway but that just looks silly. Is there a way to accomplish this? Would it work for non-homing missiles? I am trying to make some rocket/missile aircraft that track ground targets but giving them perfect accuracy would require a significant numbers nerf, and since one of the goals of the mod is slightly more realistic damage, I don't want it to take 5 "heavy" missiles to kill a tank. 2 shot down by PD, 2 miss by enough to avoid splash, 1 direct hit for kill would be much more preferable.

Nope, because tracking always tries to home in on the target (or the ground beneath the target). If the target moves, the missile will correct its trajectory. There's no academic difference between homing inaccuracy and the target moving.

At the very best, you could adjust the turn speed way, way, down and fire it like artillery.

_________________
Nephylim wrote:
But, an FA army in an FA environment just looks... right.
help wrote:
Does anyone know how to use air transports? I cant get them to pick up troops.


Top
 Profile  
 PostPosted: 21 Jun, 2012 
 

Joined: 16 Jun, 2012
Posts: 11
Offline
BulletMagnet wrote:
It would be best done with two different weapons, each firing a different missile.

The Sky Slammer is a really good example of this.


So a toggle button might be in order for firing selection? Similarly, would an altitude toggle button work well for things like Aeon Guided Missile?

BulletMagnet wrote:
As far as I know, the only thing that can hug terrain is an aircraft. If you were up to the challenge, you could create a temporary, invisible, aircraft, and glue the missile to it (perfectly possible, to my knowledge). Then instruct the aircraft to fly to the destination, and detach the missile at the point you want it to stop terrain hugging.


Yeah, I figured I'd have to do some invisible aircraft mojo unless I could somehow import kamikaze aircraft behavior like from the mercy into a regular missile.

BulletMagnet wrote:
Nope, because tracking always tries to home in on the target (or the ground beneath the target). If the target moves, the missile will correct its trajectory. There's no academic difference between homing inaccuracy and the target moving.


At the very best, you could adjust the turn speed way, way, down and fire it like artillery.[/quote]

So there is no "fly at elevation X"? It's all just controlled by the script? The documentation and projectile.bp and .script (and .script in general, if you know where I could find a list of functions and definitions for the various .scripts like the supcom wiki explains how weapon.bp works that would be great). Any chance you could take a look at the relevant parts of this Tac missile and roughly explain how it works? Mainly the turn at 90 degrees and seek.


Code:
    Physics = {
        Acceleration = 3,
        DestroyOnWater = true,
        InitialSpeed = 3,
        LifeTime = 30,
        MaxSpeed = 12,
        MaxZigZag = 5,
        RotationalVelocity = 0,
        RotationalVelocityRange = 0,
        TrackTarget = true,
        TrackTargetGround = true,
        TurnRate = 0,
        UseGravity = false,
        VelocityAlign = true,
        ZigZagFrequency = 0.2,
    },


Script:

Code:
AIFMissileTactical01 = Class(AMissileSerpentineProjectile) {

    OnCreate = function(self)
        AMissileSerpentineProjectile.OnCreate(self)
        self:SetCollisionShape('Sphere', 0, 0, 0, 2.0)
        self:ForkThread( self.MovementThread )
    end,

    MovementThread = function(self)       
        self.WaitTime = 0.1
        self:SetTurnRate(8)
        WaitSeconds(0.3)       
        while not self:BeenDestroyed() do
            self:SetTurnRateByDist()
            WaitSeconds(self.WaitTime)
        end
    end,

    SetTurnRateByDist = function(self)
        local dist = self:GetDistanceToTarget()
        #Get the nuke as close to 90 deg as possible
        if dist > 50 then       
            #Freeze the turn rate as to prevent steep angles at long distance targets
            WaitSeconds(2)
            self:SetTurnRate(20)
        elseif dist > 128 and dist <= 213 then
                  # Increase check intervals
                  self:SetTurnRate(30)
                  WaitSeconds(1.5)
            self:SetTurnRate(30)
        elseif dist > 43 and dist <= 107 then
                  # Further increase check intervals
            WaitSeconds(0.3)
            self:SetTurnRate(50)
            elseif dist > 0 and dist <= 43 then
                  # Further increase check intervals           
            self:SetTurnRate(100)   
            KillThread(self.MoveThread)         
        end
    end,       

    GetDistanceToTarget = function(self)
        local tpos = self:GetCurrentTargetPosition()
        local mpos = self:GetPosition()
        local dist = VDist2(mpos[1], mpos[3], tpos[1], tpos[3])
        return dist


Top
 Profile  
 PostPosted: 21 Jun, 2012 
 

Joined: 05 Oct, 2007
Posts: 16425
Location: camping near the biggest power-up
Offline
http://supcom.wikia.com/wiki/LUADOC_1.5.3599

It's grouped by type. Any sort of project (including missiles) will have all the functions in the Sim.Projectile section. Projectile inherits from Entity too, so anything in there will also be available for you to use.

_________________
Nephylim wrote:
But, an FA army in an FA environment just looks... right.
help wrote:
Does anyone know how to use air transports? I cant get them to pick up troops.


Top
 Profile  
 PostPosted: 22 Jun, 2012 
 

Joined: 20 Feb, 2011
Posts: 41
Offline
You can make missileprojectiles to lose livetracking at certain distance to target so they fly to the target but dont update its location if it moves.

This is an example of cybran t3 bombers glide bomd projectile that you can find and test by downloading Diamond Patch Mod
glidebombs script name:
CIFProtonBomb01_script.lua

Code:
local CIFProtonBombProjectile = import('/lua/cybranprojectiles.lua').CIFProtonBombProjectile

CIFProtonBomb01 = Class(CIFProtonBombProjectile) {

    OnCreate = function(self)
        CIFProtonBombProjectile.OnCreate(self)
        self:ForkThread( self.MovementThread )
    end,

    MovementThread = function(self)       
        self.WaitTime = 0
        self:SetTurnRate(30)
        WaitSeconds(0)       
        while not self:BeenDestroyed() do
            self:SetTurnRateByDist()
            WaitSeconds(self.WaitTime)
        end
    end,

    SetTurnRateByDist = function(self)
        local dist = self:GetDistanceToTarget()
        if dist > 50 then       
            WaitSeconds(0)
            self:SetTurnRate(30)
            elseif dist > 0 and dist <= 24 then
            self:SetTurnRate(0)   
            KillThread(self.MoveThread)         
        end
    end,       

    GetDistanceToTarget = function(self)
        local tpos = self:GetCurrentTargetPosition()
        local mpos = self:GetPosition()
        local dist = VDist2(mpos[1], mpos[3], tpos[1], tpos[3])
        return dist
    end,
}

TypeClass = CIFProtonBomb01


As you can see when projectile achieves distance of 24 or less to target it loses its livetracking capability by setting turn rate to 0. This same principle can be used in long range missiles too.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic



Quick Tools

Search for:
Jump to:  

© 2002-2010 Gas Powered Games Corp. All Rights Reserved. Gas Powered Games is the exclusive trademark of Gas Powered Games Corp.
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
 
Home| Games | Company | News & Press | Support
  Terms of Use   |    Copyright Information   |    Privacy Policy