Announcement

Collapse
No announcement yet.

Replication.....HELP!

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

    Replication.....HELP!

    Can anyone get me started in the right direction to figure out how to get the following code set up for replication? The code works great and looks great on a listen server, but when I run it on a dedicated it doesn't. I know I need to add a replication function, but not sure which variable to put in the 'reliable if' statement. I know some of the functions should be simulated...but not sure which ones. And I am really confused on where to add the if ROLE==ROLEAuthority commands. Thanks for any help...this networking programming is confusing for a first timer!

    Code:
    //-----------------------------------------------------------
    //
    //-----------------------------------------------------------
    class TumblerPassengerGun extends ONSWeapon;
    
    var class<Projectile> TeamProjectileClasses[2];
    var Emitter SmokeTrail[2];
    
    
    
    state ProjectileFireMode
    {
        function smoke()
        {
        
        SmokeTrail[0] = Spawn(class'SmokeScreen',,,);
        AttachToBone(SmokeTrail[0], 'PlasmaGunBarrel');
    
        }
    
        function Timer()
        {
        Level.Game.Broadcast(Level.GetLocalPlayerController(),"timer", 'Say');
        SmokeTrail[0].Kill();
        }
    
    
    
    	function Fire(Controller C)
    	{
    		if (Vehicle(Owner) != None && Vehicle(Owner).Team < 2)
    			ProjectileClass = TeamProjectileClasses[Vehicle(Owner).Team];
    		else
    			ProjectileClass = TeamProjectileClasses[0];
    
    		Super.Fire(C);
    	}
    
    	function AltFire(Controller C)
    	{
    
         smoke();
         SetTimer(5.8,false);
    
    
        }
    
        function CeaseFire(Controller C)
        {
        Level.Game.Broadcast(Level.GetLocalPlayerController(),"cease", 'Say');
        SmokeTrail[0].Kill();
        }
    
    
    
    
    }
    
    
    
    
    defaultproperties
    {
         TeamProjectileClasses(0)=Class'Arkon2004.DGrenadeProj'
         TeamProjectileClasses(1)=Class'Arkon2004.DGrenadeProj'
         YawBone="PlasmaGunBarrel"
         YawStartConstraint=46152.000000
         YawEndConstraint=52152.000000
         PitchBone="PlasmaGunBarrel"
         PitchUpLimit=4000
         PitchDownLimit=-4000
         WeaponFireAttachmentBone="PlasmaGunBarrel"
         WeaponFireOffset=100.000
         FireInterval=8.000000
         AltFireInterval=6.0000
         GunnerAttachmentBone="PlasmaGunAttachment"
         Mesh=Mesh'ONSWeapons-A.PlasmaGun'
         i=0
    }
    Thanks,

    EDGE

    #2
    might wanna tell us what isn't happening

    Comment


      #3
      Well, in listen mode, the emitter spawns correctly and is attached to the back of the car when the alt-fire is pressed. When the alt-fire is let go the emitter stops and the particles fade away and it looks really nice. When it is in dedicated mode, the emitter is attachd to the back of the car when alt-fire is pressed, but the particles don't act correctly, they don't spread out and rise the same and the volume is less. When you let go of the alt-fire the emitter stays attached to the back of the car instead of the particles just dying like they should. I know it has to do with the code being correctly written to run on the server and run on the client,with one knowing what the other is doing. I just have never done this before and don't know which statements are needed in which functions.

      Comment


        #4
        If I am not mistaken, your emitter needs an owner, actors do not replicate if they have no owner. Since this is a weapon, it should have an instigator, otherwise it wouldn't work correctly.

        Try:
        SmokeTrail[0] = Spawn(class'SmokeScreen',Instigator);

        If not, problem could be in your emitter.

        Comment


          #5
          Bump....

          My little file isn't very large. Can someone give me some insight into the questions surrounding replication issues?

          Comment


            #6
            Perhaps you need this instead: http://www.wiki.beyondunreal.com/wiki/NetworkEmitter

            Comment

            Working...
            X