Ok cool! It works partially (the object spawns after I set its homebase). The problem that remains is that this isn't much of a spawner if it can't respawn the object, and I'm not sure how to do this. I tried using Touch() and Tick() and in both cases I don't know how to get the object to test for being attached to the base without destroying it (which I can't do because it's on the player's back at the time).
Code:
class UTBombSite extends UTGameObjective
placeable;
var UTBomb myBomb;
var class<UTBomb> BombType;
simulated event postBeginPlay() // simulated because the compiler told me to
{
`log("this is a test");
myBomb = Spawn(BombType, self);
myBomb.HomeBase = self; // or it spawns at static location (world origin?)
}
event Touch( Actor Other, PrimitiveComponent OtherComp, vector HitLocation, vector HitNormal )
{
`log("touched");
if ( myBomb.HomeBase == None ) // always fails, doing myBomb == None also always fails
{
`log("no bomb exists, respawning it"); // never happens
myBomb = Spawn( BombType, self);
myBomb.HomeBase = self;
}
}
defaultproperties
{
BombType=class'UTBomb'
bCollideActors=true // or no touch
// handle collision hull
Begin Object Name=CollisionCylinder
CollideActors=true
End Object
// draw model
Begin Object Class=StaticMeshComponent Name=StaticMeshComponent0
StaticMesh=StaticMesh'Pickups.jump_pad.S_Pickups_Jump_Pad'
CollideActors=false
Scale3D=(X=1.0,Y=1.0,Z=1.0)
Translation=(X=0.0,Y=0.0,Z=-47.0)
End Object
Components.Add(StaticMeshComponent0)
}
I can't really use Touch() to set myBomb to none because the size of the base is larger than the size of the bomb (it would destroy the bomb before it was ever picked up). I don't know how else to do this test.
I don't mind using Tick() instead of Touch() but I'm not sure how it works.
Any ideas? Thanks again!
Bookmarks