Forums | Hello Guest, Login or Register | > > L4Y Files: No longer here! < <
  Unreal Tournament 2004 : Unreal Editor Help : Coder needed [Forum Rules]  


Back to Forum Thread List

missilemaster2   Posted 21st Jun 2005 3:39am
L4Y Member
Post 14 / 50

I guess this thread got deleted when the site got changed around, so here it is again. For the second version of my map DM-AutoTournament, I need some way of detecting when there is only one player in a given area, probably a "Zone". Something similar to this was made for the old UT, so you can work off that if you want to:

//====================================================================
// CounterZone.
// Put this zone info in a zone where you need to trigger something based on the number of players in that zone.
// Most immediate use would be a cage-match trap, where when enough players enter the zone, a triggered mover
// door shuts to trap the players in until someone dies. N men enter, N-1 men leave!
// Set the CounterZone properties to the number which triggers, and the event to trigger.
//====================================================================
class CounterZone expands ZoneInfo;

var () int Threshold; // when number of players reaches this, trigger stuff
var() name ZoneCounterEvent; // fire this event when threshold is reached

// When an actor enters this zone.
event ActorEntered( actor Other )
{

local actor A;

Super.ActorEntered (Other); // do the parent behavior, which ticks the counter
if( Pawn(Other)!=None && Pawn(Other).bIsPlayer )

if (ZonePlayerCount == Threshold && ZoneCounterEvent!='' )
{

//log ("threshold reached");
foreach AllActors( class 'Actor', A, ZoneCounterEvent )

A.Trigger( Self, Pawn(Other) );

}

}


// When an actor leaves this zone.
event ActorLeaving( actor Other )
{

local actor A;

Super.ActorLeaving (Other);
if( Pawn(Other)!=None && Pawn(Other).bIsPlayer )

if (ZonePlayerCount == (Threshold-1) && ZoneCounterEvent!='' )
{

//log ("below threshold");
foreach AllActors( class 'Actor', A, ZoneCounterEvent )

A.UnTrigger( Self, Pawn(Other) );

}

}

Obviously, you and whoever made the script above would get credit for this...so if you know any coding, please help!
   
OutlawSkot33    Posted 21st Jun 2005 5:00am
Post 676 / 1292
Topic moved because it is related to help within Unreal Editor.
   
missilemaster2   Posted 11th Jul 2005 3:28am
L4Y Member
Post 21 / 50

Well, from what I can see, there is not a simple way to do this...at least not in UT2004. So, I think I will just have to release my map without this.
   



Copyright © 2000-2026 Levels-4-You
Your request was handled in 0.06 seconds.