Announcement

Collapse
No announcement yet.

Second seat killing clients [SOLVED]

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Second seat killing clients [SOLVED]

    When a client gets in the passenger seat of my new flying rig, they die after a short amount of time if the pilot gets out or if they were the pilot and switch over. Anyone have any idea why this happens? The vehicle is set up with a pawn identicle to the hellbender's sidegunpawn, and I see no reason for the untimely kill. Any help will be appreciated. Thanks

    #2
    OK, I have a little more info, so maybe someone has an idea of what is going on. It seems that everything works OK as long as the client is NOT the only person on his team. If the client IS the only person on his team, the second seat of my vehicle kills them in just a few second. Sometimes, but not always, and not predictably, the passenger disapears instead of dying, shortly after entering, but can still control and fire the weapon. Also, when things seem to be working correctly, exiting the second seat kills them, even though the exit position is clearly out of the vehicle's collision area, and that happens instantly.

    Comment


      #3
      I don't suppose you could post your code please?

      Comment


        #4
        Code:
        class WarWing extends ONSChopperCraft
            placeable;
        
        #exec AUDIO IMPORT NAME=WWIdle FILE="Audio\WWIdle.WAV"
        #exec AUDIO IMPORT NAME=WWStartup FILE="Audio\WWStartup.WAV"
        #exec AUDIO IMPORT NAME=WWPBlast FILE="Audio\PlasmaBlast.WAV"
        
        #exec AUDIO IMPORT NAME=BB1 FILE="Audio\E1.WAV"
        #exec AUDIO IMPORT NAME=BB2 FILE="Audio\E2.WAV"
        #exec AUDIO IMPORT NAME=BB3 FILE="Audio\E3.WAV"
        #exec AUDIO IMPORT NAME=BB4 FILE="Audio\E4.WAV"
        #exec AUDIO IMPORT NAME=BB5 FILE="Audio\E5.WAV"
        
        
        var()   float							MaxPitchSpeed;
        
        var()   array<vector>					TrailEffectPositions;
        var     class<WarWingExhaust>	TrailEffectClass;
        var     array<WarWingExhaust>	TrailEffects;
        
        var()	array<vector>					StreamerEffectOffset;
        var     class<WarWingStreamer>	StreamerEffectClass;
        var		array<WarWingStreamer>	StreamerEffect;
        
        var()	range							StreamerOpacityRamp;
        var()	float							StreamerOpacityChangeRate;
        var()	float							StreamerOpacityMax;
        var		float							StreamerCurrentOpacity;
        var		bool							StreamerActive;
        Var() Class <WWBomb> BombClass;
        Var WWBomb Bomb;
        // AI hint
        function bool FastVehicle()
        {
        	return true;
        }
        
        function bool Dodge(eDoubleClickDir DoubleClickMove)
        {
        	if ( FRand() < 0.7 )
        	{
        		VehicleMovingTime = Level.TimeSeconds + 1;
        		Rise = 1;
        	}
        	return false;
        }
        
        simulated function SpecialCalcBehindView(PlayerController PC, out actor ViewActor, out vector CameraLocation, out rotator CameraRotation )
        {
        	local vector CamLookAt, HitLocation, HitNormal, OffsetVector;
        	local Actor HitActor;
            local vector x, y, z;
        
        	if (DesiredTPCamDistance < TPCamDistance)
        		TPCamDistance = FMax(DesiredTPCamDistance, TPCamDistance - CameraSpeed * (Level.TimeSeconds - LastCameraCalcTime));
        	else if (DesiredTPCamDistance > TPCamDistance)
        		TPCamDistance = FMin(DesiredTPCamDistance, TPCamDistance + CameraSpeed * (Level.TimeSeconds - LastCameraCalcTime));
        
            GetAxes(PC.Rotation, x, y, z);
        	ViewActor = self;
        	CamLookAt = GetCameraLocationStart() + (TPCamLookat >> Rotation) + TPCamWorldOffset;
        
        	OffsetVector = vect(0, 0, 0);
        	OffsetVector.X = -1.0 * TPCamDistance;
        
        	CameraLocation = CamLookAt + (OffsetVector >> PC.Rotation);
        
        	HitActor = Trace(HitLocation, HitNormal, CameraLocation, Location, true, vect(40, 40, 40));
        	if ( HitActor != None
        	     && (HitActor.bWorldGeometry || HitActor == GetVehicleBase() || Trace(HitLocation, HitNormal, CameraLocation, Location, false, vect(40, 40, 40)) != None) )
        			CameraLocation = HitLocation;
        
            CameraRotation = Normalize(PC.Rotation + PC.ShakeRot);
            CameraLocation = CameraLocation + PC.ShakeOffset.X * x + PC.ShakeOffset.Y * y + PC.ShakeOffset.Z * z;
        }
        
        function Died(Controller Killer, class<DamageType> damageType, vector HitLocation)
        {
            local int i;
        
            if(Level.NetMode != NM_DedicatedServer)
        	{
            	for(i=0;i<TrailEffects.Length;i++)
                	TrailEffects[i].Destroy();
                TrailEffects.Length = 0;
        
        		for(i=0; i<StreamerEffect.Length; i++)
        			StreamerEffect[i].Destroy();
        		StreamerEffect.Length = 0;
            }
        
        	Super.Died(Killer, damageType, HitLocation);
        }
        
        simulated function Destroyed()
        {
            local int i;
        
            if(Level.NetMode != NM_DedicatedServer)
        	{
            	for(i=0;i<TrailEffects.Length;i++)
                	TrailEffects[i].Destroy();
                TrailEffects.Length = 0;
        
        		for(i=0; i<StreamerEffect.Length; i++)
        			StreamerEffect[i].Destroy();
        		StreamerEffect.Length = 0;
            }
        
            Super.Destroyed();
        }
        
        simulated event DrivingStatusChanged()
        {
        	local vector RotX, RotY, RotZ;
        	local int i;
        
        	Super.DrivingStatusChanged();
        
            if (bDriving && Level.NetMode != NM_DedicatedServer && !bDropDetail)
        	{
                GetAxes(Rotation,RotX,RotY,RotZ);
        
                if (TrailEffects.Length == 0)
                {
                    TrailEffects.Length = TrailEffectPositions.Length;
        
                	for(i=0;i<TrailEffects.Length;i++)
                    	if (TrailEffects[i] == None)
                    	{
                        	TrailEffects[i] = spawn(TrailEffectClass, self,, Location + (TrailEffectPositions[i] >> Rotation) );
                        	TrailEffects[i].SetBase(self);
                            TrailEffects[i].SetRelativeRotation( rot(0,32768,0) );
                        }
                }
        
                if (StreamerEffect.Length == 0)
                {
            		StreamerEffect.Length = StreamerEffectOffset.Length;
        
            		for(i=0; i<StreamerEffect.Length; i++)
                		if (StreamerEffect[i] == None)
                		{
                			StreamerEffect[i] = spawn(StreamerEffectClass, self,, Location + (StreamerEffectOffset[i] >> Rotation) );
                			StreamerEffect[i].SetBase(self);
                		}
            	}
            }
            else
            {
                if (Level.NetMode != NM_DedicatedServer)
            	{
                	for(i=0;i<TrailEffects.Length;i++)
                	   TrailEffects[i].Destroy();
        
                	TrailEffects.Length = 0;
        
            		for(i=0; i<StreamerEffect.Length; i++)
                        StreamerEffect[i].Destroy();
        
                    StreamerEffect.Length = 0;
                }
            }
        }
        
        simulated function Tick(float DeltaTime)
        {
            local float EnginePitch, DesiredOpacity, DeltaOpacity, MaxOpacityChange, ThrustAmount;
        	local TrailEmitter T;
        	local int i;
        	local vector RelVel;
        	local bool NewStreamerActive, bIsBehindView;
        	local PlayerController PC;
        
            if(Level.NetMode != NM_DedicatedServer)
        	{
                EnginePitch = 64.0 + VSize(Velocity)/MaxPitchSpeed * 32.0;
                SoundPitch = FClamp(EnginePitch, 64, 96);
        
                RelVel = Velocity << Rotation;
        
                PC = Level.GetLocalPlayerController();
        		if (PC != None && PC.ViewTarget == self)
        			bIsBehindView = PC.bBehindView;
        		else
                    bIsBehindView = True;
        
            	// Adjust Engine FX depending on being drive/velocity
        		if (!bIsBehindView)
        		{
        			for(i=0; i<TrailEffects.Length; i++)
        				TrailEffects[i].SetThrustEnabled(false);
        		}
                else
                {
        			ThrustAmount = FClamp(OutputThrust, 0.0, 1.0);
        
        			for(i=0; i<TrailEffects.Length; i++)
        			{
        				TrailEffects[i].SetThrustEnabled(true);
        				TrailEffects[i].SetThrust(ThrustAmount);
        			}
        		}
        
        		// Update streamer opacity (limit max change speed)
        		DesiredOpacity = (RelVel.X - StreamerOpacityRamp.Min)/(StreamerOpacityRamp.Max - StreamerOpacityRamp.Min);
        		DesiredOpacity = FClamp(DesiredOpacity, 0.0, StreamerOpacityMax);
        
        		MaxOpacityChange = DeltaTime * StreamerOpacityChangeRate;
        
        		DeltaOpacity = DesiredOpacity - StreamerCurrentOpacity;
        		DeltaOpacity = FClamp(DeltaOpacity, -MaxOpacityChange, MaxOpacityChange);
        
        		if(!bIsBehindView)
                    StreamerCurrentOpacity = 0.0;
                else
            		StreamerCurrentOpacity += DeltaOpacity;
        
        		if(StreamerCurrentOpacity < 0.01)
        			NewStreamerActive = false;
        		else
        			NewStreamerActive = true;
        
        		for(i=0; i<StreamerEffect.Length; i++)
        		{
        			if(NewStreamerActive)
        			{
        				if(!StreamerActive)
        				{
        					T = TrailEmitter(StreamerEffect[i].Emitters[0]);
        					T.ResetTrail();
        				}
        
        				StreamerEffect[i].Emitters[0].Disabled = false;
        				StreamerEffect[i].Emitters[0].Opacity = StreamerCurrentOpacity;
        			}
        			else
        			{
        				StreamerEffect[i].Emitters[0].Disabled = true;
        				StreamerEffect[i].Emitters[0].Opacity = 0.0;
        			}
        		}
        
        		StreamerActive = NewStreamerActive;
            }
        
            Super.Tick(DeltaTime);
        }
        
        function float ImpactDamageModifier()
        {
            local float Multiplier;
            local vector X, Y, Z;
        
            GetAxes(Rotation, X, Y, Z);
            if (ImpactInfo.ImpactNorm Dot Z > 0)
                Multiplier = 1-(ImpactInfo.ImpactNorm Dot Z);
            else
                Multiplier = 1.0;
        
            return Super.ImpactDamageModifier() * Multiplier;
        }
        
        function bool RecommendLongRangedAttack()
        {
        	return true;
        }
        
        //FIXME Fix to not be specific to this class after demo
        function bool PlaceExitingDriver()
        {
        	local int i;
        	local vector tryPlace, Extent, HitLocation, HitNormal, ZOffset;
        
        	Extent = Driver.default.CollisionRadius * vect(1,1,0);
        	Extent.Z = Driver.default.CollisionHeight;
        	Extent *= 2;
        	ZOffset = Driver.default.CollisionHeight * vect(0,0,1);
        	if (Trace(HitLocation, HitNormal, Location + (ZOffset * 5), Location, false, Extent) != None)
        		return false;
        
        	//avoid running driver over by placing in direction perpendicular to velocity
        	if ( VSize(Velocity) > 100 )
        	{
        		tryPlace = Normal(Velocity cross vect(0,0,1)) * (CollisionRadius + Driver.default.CollisionRadius ) * 1.25 ;
        		if ( FRand() < 0.5 )
        			tryPlace *= -1; //randomly prefer other side
        		if ( (Trace(HitLocation, HitNormal, Location + tryPlace + ZOffset, Location + ZOffset, false, Extent) == None && Driver.SetLocation(Location + tryPlace + ZOffset))
        		     || (Trace(HitLocation, HitNormal, Location - tryPlace + ZOffset, Location + ZOffset, false, Extent) == None && Driver.SetLocation(Location - tryPlace + ZOffset)) )
        			return true;
        	}
        
        	for( i=0; i<ExitPositions.Length; i++)
        	{
        		if ( ExitPositions[0].Z != 0 )
        			ZOffset = Vect(0,0,1) * ExitPositions[0].Z;
        		else
        			ZOffset = Driver.default.CollisionHeight * vect(0,0,2);
        
        		if ( bRelativeExitPos )
        			tryPlace = Location + ( (ExitPositions[i]-ZOffset) >> Rotation) + ZOffset;
        		else
        			tryPlace = ExitPositions[i];
        
        		// First, do a line check (stops us passing through things on exit).
        		if ( bRelativeExitPos && Trace(HitLocation, HitNormal, tryPlace, Location + ZOffset, false, Extent) != None )
        			continue;
        
        		// Then see if we can place the player there.
        		if ( !Driver.SetLocation(tryPlace) )
        			continue;
        
        		return true;
        	}
        	return false;
        }
        
        function AltFire(optional float F)
        {
        	//avoid sending altfire to weapon
        	Super(Vehicle).AltFire(F);
        }
        
        function ClientVehicleCeaseFire(bool bWasAltFire)
        {
        	//avoid sending altfire to weapon
        	if (bWasAltFire)
        		Super(Vehicle).ClientVehicleCeaseFire(bWasAltFire);
        	else
        		Super.ClientVehicleCeaseFire(bWasAltFire);
        }
        
        Simulated Function Timer()
        {
            DropBomb();
        }
        
        Simulated Function DropBomb()
        {
            Local Vector Start, NewVelocity;
            Local Coords DPoint;
            Local Rotator Rot;
            DPoint = (GetBoneCoords('DropPoint'));
            Start = DPoint.origin;
            Start.z = (Start.z - 20); //Starts bombs away from hull since DropPoint Bone was at hull
            Rot = Rotator(Self.Velocity);
            Bomb = spawn(BombClass ,,, Start, Rot);
            NewVelocity = Self.Velocity;
            NewVelocity = (NewVelocity/3); //Cuts velocity down, makes bombs easier to place in target area
            NewVelocity.X = (NewVelocity.X + (75 - (Rand(150))));  //Add a bit of spread effect
            NewVelocity.Y = (NewVelocity.Y + (75 - (Rand(150))));
            If (NewVelocity.Z > 0)  // Keeps bombs from flying upward into hull when droping while rising
               NewVelocity.Z = 0;
            Bomb.Velocity = NewVelocity;
        }
        
        function VehicleFire(bool bWasAltFire)
        {
                if (bWasAltFire)
                {
                Settimer(0.15,True);
                }
        	else
        		Super.VehicleFire(bWasAltFire);
        }
        
        function VehicleCeaseFire(bool bWasAltFire)
        {
        	if (bWasAltFire)
                {
                 Settimer (0.0,False);
        	}
        	else
        		Super.VehicleCeaseFire(bWasAltFire);
        }
        
        
        function Vehicle FindEntryVehicle(Pawn P)
        {
        	local Bot B;
        	local int i;
        
        	if ( Level.Game.JustStarted(20) )
        		return Super.FindEntryVehicle(P);
        
        	B = Bot(P.Controller);
        	if (B == None || WeaponPawns.length == 0 || !IsVehicleEmpty() || ((B.PlayerReplicationInfo.Team != None) && (B.PlayerReplicationInfo.Team.Size == 1) && Level.Game.IsA('ASGameInfo')) )
        		return Super.FindEntryVehicle(P);
        
        	for (i = WeaponPawns.length - 1; i >= 0; i--)
        		if (WeaponPawns[i].Driver == None)
        			return WeaponPawns[i];
        
        	return Super.FindEntryVehicle(P);
        }
        
        defaultproperties
        {
             bHasAltFire=False
             BombClass=class'WWBomb'
             PassengerWeapons(0)=(WeaponPawnClass=Class'WarWing.WarWingPassPawn',WeaponBone="PGunPoint")
             bDrawDriverInTP=True
        
             DrawScale=1.2
        
             MaxPitchSpeed=2000.000000
             TrailEffectPositions(0)=(X=-99.8464,Y=0.12,Z=0.2712)
             TrailEffectPositions(1)=(X=-89.8464,Y=0.12,Z=0.2712)
             TrailEffectClass=Class'WarWing.WarWingExhaust'
             StreamerEffectOffset(0)=(X=-105.36,Y=-237.2628,Z=-15.1)
             StreamerEffectOffset(1)=(X=-105.36,Y=-237.2628,Z=-15.1)
             StreamerEffectOffset(2)=(X=-105.36,Y=237.2628,Z=-15.1)
             StreamerEffectOffset(3)=(X=-105.36,Y=237.2628,Z=-15.1)
             StreamerEffectClass=Class'WarWing.WarWingStreamer'
             StreamerOpacityRamp=(Min=1200.000000,Max=1600.000000)
             StreamerOpacityChangeRate=1.000000
             StreamerOpacityMax=0.700000
             UprightStiffness=500.000000
             UprightDamping=300.000000
             MaxThrustForce=100.000000
             LongDamping=0.050000
             MaxStrafeForce=80.000000
             LatDamping=0.050000
             MaxRiseForce=50.000000
             UpDamping=0.050000
             TurnTorqueFactor=600.000000
             TurnTorqueMax=200.000000
             TurnDamping=50.000000
             MaxYawRate=1.500000
             PitchTorqueFactor=200.000000
             PitchTorqueMax=35.000000
             PitchDamping=20.000000
             RollTorqueTurnFactor=450.000000
             RollTorqueStrafeFactor=50.000000
             RollTorqueMax=50.000000
             RollDamping=30.000000
             StopThreshold=100.000000
             MaxRandForce=3.000000
             RandForceInterval=0.750000
             DriverWeapons(0)=(WeaponClass=Class'WarWing.WarWingGun',WeaponBone="DGunPoint")
             RedSkin=Shader'VMVehicles-TX.AttackCraftGroup.AttackCraftChassisFinalRED'
             BlueSkin=Shader'VMVehicles-TX.AttackCraftGroup.AttackCraftChassisFInalBLUE'
             IdleSound=Sound'WarWing.WWIdle'
             StartUpSound=Sound'ONSVehicleSounds-S.AttackCraft.AttackCraftStartUp'
             ShutDownSound=Sound'ONSVehicleSounds-S.AttackCraft.AttackCraftShutDown'
             StartUpForce="AttackCraftStartUp"
             ShutDownForce="AttackCraftShutDown"
             DestroyedVehicleMesh=StaticMesh'WarWingSM.WWDestroyed'//'ONSDeadVehicles-SM.AttackCraftDead'
             DestructionEffectClass=Class'Onslaught.ONSVehicleExplosionEffect'
             DisintegrationEffectClass=Class'Onslaught.ONSVehDeathAttackCraft'
             DestructionLinearMomentum=(Min=50000.000000,Max=150000.000000)
             DestructionAngularMomentum=(Min=100.000000,Max=300.000000)
             DamagedEffectOffset=(X=61.000000,Y=0.000000,Z=25.000000)
             ImpactDamageMult=0.001000
             DrivePos=(X=13.07,Y=-95.6,Z=59.6828)
        
             //HeadlightCoronaOffset(0)=(X=76.000000,Y=14.000000,Z=-24.000000)
             //HeadlightCoronaOffset(1)=(X=76.000000,Y=-14.000000,Z=-24.000000)
             //HeadlightCoronaMaterial=Texture'EpicParticles.Flares.FlashFlare1'
             //HeadlightCoronaMaxSize=60.000000
             
             VehicleMass=3.000000
             bTurnInPlace=True
             bShowDamageOverlay=True
             bDriverHoldsFlag=False
             bCanCarryFlag=False
             ExitPositions(0)=(Y=-290.000000,X=00.0,Z=100.000000)
             ExitPositions(1)=(Y=0.000000,X=220.0,Z=100.000000)
             ExitPositions(2)=(Y=0.000000,X=-180.0,Z=100.000000)
             EntryPosition=(X=80.000000,Y=0.00,Z=30.00)  //EntryPosition=(X=-40.000000,Y=-96.00)
             EntryRadius=60.000000
             
             TPCamDistance=500.000000
             TPCamLookat=(X=500.000000,Z=00.000000,Y=-96.0)
             TPCamWorldOffset=(X=00.00,Y=00.00,Z=200.0)
             FPCamPos=(X=40.00,Y=-96.00,Z=80.0)
             bDrawMeshInFP=True
        
             bDesiredBehindView=False
             DriverDamageMult=0.000000
             VehiclePositionString="in a WarWing"
             VehicleNameString="WarWing"
             RanOverDamageType=Class'Onslaught.DamTypeAttackCraftRoadkill'
             CrushedDamageType=Class'Onslaught.DamTypeAttackCraftPancake'
             MaxDesireability=0.600000
             FlagOffset=(Z=80.000000)
             FlagRotation=(Yaw=32768)
             HornSounds(0)=Sound'ONSVehicleSounds-S.Horns.Horn03'
             HornSounds(1)=Sound'ONSVehicleSounds-S.Horns.Horn07'
             GroundSpeed=2000.000000
             HealthMax=450.000000
             Health=450
             Mesh=SkeletalMesh'WarWingM.Warwing'
             SoundVolume=255
             CollisionRadius=150.000000
             CollisionHeight=70.000000
             Begin Object Class=KarmaParamsRBFull Name=KParams0
                 KInertiaTensor(0)=1.000000
                 KInertiaTensor(3)=3.000000
                 KInertiaTensor(5)=3.500000
                 KCOMOffset=(X=-0.250000)
                 KLinearDamping=0.000000
                 KAngularDamping=0.000000
                 KStartEnabled=True
                 bKNonSphericalInertia=True
                 KActorGravScale=0.000000
                 bHighDetailOnly=False
                 bClientOnly=False
                 bKDoubleTickRate=True
                 bKStayUpright=True
                 bKAllowRotate=True
                 bDestroyOnWorldPenetrate=True
                 bDoSafetime=True
                 KFriction=0.500000
                 KImpactThreshold=300.000000
             End Object
             KParams=KarmaParamsRBFull'WarWing.KParams0'
        
        }

        Code:
        class WarWingPassPawn extends ONSWeaponPawn;
        
        function bool StopWeaponFiring()
        {
        	if ( bWeaponIsAltFiring && (Bot(Controller) != None) )
        	{
        		Gun.CalcWeaponFire();
        		Gun.AltFire(Controller);
        	}
        	return Super.StopWeaponFiring();
        }
        
        defaultproperties
        {
             GunClass=Class'WarWing.WarWingPassGun'
        
             ExitPositions(0)=(Y=290.000000,X=00.0,Z=100.000000)
             ExitPositions(1)=(Y=0.000000,X=220.0,Z=100.000000)
             ExitPositions(2)=(Y=0.000000,X=-180.0,Z=100.000000)
             EntryPosition=(X=-80.000000,Y=0.00,Z=-40.00)
             EntryRadius=300.000000
        
             TPCamDistance=500.000000
             TPCamLookat=(X=500.000000,Y=0.00,Z=00.000000)
             TPCamWorldOffset=(X=00.00,Y=0.00,Z=200.0)
             FPCamPos=(X=40.00,Y=0.00,Z=80.0)
             bDrawMeshInFP=True
        
             MaxViewPitch=16384
             MaxViewYaw=16384
             bDesiredBehindView=False
             DriverDamageMult=0.400000
             VehiclePositionString="in a WarWing's Co-Pilot seat"
             VehicleNameString="WarWing Co-Pilot seat"
        }
        Code:
        
        class WarWingPassGun extends ONSWeapon;
        
        #exec AUDIO IMPORT NAME=FS FILE="Audio\WWShot.WAV"
        
        var class<Emitter>      mTracerClass;
        var() editinline Emitter mTracer;
        var() float				mTracerInterval;
        var() float				mTracerPullback;
        var() float				mTracerMinDistance;
        var() float				mTracerSpeed;
        var float                               mLastTracerTime;
        Var Float DamageRadius;
        var class<DamageType>   AltDamageType;
        
        simulated function CalcWeaponFire()
        {
            local coords WeaponBoneCoords;
            WeaponBoneCoords = GetBoneCoords(WeaponFireAttachmentBone);
            WeaponFireLocation = WeaponBoneCoords.Origin ;
            WeaponFireRotation = (GetBoneRotation(WeaponFireAttachmentBone));
        }
        
        function CeaseFire(Controller C)
        {
            Super.CeaseFire(C);
            AnimStopLooping();
        }
        
        state InstantFireMode
        {
            function Fire(Controller C)
            {
                LoopAnim('FR', 5.0, 0.0);
                Spread=0.02;
                FlashMuzzleFlash();
                if (AmbientEffectEmitter != None)
                {
                    AmbientEffectEmitter.SetEmitterStatus(true);
                }
        
                // Play firing noise
                if (bAmbientFireSound)
                    AmbientSound = FireSoundClass;
                else
                    PlayOwnedSound(FireSoundClass, SLOT_None, FireSoundVolume/255.0,, FireSoundRadius, FireSoundPitch, False);
        
                TraceFire(WeaponFireLocation, WeaponFireRotation);
            }
        
            function AltFire(Controller C)
            {
             LoopAnim('FR', 5.0, 0.0);
             Spread=0.0;
             FlashMuzzleFlash();
                if (AmbientEffectEmitter != None)
                {
                    AmbientEffectEmitter.SetEmitterStatus(true);
                }
        
                // Play firing noise
                if (bAmbientFireSound)
                    AmbientSound = FireSoundClass;
                else
                    PlayOwnedSound(FireSoundClass, SLOT_None, FireSoundVolume/255.0,, FireSoundRadius, FireSoundPitch, False);
        
                TraceFire(WeaponFireLocation, WeaponFireRotation);
        
            }
        
            simulated event ClientSpawnHitEffects()
            {
            	local vector HitLocation, HitNormal, Offset;
            	local actor HitActor;
        
            	// if standalone, already have valid HitActor and HitNormal
            	if ( Level.NetMode == NM_Standalone )
            		return;
            	Offset = 20 * Normal(WeaponFireLocation - LastHitLocation);
            	HitActor = Trace(HitLocation, HitNormal, LastHitLocation - Offset, LastHitLocation + Offset, False);
            	SpawnHitEffects(HitActor, LastHitLocation, HitNormal);
            	UpdateTracer();
            }
        
            simulated function SpawnHitEffects(actor HitActor, vector HitLocation, vector HitNormal)
            {
        		local PlayerController PC;
        		PC = Level.GetLocalPlayerController();
        		if (PC != None && ((Instigator != None && Instigator.Controller == PC) || VSize(PC.ViewTarget.Location - HitLocation) < 5000))
        			{
                                    Spawn(class'HitEffect'.static.GetHitEffect(HitActor, HitLocation, HitNormal),,, HitLocation, Rotator(HitNormal));
                                }
            }
        }
        
        function TraceFire(Vector Start, Rotator Dir)
        {
            local Vector X, End, HitLocation, HitNormal, RefNormal;
            local Actor Other;
            local ONSWeaponPawn WeaponPawn;
            local Vehicle VehicleInstigator;
            local int Damage;
            local bool bDoReflect;
            local int ReflectNum;
        
            MaxRange();
        
        
            if ( bDoOffsetTrace )
            {
            	WeaponPawn = ONSWeaponPawn(Owner);
        	    if ( WeaponPawn != None && WeaponPawn.VehicleBase != None )
            	{
            		if ( !WeaponPawn.VehicleBase.TraceThisActor(HitLocation, HitNormal, Start, Start + vector(Dir) * (WeaponPawn.VehicleBase.CollisionRadius * 1.5)))
        				Start = HitLocation;
        		}
        		else
        			if ( !Owner.TraceThisActor(HitLocation, HitNormal, Start, Start + vector(Dir) * (Owner.CollisionRadius * 1.5)))
        				Start = HitLocation;
            }
            ////////////////////////////////////////////    UpDateTracer();
            ReflectNum = 0;
            while ( true )
            {
                bDoReflect = false;
                X = Vector(Dir);
                End = Start + TraceRange * X;
        
                //skip past vehicle driver
                VehicleInstigator = Vehicle(Instigator);
                if ( ReflectNum == 0 && VehicleInstigator != None && VehicleInstigator.Driver != None )
                {
                	VehicleInstigator.Driver.bBlockZeroExtentTraces = false;
                	Other = Trace(HitLocation, HitNormal, End, Start, true);
                	VehicleInstigator.Driver.bBlockZeroExtentTraces = true;
                }
                else
                	Other = Trace(HitLocation, HitNormal, End, Start, True);
        
                if ( Other != None && (Other != Instigator || ReflectNum > 0) )
                {
                    if (bReflective && Other.IsA('xPawn') && xPawn(Other).CheckReflect(HitLocation, RefNormal, DamageMin*0.25))
                    {
                        bDoReflect = True;
                        HitNormal = vect(0,0,0);
                    }
                    else if (!Other.bWorldGeometry)
                    {
                        Damage = (DamageMin + Rand(DamageMax - DamageMin));
         				if ( Vehicle(Other) != None || Pawn(Other) == None )
         				{
         					HitCount++;
         					LastHitLocation = HitLocation;
        					SpawnHitEffects(Other, HitLocation, HitNormal);
        				}
                       	       If (bIsAltFire)
                       	       {
                       	           Damage = (Damage * 1.5);
                                   HurtRadius(Damage, DamageRadius, AltDamageType, Momentum, HitLocation );
                                   Other.TakeDamage(Damage, Instigator, HitLocation, Momentum*X, AltDamageType);
        			   HitNormal = vect(0,0,0);
                       	       }
                               Else
                                   {Other.TakeDamage(Damage, Instigator, HitLocation, Momentum*X, DamageType);
        				HitNormal = vect(0,0,0);
                                   }
                    }
                    else
                    {
                        HitCount++;
                        LastHitLocation = HitLocation;
                        EndEffects(HitLocation, Rotator(HitNormal), Damage);
        	    }
                }
                else
                {
                    HitLocation = End;
                    HitNormal = Vect(0,0,0);
                    HitCount++;
                    LastHitLocation = HitLocation;
                }
        
                SpawnBeamEffect(Start, Dir, HitLocation, HitNormal, ReflectNum);
        
                if ( bDoReflect && ++ReflectNum < 4 )
                {
                    //Log("reflecting off"@Other@Start@HitLocation);
                    Start	= HitLocation;
                    Dir		= Rotator(RefNormal); //Rotator( X - 2.0*RefNormal*(X dot RefNormal) );
                }
                else
                {
                    break;
                }
            }
        
            NetUpdateTime = Level.TimeSeconds - 1;
        }
        
        Simulated Function EndEffects(Vector HL, Rotator HN, Int Damage)
        {
             if (bIsAltFire)
                        {
                             Damage = (Damage * 2.0);
                             HurtRadius(Damage, DamageRadius, AltDamageType, Momentum, HL );
                             Spawn(class'WWRocketExplosion' ,,,HL,HN);
                        }
                             Else
                             {
                             Spawn(class'WWSmallExplosion' ,,,HL,HN);
                             }
        }
        
        simulated function UpdateTracer()
            {
        	local vector SpawnDir, SpawnVel;
        	local float hitDist;
        
        	if (Level.NetMode == NM_DedicatedServer)
        		return;
        
        	if (mTracer == None)
        	{
        		mTracer = Spawn(mTracerClass);
        	}
        
        	if (Level.bDropDetail || Level.DetailMode == DM_Low)
        		mTracerInterval = 2 * Default.mTracerInterval;
        	else
        		mTracerInterval = Default.mTracerInterval;
        
        	if (mTracer != None && Level.TimeSeconds > mLastTracerTime + mTracerInterval)
        	{
        	        mTracer.SetLocation(WeaponFireLocation);
        
        		hitDist = VSize(LastHitLocation - WeaponFireLocation) - mTracerPullback;
        
        		if (Instigator != None && Instigator.IsLocallyControlled())
        			SpawnDir = vector(WeaponFireRotation);
        		else
        			SpawnDir = Normal(LastHitLocation - WeaponFireLocation);
        
        		if(hitDist > mTracerMinDistance)
        		{
        			SpawnVel = SpawnDir * mTracerSpeed;
        
        			mTracer.Emitters[0].StartVelocityRange.X.Min = SpawnVel.X;
        			mTracer.Emitters[0].StartVelocityRange.X.Max = SpawnVel.X;
        			mTracer.Emitters[0].StartVelocityRange.Y.Min = SpawnVel.Y;
        			mTracer.Emitters[0].StartVelocityRange.Y.Max = SpawnVel.Y;
        			mTracer.Emitters[0].StartVelocityRange.Z.Min = SpawnVel.Z;
        			mTracer.Emitters[0].StartVelocityRange.Z.Max = SpawnVel.Z;
        
        			mTracer.Emitters[0].LifetimeRange.Min = hitDist / mTracerSpeed;
        			mTracer.Emitters[0].LifetimeRange.Max = mTracer.Emitters[0].LifetimeRange.Min;
        
        			mTracer.SpawnParticle(1);
        		}
        
        		mLastTracerTime = Level.TimeSeconds;
            	}
        }
        
        defaultproperties
        {
             DamageRadius=120
             DamageType=Class'DamTypeWWGatGun'
             AltDamageType=Class'DamTypeWWGatGunAlt'
             mTracerClass=Class'WWTracer'
             mTracerInterval=0.60000
             mTracerPullback=150.000000
             mTracerSpeed=15000.000000
             DamageMin=16
             DamageMax=24
             bInstantFire=True
             bReplicateAnimations=True
             YawBone="TPoint"
             PitchBone="TPoint"
             GunnerAttachmentBone="PassPoint"
             PitchUpLimit=8372
             PitchDownLimit=-12461
             YawStartConstraint=57344.000000
             YawEndConstraint=8192.000000
             WeaponFireAttachmentBone="FirePoint"
             RotationsPerSecond=0.500000
             FireInterval=0.100000
             AltFireInterval=0.2500000
             FireSoundClass=Sound'WarWing.FS'
             FireSoundVolume=255.000000
             TraceRange=16384.000000
             Mesh=SkeletalMesh'WarWingM.WWPassTur'
        }
        As you can see, The first class posted is the vehicle, second is the passenger weaponpawn, and last is the passenger weapon. I have re-checked and all the bone names are correct. One thing I haven't tried is is to see if the vehicle's own collision is doing it, but that wouldn't account for many things, like the passenger dying upon exit, the fact that it works flawlessly in instantaction, or the disapearing passenger, and the fact that the results seem to be fairly unpredictable. If you have any ideas, please let me know. Thanks

        Comment


          #5
          Your code does not seemt o have anything that might cause a proble, Try replaceinthe gun with the ONSPRVSideGunPawn, and see if you still have the problem, if so, then it's bone/colission problem

          Comment


            #6
            Thanks, I never thought of that. I tried, and everything works fine with the sidegunpawn. I also checket out the ONSPRV, and the person operating the turret would definately be within it's collisionbox, so that rules that out as a possible cause. One thing that may be a factor, is that I set my model up with several collisionboxes, as well as a collision staticmesh. I'm going to try removing some of the collisionboxes and see if that's it, but I doubt it. Another thing that seems weird, is that I have NEVER figured out how to enter the second seat without entering the driver's seat first. No matter how I set up the entrypoint, it never has allowed it as is done With the turret on the DuneBuggy VTM. This one really has me stumped. Thanks

            Comment


              #7
              I think the UDN code is more based ont he base engine, UT2004 sort of overrides that bit. have you tried attaching your weapon to an ONSPRV?

              Comment


                #8
                I think the UDN code is more based ont he base engine, UT2004 sort of overrides that bit.
                I'm not following you there, could you explain?
                have you tried attaching your weapon to an ONSPRV?
                I just tried that, My weapon works well on an ONSPRV, and the ONSPRS's sidegun works flawlessly on my vehicle, but If i put MY weapon on MY vehicle, it fails. I noticed that it seems that every time I die from getting into the second seat, I get this message in my log: Log: "xPawn fell out of the world!". As i stated earlier, MOST of the time a client gets into the second seat, they die, but about 25% of the time their playermodel just disapears, but they can still control the weapon. Still, I'm not seeing anything that would cause this. I've gone over the meshes and ensured that he vehicle and the weapon do not share any bone names. I'm just not seeing what else it could be. Thanks for the help though, hopefully We've narrowed it down a bit.

                Comment


                  #9
                  Im not experienced in vehicle code but i think i know enough that, if the pawn who is driving the turret/weapon isnt attached to the weaponpawn where its suppose to be seated, the pawn will actually fall thru the vehicle, into the ground, and out of the world destroying it and killing the player. i dont have any fact on this but i have noticed it within some of my other codes that endup falling into the ground, destoying, and being declared in log as None.

                  Make sure that the pawn is being attached correctly.

                  Comment


                    #10
                    Falling out of the world is always almost always a collision problem


                    And as for getting in 2004 overrides the base Unreal engines way of handeling enteirng into vehciles (I belive it's actually in ONSVehicle that the changes are)

                    Comment


                      #11
                      I think I have figured this one out, but I need to do some more testing (My kid needed to use his 'puter, and as I stated earlier, the problem only happens on a network game as a client). ONSChopperCraft (which my vehicle extends) has bCanBeBaseForPawns=False in it's DefaultProperties. I set it to true in my vehicle's class and it 'seems' to work OK. I'll be glad if that is it, but I'll still feel pretty stupid for overlooking it. Doesn't explain why ONSPRVSideGunPawn worked OK, other than the fact that my weapon has bDrawMeshInFP=True. I'll post the results of further testing. Thanks all

                      Comment


                        #12
                        All that variable does is allow people to stand on your vehicle (else they fall off)

                        So whats hapeing now is instead of your pawn falling right through on possesion it gets stuck on your vec. Works I guess, but it doe snot solve the initial problem...

                        Comment


                          #13
                          OK, so that brings 2 questions to mind: What could cause the player to not be able to attach to the model, and second, how can I test to see if the attachment is working or not? It was mentioned that falling out of the world is almost always a collision problem, could you give me an idea of how this works and what could be wrong. Thank You

                          Comment


                            #14
                            Since your "seat" is not terribly complex, you could try starting with, say, the Hellbender side turret, and change its properties one by one until either:

                            1) you get it right

                            or

                            2) it crashes but now you know what caused it.

                            Comment


                              #15
                              I'm not sure what you mean by "seat" but if you mean the weaponpawn, then as I stated earlier, the passenger weapon works fine on other vehicles, and the Hellbender's sidegunpawn works fine in my vehicle, but MY weapon and MY vehicle, when put together for some reason cause the problems I have stated earlier. My weaponpawn is nearly identical to the ONSPRV's sidegunpawn, the only differences being bDrawMeshinFP and bDesiredBehindView, neither of which should not make a difference. As for the weapon itself, I see nothing related to attachment, the only code in it is related to weaponfire, and the only thing in the defaultproperties relating to player attachment is GunnerAttachmentBone="PassPoint", which has been verified as a correct and valid bone several times. Obviously SOMETHING is corrct here, because it works flawlessly in instant action and from a listen server, it's just the network clients that have this problem.

                              I'm still trying to figure out what kind of bone/collision problem there could be that could be causeing this. Thanks

                              Comment

                              Working...
                              X