Announcement

Collapse
No announcement yet.

removing ALL Pickups at game start [solved]

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

  • replied
    and i was wondering how i could replicate something that shouldn't exist

    thx for your help

    Leave a comment:


  • replied
    Bases are not replicated to clients (they are bStatic/bNoDelete). Your code catches the pickups server side, and prevents them from ever being spawned on the client. It cannot do this with the bases. The Instagib mutator handles the client side bases up in a simulated BeginPlay():

    Code:
    simulated function BeginPlay()
    {
    	local xPickupBase P;
    
    	foreach AllActors(class'xPickupBase', P)
    	{
    		P.bHidden = true;
    		if (P.myEmitter != None)
    			P.myEmitter.Destroy();
    	}
    	Super.BeginPlay();
    }
    One way to use this function is to put it in a subclass of Actor with:
    Code:
    defaultproperties
    {
        bAlwaysRelevant=true
        RemoteRole=ROLE_SimulatedProxy
    }
    Then spawn this actor in your GameInfo (if that's where you want to handle it).

    Leave a comment:


  • started a topic removing ALL Pickups at game start [solved]

    removing ALL Pickups at game start [solved]

    hello folks!

    i want to remove everything a player could pick up, like health, ammo and weapons etc.

    i basically took this code from the instagib mutator, and it effectively removes all this stuff. however, when i join a dedicated server, the weapon and health spawns are still here (but no weapons or health).
    when i try it locally, the level is cleaned just fine, so i assume it's some kind of replication problem....

    it's purely cosmetic, but i'd appreciate it if anyone can shed some light on this!


    (this is called in my GameInfo's PostbeginPlay, ut2004 tc-mod)
    Code:
    function CleanupLevel()
    {
     	local xPickupBase P;
    	local Pickup L;
    
    	foreach AllActors(class'xPickupBase', P)
    	{
    		P.bHidden = true;
    		if (P.myEmitter != None)
    			P.myEmitter.Destroy();
    		P.Destroy();
    	}
    
    	foreach AllActors(class'Pickup', L)
    	{
    		if ( L.IsA('WeaponLocker') )
    			L.GotoState('Disabled');
    		L.Destroy();
    	}
    
        log("level cleaned");
    }
Working...
X