??GreenWithEnvy?? Continuation: Seeking Rockets Other Then Players?

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

FrAgEdFragEd

New Member
Mar 4, 2002
5
0
0
Not worth seeing
Will this work? If I have a seeking projectile, and I want to set a condition for the projectile to meet in order for it to seek its enemy. I used the find inventoy for jd cause I know the player will have this item in their inventory. This is what I have so fare... the part in question will be the area located between the equal signs labeled HELP.

============
Example: HELP
============

//=======================
//GreenWithEnvy Projectile
//========================

class GreenWithEnvy expands HRAntiSLV config (SLV6);


var() config float GreenWithEnvy;
var Actor Seeking;
var vector InitialDir;

replication
{
// Relationships.

reliable if( Role==ROLE_Authority )
Seeking, InitialDir;
}

simulated function PostBeginPlay() {

speed = GreenWithEnvy;
SetTimer(0.3,false);
Super.PostBeginPlay();
Seeking = None;
Velocity = Speed * vector(Rotation);
SetTimer(0.5,true); //How fare it will travel before it breaks up into severial projectiles
}
simulated function timer() {
local vector x,y,z;
local float bestDist, bestAim, Dist;
local vector SeekingDir;
local float MagnitudeVel;
local Pawn Player;
local vector start;
local actor other;
local Inventory jb;

//===============================
//HELP HELP HELP

jb = Pawn(owner)enemy.findInventoryType(class'UT_JumpBoots');
if (jb == none) {
return;
else if (jb != none) {
seeking = true;

// HELP HELP
//=================================

If (Seeking==None) {

bestAim = 0.85;//0.93
seeking = instigator.PickTarget(bestAim, bestDist, Normal(Velocity), Location);

}
If (Seeking != None && Seeking != Instigator) {
SeekingDir = Normal(Seeking.Location - Location);
MagnitudeVel = VSize(Velocity);
Velocity = MagnitudeVel * Normal(SeekingDir * 1.5 * MagnitudeVel + Velocity);

GetAxes(rotation,x,y,z);
x.x+=0.15*(0.5-frand()); // x.y+=0.7*(0.5-frand());
x.y+=0.15*(0.5-frand()); // x.z+=0.7*(0.5-frand());
x.z+=0.15*(0.5-frand());
SetRotation(rotator(x));
Velocity = Speed * vector(Rotation);


}

}
}
}

singular function TakeDamage( int NDamage, Pawn instigatedBy, Vector hitlocation,
vector momentum, name damageType )
{

if ( NDamage > 5 )
{
spawn(class'Botpack.BlastMark', self);
HurtRadius(Damage,80.0, MyDamageType, MomentumTransfer, HitLocation );
// PlaySound(Sound'Botpack.PulseExp',,0.5+FRand()); //6.0);
RemoteRole = ROLE_SimulatedProxy;
Destroy();

if ( NDamage <= 5 )
PlaySound(Sound'Botpack.PulseExp',,0.5+FRand()); //6.0);
// spawn(class'SLV6.DscarV3', self);
RemoteRole = ROLE_SimulatedProxy;
Destroy();

}
}

auto state Flying
{
simulated function ZoneChange( Zoneinfo NewZone )
{
local waterring w;

if ( NewZone.bWaterZone != Region.Zone.bWaterZone )
{
w = Spawn(class'WaterRing',,,,rot(16384,0,0));
w.DrawScale = 0.5;
w.RemoteRole = ROLE_None;
}
}
function ProcessTouch (Actor Other, vector HitLocation)
{
If ( (Other!=Instigator) && (Other.CollisionRadius > 0))
Explode(HitLocation,Normal(HitLocation-Other.Location));

}
function Explode(vector HitLocation, vector HitNormal)
{
local vector start;
if ( Role < ROLE_Authority )
return;

HurtRadius(Damage,193.0, MyDamageType, MomentumTransfer, HitLocation );
start = Location + 5 * HitNormal; //5
Spawn(class'SpriteGreenE',,, HitLocation+HitNormal*4,rotator(HitNormal));

Spawn(class'PuffSmokeGrnV3',,, HitLocation+HitNormal*4,rotator(HitNormal));
PlaySound(Sound'Botpack.PulseExp',,0.50+FRand()); //6.0);
RemoteRole = ROLE_SimulatedProxy;
Destroy();
}

function BeginState()
{
local vector InitialDir;
initialDir = vector(Rotation);
if ( Role == ROLE_Authority )
Velocity = speed*initialDir;
Acceleration = initialDir*50;
}
}
// the end

Can somebody show me the light? If this would work, then how would I set the condition that a player most have jd (ut_jumpboots) for the projectile to seek. If the player does not have the jd (ut_jumpboots) then the return should stop the projectile from seeking or reading the restof the script????
Is this correct?

Thank you for your time

AkA FrAgEd
Server
---===MorTaliTy===---
 

LedZep

k last title kinda gay :p
well, i only looked at the help area but you can't assign a 'True' value to an actor reference variable (seeking). if you want the projectile to seek only an enemy who has jump boots you can do that (oh and shouldn't there be a dot before Enemy?):

jb = Pawn(owner).enemy.findInventoryType(class'UT_JumpBoots');
if (jb == none) {
seeking = none;
else if (jb != none) {
seeking = pawn(owner).enemy;

this should work if i got your question right.