Hyper.nl Unreal Services Forum Index Hyper.nl Unreal Services
The forum of Hyper.nl Unreal Services and the semi-offical resource for Winged Unicorn's Unreal mods
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Another Uscript problem (sigh)

 
Post new topic   Reply to topic    Hyper.nl Unreal Services Forum Index -> HelpDesk
View previous topic :: View next topic  
Author Message
Cheese



Joined: 30 Mar 2006
Posts: 79
Location: ...YES

PostPosted: Tue Jul 04, 2006 10:08 pm    Post subject: Another Uscript problem (sigh) Reply with quote

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
}

_________________
Back to top
View user's profile Send private message
Zombie



Joined: 27 Jan 2004
Posts: 295

PostPosted: Tue Jul 04, 2006 11:09 pm    Post subject: Reply with quote

The JackFire doesn't appear to be set to simulate itself on clients. For JackFire default properties change its RemoteRole to be "RemoteRole=ROLE_SimulatedProxy". That makes the server notify relevant clients to simulate the actor, execute its simulated functions, and predict it's physics.


-Zombie
_________________
GameType: JCoopZ1 - Build137 (11/30/12)
Mutator: DZMapM - 2.34 (12/15/11)
Back to top
View user's profile Send private message Send e-mail
Cheese



Joined: 30 Mar 2006
Posts: 79
Location: ...YES

PostPosted: Wed Jul 05, 2006 4:15 am    Post subject: Reply with quote

Thank you for the help

(I will be sure to put you in the Uber 4 credits )
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Hyper.nl Unreal Services Forum Index -> HelpDesk All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group