DeapaWaspo
06-02-2009, 06:53 AM
Sorry to bother, but your help is much appreciated...
Questions
1.) I've made a custom Volume which my Players spawn inside of. The problem is that when they spawn the Volume's Touch event registers that something is inside of it, just not a Player with a controller. I have to move out of the Volume then back in for it to realize it has a player inside of it. Its like it thinks the object inside of it is still the spectator camera before the initial spawn. How can I make Touch wait for the Pawn to have a controller assigned to it so the volume registers the player initially. Here is the code.
var(Team) int OwnerTeam;
event Touch( Actor Other, PrimitiveComponent OtherComp, vector HitLocation, vector HitNormal )
{
local MOMPawn MP;
Super.Touch( Other, OtherComp, HitLocation, HitNormal );
MP = MOMPawn(Other);
if ( MP.Controller != None )
{
if ( OwnerTeam == MP.GetTeamNum() )
{
MP.bInBuyZone = True;
WorldInfo.Game.Broadcast(MP, MP@"is in the Volume" );
}
else
if ( OwnerTeam != MP.GetTeamNum() )
{
MP.bInBuyZone = False;
WorldInfo.Game.Broadcast(MP, MP@"went into the wrong Volume" );
}
}
}
event UnTouch( Actor Other )
{
local MOMPawn MP;
Super.UnTouch( Other );
MP = MOMPawn(Other);
if ( Mp.Controller != None )
{
if ( OwnerTeam == MP.GetTeamNum() )
{
MP.bInBuyZone = False;
WorldInfo.Game.Broadcast(MP, MP@"has left the Volume );
}
}
}
Where its getting caught up is the if ( MP.Controller != None ), when the player spawns it for some reason doesnt have a controller right away. Why, and how do I make it?
2.) Every time I or a bot dies then respawns it gets a new Pawn assignment. I have a custom Pawn named MOMPawn and I have a Broadcast that tells me what Pawn is triggering an even. Naturally the first spawn I get assigned MOMPawn_0 but after I die then respawn it changes to MOMPawn_1 then MOMPawn_2, so on and so forth. Is this normal? It seems like creating new instances of the same pawns would be hard on memory. Or am I completely looking at this wrong?
EDIT: As of this moment I am uploading a video example to youtube of my second question. I will repost once the video is up.
Questions
1.) I've made a custom Volume which my Players spawn inside of. The problem is that when they spawn the Volume's Touch event registers that something is inside of it, just not a Player with a controller. I have to move out of the Volume then back in for it to realize it has a player inside of it. Its like it thinks the object inside of it is still the spectator camera before the initial spawn. How can I make Touch wait for the Pawn to have a controller assigned to it so the volume registers the player initially. Here is the code.
var(Team) int OwnerTeam;
event Touch( Actor Other, PrimitiveComponent OtherComp, vector HitLocation, vector HitNormal )
{
local MOMPawn MP;
Super.Touch( Other, OtherComp, HitLocation, HitNormal );
MP = MOMPawn(Other);
if ( MP.Controller != None )
{
if ( OwnerTeam == MP.GetTeamNum() )
{
MP.bInBuyZone = True;
WorldInfo.Game.Broadcast(MP, MP@"is in the Volume" );
}
else
if ( OwnerTeam != MP.GetTeamNum() )
{
MP.bInBuyZone = False;
WorldInfo.Game.Broadcast(MP, MP@"went into the wrong Volume" );
}
}
}
event UnTouch( Actor Other )
{
local MOMPawn MP;
Super.UnTouch( Other );
MP = MOMPawn(Other);
if ( Mp.Controller != None )
{
if ( OwnerTeam == MP.GetTeamNum() )
{
MP.bInBuyZone = False;
WorldInfo.Game.Broadcast(MP, MP@"has left the Volume );
}
}
}
Where its getting caught up is the if ( MP.Controller != None ), when the player spawns it for some reason doesnt have a controller right away. Why, and how do I make it?
2.) Every time I or a bot dies then respawns it gets a new Pawn assignment. I have a custom Pawn named MOMPawn and I have a Broadcast that tells me what Pawn is triggering an even. Naturally the first spawn I get assigned MOMPawn_0 but after I die then respawn it changes to MOMPawn_1 then MOMPawn_2, so on and so forth. Is this normal? It seems like creating new instances of the same pawns would be hard on memory. Or am I completely looking at this wrong?
EDIT: As of this moment I am uploading a video example to youtube of my second question. I will repost once the video is up.