Editing and Customization > Community Content

[Gameplay] Freeze Tag Mode

<< < (4/10) > >>

Troy:
I'm anxious to see it as I don't think it will work.  If an admin turns on jump, then it sounds like the mode will be ruined.

kraid:
you don't even need jumping enabled to fall into the decent on the end of runway or beyond the bridges in caves or complex so you surely need to spawn ppl on something like a token- or playerspawn.

Troy:
Yea, that's true as well.  If someone is falling into a pit, and they're killed, the game mode would fail.  It would be worthless to unfreeze them.

Joe:

--- Quote from: Troy on November 05, 2012, 05:53:20 am ---Yea, that's true as well.  If someone is falling into a pit, and they're killed, the game mode would fail.  It would be worthless to unfreeze them.

--- End quote ---
I've decided that I'm going to make resurrection entities spawn at player spawn points because of this map problem and because resurrection entities could block doors if they spawn at player corpses.

I also now think that resurrection token entities should use a grave stone model, if tokens can only use T-posed character models.

I still haven't finished this mode's script because I haven't spent much time working on it since I said I was confident I would have it finished by today.

I'm stuck at the moment because I want to use the Timer Tracker class but there is an error I've not been able to fix.

I've been trying to make it work in a simple DM test script:


--- Code: ---
from GamePlay import GEScenario
from Utils.GETimer import EndRoundCallback, TimerTracker, Timer
import GEEntity, GEPlayer, GEUtil, GEWeapon, GEMPGameRules, GEGlobal

USING_API = GEGlobal.API_VERSION_1_0_0

class Test( GEScenario ):
def GetPrintName( self ):
return "Test"

def GetScenarioHelp( self, help_obj ):
help_obj.SetDescription( "#GES_GP_DEATHMATCH_HELP" )

def GetGameDescription( self ):
if GEMPGameRules.IsTeamplay():
return "Team Deathmatch"
else:
return "Deathmatch"

def __init__( self ):
self.timerTracker = TimerTracker( self )

def GetTeamPlay( self ):
return GEGlobal.TEAMPLAY_TOGGLE

def OnLoadGamePlay( self ):
GEMPGameRules.SetAllowTeamSpawns( False )
self.CreateCVar( "dm_fraglimit", "0", "Enable frag limit for DeathMatch." )

timer = self.timerTracker.CreateTimer( "timer" )
timer.SetAgeRate( 1.0, 1.0 )
timer.SetUpdateCallback( self.TimerUpdate, 1.0 )

def TimerUpdate( self, timer, update_type ):
GEUtil.Msg("Timer Updated")

def OnThink( self ):
fragLimit = int( GEUtil.GetCVarValue( "dm_fraglimit" ) )
if fragLimit != 0:
if GEMPGameRules.IsTeamplay():

teamJ = GEMPGameRules.GetTeam( GEGlobal.TEAM_JANUS );
teamM = GEMPGameRules.GetTeam( GEGlobal.TEAM_MI6 );

jScore = teamJ.GetRoundScore() + teamJ.GetMatchScore()
mScore = teamM.GetRoundScore() + teamM.GetMatchScore()

if jScore >= fragLimit or mScore >= fragLimit:
GEMPGameRules.EndMatch()
else:
for i in range( 32 ):

if not GEPlayer.IsValidPlayerIndex( i ):
continue

player = GEPlayer.GetMPPlayer( i )

if  ( player.GetMatchScore() + player.GetScore() ) >= fragLimit:
GEMPGameRules.EndMatch()
--- End code ---


--- Quote ---Traceback (most recent call last):
  File "c:\program files\steam\steamapps\sourcemods\gesource\scripts\python\GamePlayManager.py", line 23, in SetGamePlay
    scenario = getattr( sys.modules[module], ident )()

  File "c:\program files\steam\steamapps\sourcemods\gesource\scripts\python\GamePlay\Test.py", line 21, in __init__
    self.timerTracker = TimerTracker( self )

  File "c:\program files\steam\steamapps\sourcemods\gesource\scripts\python\GamePlay\Utils\GETimer.py", line 20, in __init__
    parent.RegisterEventHook( EventHooks.GP_THINK, self.AgeTimers )

  File "c:\program files\steam\steamapps\sourcemods\gesource\scripts\python\GamePlay\__init__.py", line 22, in RegisterEventHook
    if not self.__hooks.has_key( hook ):
AttributeError: 'Test' object has no attribute '_GEScenario__hooks'
Scenario loading failed for scenario Test
--- End quote ---

Joe:
I've still not found a solution to the problem I mentioned in my previous post but I have been implementing parts of the script which don't need timers.

I would like to implement resurrection entities using capture area entities but I've not found a way to associate a capture area entity a player enters, with its reference in the token manager. In order for the token manager to delete a specific capture area it needs to be given the capture area's name and I've not been able to get the name from a capture area object by using the functions in CBaseEntity.  The token manager doesn't have a function for returning its capture area entity objects, so I've not been able to map a capture area object to its name in a Python dictionary.

I think the only alternative way for implementing resurrection entities would be to use token entities. However this would allow players to interact with resurrection entities by picking them up instead of standing near them. So player's would not resurrect players in the same way that they would resurrect players in MOHAA's freeze tag mode, which could make this mode less enjoyable than that popular mode.

So if anyone knows how I could get the name for a capture area please let me know.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version