PDA

View Full Version : Turret not spawning online



Xyx
07-22-2006, 07:57 PM
I've made a variation on the Energy Turret (http://www.ataricommunity.com/forums/showthread.php?t=526116). Works fine offline, but when I start a dedicated server and log on, the turrets are missing.

The mutator cycles through all turrets in its BeginPlay event and replaces each turret's gun. It does not replace the turrets themselves.


simulated function BeginPlay()
{
local ONSManualGunPawn MGP;

super.BeginPlay();

foreach AllActors(class'ONSManualGunPawn', MGP)
{
// Replace GunClass.
MGP.GunClass = GunClass;

if(MGP.Gun != none)
{
// Replace Gun.
MGP.Gun.Destroy();
MGP.Gun = MGP.Spawn(MGP.GunClass, MGP,, MGP.Location);
}
}
}
I'm doing it this way because I could not replace the turrets themselves. Does anyone know of a working turret replacement mutator?

Note: the Energy Turrets themselves are invisible, everything you see is the gun's mesh. The turrets might actually be there, but since they have no mesh of their own they cannot be seen either way).

Suggestions? Any additional information?

Xyx
07-31-2006, 03:43 PM
bumpage...

Archnemesis
07-31-2006, 05:30 PM
In my gametype I use the following method to destroy the turrent. Why dont you try getting its location before destroying it, then Spawning yours at that location.


foreach AllActors( class 'ONSManualGunPawn', ManGun)
{
if (ManGun != none)
{
ManGun.Destroy();
}
}

Xyx
08-01-2006, 06:33 AM
The problem with the gun pawn is that it hooks into all sorts of Onslaught game code. Turrets get linked to nodes and such. That is why I chose to just replace the gun, not the gun pawn.

Boksha
08-01-2006, 09:26 AM
Linkage or not, the reason you can't see the turrets online is probably because you haven't put your custom package in the serverpackages list.
In the defaultproperties of your mutator class, put "bAddToServerPackages=true". Hopefully that'll solve the problem.