GoldenEye: Source Forums

  • April 28, 2024, 09:33:36 am
  • Welcome, Guest
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Health Amount  (Read 4686 times)

0 Members and 1 Guest are viewing this topic.

markpeterjameslegg

  • Did I fire six shots? Or only five?
  • 00 Agent
  • ***
  • Posts: 879
  • Reputation Power: 202
  • markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!
  • Offline Offline
Health Amount
« on: November 22, 2012, 04:33:44 pm »

Hi people. I wanted to ask if there is any way to lower character health for offline play?
Logged

killermonkey

  • GES Programmer
  • Retired Lead Developer
  • GE:S Fanatic
  • *
  • Posts: 5,473
  • Reputation Power: 346
  • killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!
  • Offline Offline
    • DroidMonkey Apps
Re: Health Amount
« Reply #1 on: November 22, 2012, 05:09:29 pm »

Modify the python gamemode you are playing on so that in OnPlayerSpawn it calls:

player.SetMaxHealth( ### )
Logged

markpeterjameslegg

  • Did I fire six shots? Or only five?
  • 00 Agent
  • ***
  • Posts: 879
  • Reputation Power: 202
  • markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!
  • Offline Offline
Re: Health Amount
« Reply #2 on: November 22, 2012, 06:16:57 pm »

Hmmm... Not sure where to place the code, had a go but it errors in the console. Sorry KM, I used to program back in the days of B.A.S.I.C, don't know much about C++ or Python, although there are similarities.

I put images of the Python code and the error:-

Logged

killermonkey

  • GES Programmer
  • Retired Lead Developer
  • GE:S Fanatic
  • *
  • Posts: 5,473
  • Reputation Power: 346
  • killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!killermonkey is awe-inspiring!
  • Offline Offline
    • DroidMonkey Apps
Re: Health Amount
« Reply #3 on: November 22, 2012, 07:07:25 pm »

Not in OnLoadGameplay.... I said OnPlayerSpawn:

Code: [Select]
from GamePlay import GEScenario
import GEEntity, GEPlayer, GEUtil, GEWeapon, GEMPGameRules, GEGlobal

USING_API = GEGlobal.API_VERSION_1_0_0

class DeathMatch( GEScenario ):
def GetPrintName( self ):
return "#GES_GP_DEATHMATCH_NAME"

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 GetTeamPlay( self ):
return GEGlobal.TEAMPLAY_TOGGLE

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

# CUSTOM: Lowers the player's max health
def OnPlayerSpawn( self, player ):
  # Default max health is 160
player.SetMaxHealth( 120 )
# END CUSTOM

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()

Do note that Python is extremly sensitive to whitespace indentation. GES uses tabs for it's whitespace.
« Last Edit: November 22, 2012, 07:13:38 pm by killermonkey »
Logged

markpeterjameslegg

  • Did I fire six shots? Or only five?
  • 00 Agent
  • ***
  • Posts: 879
  • Reputation Power: 202
  • markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!markpeterjameslegg is awe-inspiring!
  • Offline Offline
Re: Health Amount
« Reply #4 on: November 22, 2012, 07:50:52 pm »

Not in OnLoadGameplay.... I said OnPlayerSpawn:

Sorry about that. It's sorted, thanks KM.
Logged
Pages: [1]   Go Up