Hi all,
I'm trying to implement Seeking projectiles that seek specific classes (initially my customized extension of the UTProj_ShockBall class) and wanted to see if anyone could offer advice on my current direction or any suggestions on a better way to go about this.
My goal is to have the seeking projectile (extended from UTProj_SeekingRockt.uc) home-in on a slow-moving or stationary ShockBall, and orbit the projectile without colliding (turning off collision/explosion). I have already set all projectiles to bounce off static meshes so the projectiles will persist until the user calls a destroy exec function (an iterator call across AllActors calling Explode on UTProjectiles).
Currently I have a rudimentary seeking solution working where the SeekingRocket immediately targets the most recent ShockBall fired and tracks it until it passes through the object. At that point, it usually takes on the direction from the ShockBall and no longer tries to seek, though occasionally it will sharply cut back and forth once or twice before giving up and heading out to pasture.
In my custom OSCWeap_RocketLauncher_Content.uc, I use CanLockOnTo to set the LockedTarget:
And set my custom SeekingRocket class to be fired in defaultproperties:
SeekingRocketClass=class'OSCProj_SeekingRocket'
So far so good.
In my custom SeekingRocket class, I implement setSeekTarget() to choose a ShockBall to seek (brute force for now, but its working at least):
I then call setSeekTarget() in PostBeginPlay() for the SeekingRocket.
Does this seem like a correct way to go about modding the seeking behavior of UDK projectiles? I've been unable to find any good descriptions of how this is really implemented. I'm willing to work out the vector math required to update rocket position per tick but it seemed like this behavior might already be in the core UDK engine.
Any help would be fantastic, thanks in advance.
(I'll reformat the code blocks above when I figure out how
)
* EDIT - reformatted code blocks with code tag
================================================== =
For more info about my project in general:
http://forums.epicgames.com/showthre...1#post27580921
I'm trying to implement Seeking projectiles that seek specific classes (initially my customized extension of the UTProj_ShockBall class) and wanted to see if anyone could offer advice on my current direction or any suggestions on a better way to go about this.
My goal is to have the seeking projectile (extended from UTProj_SeekingRockt.uc) home-in on a slow-moving or stationary ShockBall, and orbit the projectile without colliding (turning off collision/explosion). I have already set all projectiles to bounce off static meshes so the projectiles will persist until the user calls a destroy exec function (an iterator call across AllActors calling Explode on UTProjectiles).
Currently I have a rudimentary seeking solution working where the SeekingRocket immediately targets the most recent ShockBall fired and tracks it until it passes through the object. At that point, it usually takes on the direction from the ShockBall and no longer tries to seek, though occasionally it will sharply cut back and forth once or twice before giving up and heading out to pasture.
In my custom OSCWeap_RocketLauncher_Content.uc, I use CanLockOnTo to set the LockedTarget:
Code:
simulated function bool CanLockOnTo(Actor TA) { if(TA.class == class'OSCProj_ShockBall') { `log("Locked on: "$LockedTarget$" with current: "$TA); return true; } else { return false; } }
SeekingRocketClass=class'OSCProj_SeekingRocket'
So far so good.
In my custom SeekingRocket class, I implement setSeekTarget() to choose a ShockBall to seek (brute force for now, but its working at least):
Code:
function setSeekTarget(){ /** Currently tracked target - if set, projectile will seek it */ local OSCProj_ShockBall P; ForEach AllActors(class'OSCProj_ShockBall',P) { if(FastTrace(P.Location,Location)) { SeekTarget = P; } } }
I then call setSeekTarget() in PostBeginPlay() for the SeekingRocket.
Does this seem like a correct way to go about modding the seeking behavior of UDK projectiles? I've been unable to find any good descriptions of how this is really implemented. I'm willing to work out the vector math required to update rocket position per tick but it seemed like this behavior might already be in the core UDK engine.
Any help would be fantastic, thanks in advance.
(I'll reformat the code blocks above when I figure out how

* EDIT - reformatted code blocks with code tag
================================================== =
For more info about my project in general:
http://forums.epicgames.com/showthre...1#post27580921
Comment