Cheese
Joined: 30 Mar 2006 Posts: 79 Location: ...YES
|
Posted: Tue Jul 04, 2006 10:08 pm Post subject: Another Uscript problem (sigh) |
|
|
Yes it is me again, and I have a bit of a problem..
This projectile here doesn't work in Internet play..
When I shoot the gun, the projectile just sits there and the
explosion appears off in the distance. The smoke doesn't appear either.
Can someone help? (if this is just a stupid question, keep in mind I am a
newb at Uscript :p)
Code: |
//=============================================================================
// JackFire.
//=============================================================================
class JackFire expands Projectile;
var float MagnitudeVel,Count,SmokeRate;
var vector InitialDir;
var bool bRing,bHitWater,bWaterStart;
var int NumExtraRockets;
simulated function PostBeginPlay()
{
Count = -0.1;
if (Level.bHighDetailMode) SmokeRate = 0.035;
else SmokeRate = 0.05;
}
simulated function Tick(float DeltaTime)
{
local AnimSpriteEffect b;
Count += DeltaTime;
if ( (Count>(SmokeRate+FRand()*(SmokeRate+NumExtraRockets*0.035))) && (Level.NetMode!=NM_DedicatedServer) )
{
b = Spawn(class'Jackspritepuff');
b.RemoteRole = ROLE_None;
Count=0.0;
}
}
auto state Flying
{
simulated function ZoneChange( Zoneinfo NewZone )
{
local waterring w;
if (!NewZone.bWaterZone || bHitWater) Return;
bHitWater = True;
Disable('Tick');
if ( Level.NetMode != NM_DedicatedServer )
{
w = Spawn(class'WaterRing',,,,rot(16384,0,0));
w.DrawScale = 0.2;
w.RemoteRole = ROLE_None;
}
Velocity=0.6*Velocity;
}
simulated function ProcessTouch (Actor Other, Vector HitLocation)
{
if ((Other != instigator) && (Rocket(Other) == none))
Explode(HitLocation,Normal(HitLocation-Other.Location));
}
function BlowUp(vector HitLocation, RingExplosion r)
{
if ( Level.Game.IsA('DeathMatchGame') ) //bigger damage radius
HurtRadius(0.9 * Damage,240.0, 'exploded', MomentumTransfer, HitLocation );
else
HurtRadius(Damage,200.0, 'exploded', MomentumTransfer, HitLocation );
MakeNoise(1.0);
if ( r != None )
r.PlaySound(r.ExploSound,,6);
}
simulated function Explode(vector HitLocation, vector HitNormal)
{
local DefaultBurst s;
local RingExplosion3 r;
s = spawn(class'JackBurstAlt',,,HitLocation + HitNormal*16);
s.RemoteRole = ROLE_None;
BlowUp(HitLocation,r);
Destroy();
}
function BeginState()
{
initialDir = vector(Rotation);
if ( Role == ROLE_Authority )
Velocity = speed*initialDir;
Acceleration = initialDir*50;
PlaySound(SpawnSound, SLOT_None, 2.3);
if (Region.Zone.bWaterZone)
{
bHitWater = True;
Velocity=0.6*Velocity;
}
}
}
defaultproperties
{
speed=1300.000000
Damage=80.000000
DrawType=DT_Sprite
Style=STY_Translucent
Sprite=Texture'SpaceFX.3g'
Texture=Texture'SpaceFX.3f'
DrawScale=0.600000
CollisionRadius=12.000000
CollisionHeight=12.000000
}
|
Here's the code for the gun just in case.
Code: |
//=============================================================================
// Jack.
//=============================================================================
class Jack expands Weapon;
function Projectile ProjectileFire(class<projectile> ProjClass, float ProjSpeed, bool bWarn)
{
local Vector Start, X,Y,Z;
if ( PlayerPawn(Owner) != None )
PlayerPawn(Owner).ClientInstantFlash( -0.4, vect(500, 0, 650));
Owner.MakeNoise(Pawn(Owner).SoundDampening);
GetAxes(Pawn(owner).ViewRotation,X,Y,Z);
Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Z * Z;
AdjustedAim = pawn(owner).AdjustAim(ProjSpeed, Start, AimError, True, !bWarn);
return Spawn(ProjClass,,, Start,AdjustedAim);
}
function PlayFiring()
{
PlayAnim( 'Fire', 1.7,0.05 );
PlaySound (FireSound);
}
function PlayAltFiring()
{
PlayAnim('AltFire1', 0.8,0.05);
}
function AltFire( float Value )
{
if (AmmoType.UseAmmo(1))
{
if ( Owner.bHidden )
CheckVisibility();
bPointing=True;
PlayAltFiring();
GotoState('AltFiring');
}
}
///////////////////////////////////////////////////////////
state AltFiring
{
function Projectile ProjectileFire(class<projectile> ProjClass, float ProjSpeed, bool bWarn)
{
local Vector Start, X,Y,Z;
local Projectile S;
local int i;
Owner.MakeNoise(Pawn(Owner).SoundDampening);
GetAxes(Pawn(owner).ViewRotation,X,Y,Z);
Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z;
AdjustedAim = pawn(owner).AdjustAim(ProjSpeed, Start, AimError, True, bWarn);
AdjustedAim.Roll += 12768;
PlaySound (FireSound);
PlaySound (Misc1Sound);
for (i = 0; i< 2; i++)
{
if (AmmoType.UseAmmo(1))
{
S = Spawn(AltProjectileClass,,, Start - 2 * VRand());
}
}
}
Begin:
FinishAnim();
Repeater:
ProjectileFire(AltProjectileClass,AltProjectileSpeed,bAltWarnTarget);
PlayAnim('AltFire2', 0.3,0.05);
FinishAnim();
if ( PlayerPawn(Owner) == None )
{
if ( (AmmoType != None) && (AmmoType.AmmoAmount<=0) )
{
Pawn(Owner).StopFiring();
Pawn(Owner).SwitchToBestWeapon();
if ( bChangeWeapon )
GotoState('DownWeapon');
}
else if ( (Pawn(Owner).bAltFire == 0) || (FRand() > AltRefireRate) )
{
Pawn(Owner).StopFiring();
GotoState('Idle');
}
}
if ( (Pawn(Owner).bAltFire!=0)
&& (Pawn(Owner).Weapon==Self) && AmmoType.UseAmmo(1))
{
goto 'Repeater';
}
PlayAnim('AltFire3', 0.8,0.05);
FinishAnim();
PlayAnim('Load',0.2,0.05);
FinishAnim();
if ( Pawn(Owner).bFire!=0 && Pawn(Owner).Weapon==Self)
Global.Fire(0);
else
GotoState('Idle');
}
///////////////////////////////////////////////////////////
function PlayIdleAnim()
{
LoopAnim('Idle', 0.4);
}
defaultproperties
{
AmmoName=Class'Uber4.Uber4ammo'
PickupAmmoCount=100
FireOffset=(X=16.000000,Z=-14.000000)
ProjectileClass=Class'Uber4.JackFire'
AltProjectileClass=Class'Uber4.JackAltFire'
FireSound=Sound'AmbModern.OneShot.cscanE2'
AltFireSound=Sound'AmbModern.OneShot.cscanE2'
SelectSound=Sound'AmbModern.OneShot.ff3end2'
Misc1Sound=Sound'AmbModern.OneShot.teleprt2'
InventoryGroup=4
PickupMessage="You got the Jack"
ItemName="Jack"
PlayerViewOffset=(X=2.000000,Z=-0.900000)
PlayerViewMesh=LodMesh'UnrealI.Razor'
PickupViewMesh=LodMesh'UnrealI.RazPick'
ThirdPersonMesh=LodMesh'UnrealI.Razor3rd'
PickupSound=Sound'AmbModern.OneShot.ff3end2'
Texture=FireTexture'Uber4.JackTex'
Mesh=LodMesh'UnrealI.RazPick'
bMeshEnviroMap=True
}
|
_________________
|
|