I need some help with my mutator

  • 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.
Status
Not open for further replies.

[GDC]Faust

Goblin Hunter
Apr 29, 2004
314
0
0
40
www.gamersdungeon.de
I'm writing a little Mutator here where I add a Laserpointer to certain classes which tells Rocketturrets and unlogged homingmissiles where to shoot at.

The Rocketturret part is done (See picture) but I still have some issues with the homing-thingy (I actually thought that 1 would be the easy part :( )

The thing is, I everytime the Laserpointer hits something, it creates an actor there. Now my problem is, I don't get the missiles spotting that actor! I tried mith the GetNamedActor-function from the gameutil class, but somehow...

I really don't know what to do? Can somebody pls help me?
 

Attachments

  • Shot00080.jpg
    Shot00080.jpg
    39.5 KB · Views: 60
  • LaserPointer.zip
    16.7 KB · Views: 6
Last edited:

[GDC]Faust

Goblin Hunter
Apr 29, 2004
314
0
0
40
www.gamersdungeon.de
k, I see your point here :)

Ok, in the Mutator-class I gave the gunner a modified Rocketlauncher and the LaserPointer:

Code:
function ModifyPlayer(Pawn Other)
{
	Other.GiveWeapon("LaserPointer.PointerRifle");
if(Other.IsA('Gunner')
{
	Other.GiveWeapon("LaserPointer.LaserRocketLauncher");
}

	if ( NextMutator != None )
		NextMutator.ModifyPlayer(Other);

}

Of course, after taking the old Rocketlauncher away :)

Code:
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)

{   
   if(Other.IsA('RocketLauncher'))
	return false;
  

   Return True;
}

So far, so good. Because the Checkreplacement-function removes all sub-classes also, I had to copy all the code from the RocketLauncher-class into a new one, just to modify this line:

Code:
ProjectileClass(1)=Class'LaserPointer.LaserRocketProjectileAlt'

Now, we come to the tricky part: letting the Missile know there's an actor where the Laserpointer is pointing at. I modified the Timer-function in order to achieve this:

Code:
class LaserRocketProjectileAlt extends RocketProjectileAlt;



function Timer()
{
	local LaserRocketProjectileDrunken RD;
	local RocketProjectileSeeking RS;
	local Actor DummySE;
	local vector OffsetDir;

	if( PaintedTargets[i]!=None )
	{
		RS = Spawn( class'RocketProjectileSeeking', Owner,, Location, Rotation );
		RS.Index=i;
		RS.SetTarget(PaintedTargets[i]);
	}
	else
	{
		switch(i)
		{
		case 0: OffsetDir.X=1.0; OffsetDir.Y= SpreadOffset; OffsetDir.Z= SpreadOffset; break;
		case 1: OffsetDir.X=1.0; OffsetDir.Y=-SpreadOffset; OffsetDir.Z= SpreadOffset; break;
		case 2: OffsetDir.X=1.0; OffsetDir.Y=-SpreadOffset; OffsetDir.Z=-SpreadOffset; break;
		case 3: OffsetDir.X=1.0; OffsetDir.Y= SpreadOffset; OffsetDir.Z=-SpreadOffset; break;
		}

	       If(!DummySE) //the actor created at the pointer's destination
		DummySE = class'UtilGame'.static.GetNamedActor(Instigator, 'LaserDummy'); //the function I thought would recognise this actor

		else
			DummySE = None;
		
		RD = Spawn( class'LaserPointer.LaserRocketProjectileDrunken', Owner,, Location, rotator(OffsetDir >> Rotation) );
		RD.Index=i;
		if(DummySE?)
					{
					RS = Spawn( class'RocketProjectileSeeking', Owner,, Location, Rotation );
					RS.Index=i;
					RS.SetTarget(DummySE);
					}
		RD.SetupData();
		RD.SetCorrectLocation();
	}

	if (++i < ArrayCount(PaintedTargets))
		SetTimer( 0.12, false );
}

defaultproperties
{
	
	SpreadOffset=0.040000
	Speed=250.000000
	MaxSpeed=250.000000
	Physics=PHYS_Falling
	DrawType=DT_StaticMesh
	StaticMesh=StaticMesh'343M.Projectiles.Rocket_Shell'
	LifeSpan=15.000000
	AmbientGlow=96
	bCollideActors=False
	bBounce=True
}

Unfortunately, that doesn't work. I am such a noob. :( Help me...
 

[GDC]Faust

Goblin Hunter
Apr 29, 2004
314
0
0
40
www.gamersdungeon.de
Oh, I forgot to ad the LaserRocketProjectileDrunken-Class (Man those names are gettin' longer and longer...) but it's not necessary in my opinion, since I only added the SetTarget function from the RocketProjectileSeeking-Class and took over some things from the tick-function there so that the drunken missiles could seek for the LaserDummy (Y'know, the thing that's created at the end of the beam).

I'm working on this class later on, when I get the Missile to recognise the Dummy (What's my main concern right now)
 

iCQ

Softice/MASM reverse engineer
Dec 29, 2003
327
0
16
52
The Netherlands
www.6000068.tk
[GDC]Faust said:
Hm it works now :) I still need some further coding though.... I wonder if it works online...

I like ur work ;) but no clue what this would be good for (nor what makes u do it)

And sorry, i dun have the time/experiance to quickly/effeciently help you

If it works online? U know that ;)
(if u can find a server which runs ur mut)
 
Last edited:

[GDC]Faust

Goblin Hunter
Apr 29, 2004
314
0
0
40
www.gamersdungeon.de
iCQ said:
I like ur work ;) but no clue what this would be good for (nor what makes u do it)

I heard in tribes 2 there's such a Pointer, where you can use your Turrets and Mortarfusions (WTF is that btw? I don't know Tribes 2) as a long-range-weapon.

In general I'm teaching myself some Unrealscript with those mutators, and the SmartMines run by default now on our GDC-Server ;) (Though I don't think our Admins would run this one, ok for testing well :))

What makes me do this? Hell, coding is fun! At least in my eyes...

Y'know, it's all part of a big project for XMP i'm running right now ;)
 

iCQ

Softice/MASM reverse engineer
Dec 29, 2003
327
0
16
52
The Netherlands
www.6000068.tk
OOOHHHH yeah yeah yeah!!!!

DAMNIT i knew it u were onto some TOTALLY COOL!

OH MAN I LOVE THAT! And u should check the go'ol tribes someday (if u have the time).

U trying to make (making) a spotter thingy as like in for example Battlefield Desert combat; a sniper spots a target then someone can use a mortar or a nuke or whatever from the base to bombard that spot from long range...

WAY COOL!

Sorry for a second i thought u were into dev some kind of aim aid... sorry i should have know better (hence your name)...
 
Status
Not open for further replies.