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.

Ut2003 StrangeLove

Discussion in 'Programming' started by CVROY, Feb 5, 2004.

  1. CVROY

    CVROY New Member

    Joined:
    Mar 8, 2003
    Messages:
    202
    Likes Received:
    0
    I have code for the Ut2003 strangelove, but it need a bit of final tweaking.

    I want it to go to 3rd person view automatically when you fire it in secondary fire mode. anyone know what lines of code I would add, or maybe could look at the classes for me?
     
    Last edited: Feb 5, 2004
  2. [SAS]Solid Snake

    [SAS]Solid Snake New Member

    Joined:
    Jun 7, 2002
    Messages:
    2,633
    Likes Received:
    0
    Set bBehindView to true.
     
  3. CVROY

    CVROY New Member

    Joined:
    Mar 8, 2003
    Messages:
    202
    Likes Received:
    0

    Right on I'll try that:)

    Thanks!
     
  4. CVROY

    CVROY New Member

    Joined:
    Mar 8, 2003
    Messages:
    202
    Likes Received:
    0
    When I add that to the default properties it gets a compile error:(

    Here is the class
    -----------------------------------------------------------------------
    Code:
    class SLFire  extends RedeemerFire;
    
    
    //SLProjectile
    function Projectile SpawnProjectile(Vector Start, Rotator Dir)
    {
            local Projectile p;
    
    	local vector newloc;
    
    	//if (ShouldJumpOff())
    	//	return none;
    
    	p = Super.SpawnProjectile(Start,Dir);
    	if ( p == None )
    		p = Super.SpawnProjectile(Instigator.Location,Dir);
    
    	if ( p == None )
    	{
    	 	Spawn(class'SmallRedeemerExplosion');
    		HurtRadius(500, 400, class'DamTypeRedeemer', 100000, Instigator.Location);
    		return none;
    	}
    	else
    	{
    		BoomStick(Weapon).SLProjectile=SLProjectile(p);
    		SLProjectile(p).ShootingInstigator=SLProjectile(p).instigator;
    
    		instigator.SetPhysics(PHYS_Trailer);
    
    		p.Attach( instigator);
    
    		instigator.SetBase(p);
    
    
    		newloc=vect(0.00,0.00,0.00);
    		newloc.Z += 15;
    		instigator.SetRelativeLocation(newloc);
    
    
    		instigator.Velocity=SLProjectile(p).Velocity;
    		instigator.Velocity=SLProjectile(p).Acceleration;
    
    
    
    	}
    
    	bIsFiring = false;
        StopFiring();
    
       return p;
    }
    
    simulated function bool ShouldJumpOff()
    {
    	if (BoomStick(Weapon).SLProjectile!=None
    	//	&& BoomStick(Weapon).SLProjectile.bFlyingSL
    		)
    	{
    
    		BoomStick(Weapon).SLProjectile.bFlyingSL=false;
    	//	instigator.SetPhysics(PHYS_Falling);
    		BoomStick(Weapon).SLProjectile.ShootingInstigator=None;
    
    
    	//BoomStick(Weapon).SLProjectile.Detach( instigator );
    
    
    		BoomStick(Weapon).SLProjectile=none;
    		Weapon.Owner.SetBase(none);
    
    	//	PlayerController(Pawn(Weapon.Owner).Controller).Gotostate('PlayerWalking');
    		Weapon.Owner.SetPhysics(PHYS_Falling);
    
    
    		Pawn(Weapon.Owner).JumpOffPawn();
    
    		return true;
    	}
    	return false;
    }
    
    simulated function bool AllowFire()
    {
    	if (BoomStick(Weapon).SLProjectile!=None)
    		return true;
    
    	return Super.AllowFire();
    }
    
    
    event ModeDoFire()
    {
    
    	if (BoomStick(Weapon).SLProjectile!=None)
    		if (ShouldJumpOff())
    		{
    			bIsFiring = false;
    			Weapon.PutDown();
    			return;
    		}
    	Weapon.SetOverlayMaterial(FinalBlend'XEffectMat.InvisOverlayFB', 60.0, true);
    	Super.ModeDoFire();
    
    }
    
    defaultproperties
    {
         bWaitForRelease=True
         AmmoClass=Class'wgsstrangelove.SLAmmo'
         ProjectileClass=Class'wgsstrangelove.SLProjectile'
    }
     
    Last edited: Feb 6, 2004
  5. Radiosity

    Radiosity Minty Fresh!

    Joined:
    Jan 3, 2003
    Messages:
    2,217
    Likes Received:
    0
    You've forgotten to use those
    Code:
     tags ;)
     
  6. CVROY

    CVROY New Member

    Joined:
    Mar 8, 2003
    Messages:
    202
    Likes Received:
    0
     
  7. Payback

    Payback Ive got a big stick

    Joined:
    Nov 21, 2002
    Messages:
    94
    Likes Received:
    0
    When Solid Snake said set bBehindview to true he didnt mean just set it. He meant when you start the secondary fire, change bBehindview to true, and reset it to false after you are finished firing.

    NB. bBehindview is a variable in the PlayerController so you'll have to reference the controller when you set it.
     
  8. Radiosity

    Radiosity Minty Fresh!

    Joined:
    Jan 3, 2003
    Messages:
    2,217
    Likes Received:
    0
    I meant when you posted the code above. Use the
    Code:
     [ /code] tags to preserve the formatting and stop the moderators bugging you :)
     
  9. CVROY

    CVROY New Member

    Joined:
    Mar 8, 2003
    Messages:
    202
    Likes Received:
    0
    Ooohhhhh!

    Sorry bout that, will change it:)
     

Share This Page