1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. 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.

I need some help with my mutator

Discussion in 'Unreal 2' started by [GDC]Faust, May 5, 2004.

Thread Status:
Not open for further replies.
  1. [GDC]Faust

    [GDC]Faust Goblin Hunter

    Joined:
    Apr 29, 2004
    Messages:
    314
    Likes Received:
    0
    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?
     

    Attached Files:

    Last edited: May 7, 2004
  2. IndianPsycho

    IndianPsycho Registered user

    Joined:
    Feb 17, 2004
    Messages:
    570
    Likes Received:
    0
    Some code would be nice. Solving coding problems without seeing the actual code is hard...
     
  3. [GDC]Faust

    [GDC]Faust Goblin Hunter

    Joined:
    Apr 29, 2004
    Messages:
    314
    Likes Received:
    0
    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...
     
  4. [GDC]Faust

    [GDC]Faust Goblin Hunter

    Joined:
    Apr 29, 2004
    Messages:
    314
    Likes Received:
    0
    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)
     
  5. [GDC]Faust

    [GDC]Faust Goblin Hunter

    Joined:
    Apr 29, 2004
    Messages:
    314
    Likes Received:
    0
    Hm it works now :) I still need some further coding though.... I wonder if it works online...
     
  6. iCQ

    iCQ Softice/MASM reverse engineer

    Joined:
    Dec 29, 2003
    Messages:
    326
    Likes Received:
    0
    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: May 5, 2004
  7. [GDC]Faust

    [GDC]Faust Goblin Hunter

    Joined:
    Apr 29, 2004
    Messages:
    314
    Likes Received:
    0
    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 ;)
     
  8. iCQ

    iCQ Softice/MASM reverse engineer

    Joined:
    Dec 29, 2003
    Messages:
    326
    Likes Received:
    0
    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)...
     
  9. [GDC]Faust

    [GDC]Faust Goblin Hunter

    Joined:
    Apr 29, 2004
    Messages:
    314
    Likes Received:
    0
    Just wanna say: It's finished. If anyone is interested in this Mut, just post here, and I'll load it up as an attachement.
     
  10. iCQ

    iCQ Softice/MASM reverse engineer

    Joined:
    Dec 29, 2003
    Messages:
    326
    Likes Received:
    0
    Please do so (tho i go get it ar ur place ;))

    GJ und aufwiedersehen!
     
  11. [GDC]Faust

    [GDC]Faust Goblin Hunter

    Joined:
    Apr 29, 2004
    Messages:
    314
    Likes Received:
    0
    Achtung!

    I'll post it a bit later, found some things that still needed improvement.
     
  12. iCQ

    iCQ Softice/MASM reverse engineer

    Joined:
    Dec 29, 2003
    Messages:
    326
    Likes Received:
    0
    Jawol!

    Yes... pls dont release it in haste... we got all the time of the world...

    Bis sp├Ąter ;)
     
  13. [GDC]Faust

    [GDC]Faust Goblin Hunter

    Joined:
    Apr 29, 2004
    Messages:
    314
    Likes Received:
    0
    Oh, it's added.
     
  14. iCQ

    iCQ Softice/MASM reverse engineer

    Joined:
    Dec 29, 2003
    Messages:
    326
    Likes Received:
    0
    Roger that! (i'll check it in a day or so)
     
Thread Status:
Not open for further replies.

Share This Page