GoldenEye: Source Forums

  • August 23, 2017, 04:39:15 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  


Pages: [1] 2 3 ... 10
 on: August 19, 2017, 09:12:19 AM 
Started by papel - Last post by Entropy-Soldier should be fine, the first error would be caused by the file using it incorrectly.  It seems like your biggest issue right now is indentation and not including all the needed callbacks.

Indentation is a huge part of the python syntax, most of what would be accomplished by curly brackets in other languages is accomplished by indentation in python.  Anything on the same indentation as another statement is considered to be in the same scope.  Right now you have lines like "self.warmupTimer = GEWarmUp( self )" outside of any callbacks which will cause plenty of issues.  You'll want to include the "def __init__( self ):" definition, similar to the one in arsenal, and put that there.  More or less just do that for all the statements and you should be good.  Make sure they appear inside the right callback, otherwise they won't be executed at the correct time.

Just remember:

Code: [Select]
def addNumbers(a, b):
    return a + b

could appear in C++ as

Code: [Select]
int addNumbers(int a, int b){return a + b;}


Code: [Select]
def addNumbers(a, b): return a + b

would not work in python because it doesn't have proper indentation.  Same with

Code: [Select]
def addNumbers(a, b): 
return a + b

 on: August 19, 2017, 01:17:51 AM 
Started by papel - Last post by papel
Entropy, thank you for your support

I think I did it the way you asked, but in addition to the errors below, I believe I need to change something in the file. The following is the log

************LOG ERROR****************
Attempting to load scenario: LTK
Traceback (most recent call last):
  File "c:\sourceges\gesource\python/ges\", line 46, in LoadScenario
    scenario = getattr( sys.modules[module], scenario_name )()
KeyError: 'GamePlay.LTK'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\sourceges\gesource\python/ges\", line 50, in LoadScenario
    __import__( module, globals(), locals() )
  File "c:\sourceges\gesource\python/ges\GamePlay\", line 31
    self.warmupTimer = GEWarmUp( self )
TabError: inconsistent use of tabs and spaces in indentation
Scenario load failed for LTK! Reverting back to DeathMatch.

from .DeathMatch import DeathMatch
from .Utils.GEWarmUp import GEWarmUp
from .Utils import GetPlayers
import GEPlayer, GEUtil, GEMPGameRules as GERules, GEGlobal as Glb


# LTK is just deathmatch with no armor, a high damage multiplier, and popout help.
class LTK( DeathMatch ):
    def GetPrintName( self ):
        return "#GES_GP_LTK_NAME"

   self.warmupTimer = GEWarmUp( self )

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

    def GetGameDescription( self ):
        if GERules.IsTeamplay():
            return "Team LTK"
            return "LTK"

    def OnLoadGamePlay( self ):
        super( LTK, self ).OnLoadGamePlay()
        self.ltk_SetDamageMultiplier( 1000 )
        GERules.SetSpawnInvulnTime( 0, True )


    def OnUnloadGamePlay(self):     
        self.warmupTimer = None
    def OnPlayerConnect( self, player ):
        player.SetDamageMultiplier( 1000 )

    def OnPlayerSpawn( self, player ):
        if player.IsInitialSpawn():
            GEUtil.PopupMessage( player, "#GES_GP_LTK_NAME", "#GES_GPH_LTK_GOAL" )

    def OnRoundBegin( self ):
        super( LTK, self ).OnRoundBegin()

    def ltk_SetDamageMultiplier( self, amount ):
        for player in GetPlayers():
            player.SetDamageMultiplier( amount )

import sys
import GEGamePlay, GEUtil
from GEGlobal import PY_BASE_DIR

import GamePlay
from GESFuncs import *

class PYGamePlayManager( GEGamePlay.CGamePlayManager ):
    def __init__( self ):
        super( PYGamePlayManager, self ).__init__()

        import reimport
        reimport.reimport( GamePlay )

    def LoadScenario( self, scenario_name ):
        found_scenario = FindModule( GamePlay, scenario_name )
        if not found_scenario:
            GEUtil.Warning( "Failed to find scenario %s!\n" % scenario_name )
            return None
            # Assign the found scenario to ensure we have the right case
            scenario_name = found_scenario
            module = "GamePlay.%s" % scenario_name
            scenario = None

                # Try to load immediately, fallback to import if new class
                scenario = getattr( sys.modules[module], scenario_name )()
                print( "Loading scenario %s from cache" % scenario_name )
            except KeyError:
                    __import__( module, globals(), locals() )

                    scenario = getattr( sys.modules[module], scenario_name )()

                    print( "Loading scenario %s from disk" % scenario_name )

                except ImportError:
                    PrintError( "Failed to load scenario %s\n" % scenario_name )

            if scenario and not CheckAPI( sys.modules[module], GEGlobal.API_GP_VERSION ):
                GEUtil.Warning( "Scenario load FAILED due to API mismatch.\n" )
                return None

            return scenario

pyGamePlayMangObj = None

def GetManager():
    global pyGamePlayMangObj

    if not pyGamePlayMangObj:
        pyGamePlayMangObj = PYGamePlayManager()

    return pyGamePlayMangObj

def PurgeManager():
    global pyGamePlayMangObj
    pyGamePlayMangObj = None

 on: August 18, 2017, 06:06:02 PM 
Started by papel - Last post by Entropy-Soldier
Yep, you'll need to modify the LTK gameplay file ( to use the GEWarmUp module.  They're all just text documents so they can be edited in the IDE of your choice.

Arsenal is probably the easiest mode to reference for implementation details, look for all instances of "self.warmupTimer" and be sure to import the module "GEWarmUp".  It's overall pretty simple but since there isn't a whole lot of documentation on it at the moment feel free to let me know if you need any help.

 on: August 18, 2017, 12:14:46 PM 
Started by papel - Last post by papel
Good afternoon people.
My question may seem strange, however, because of the operation on my server, I need ltk to function as the uplink. That is, the round restarts when a second player enters. I believe I would have to change the file.

Thank you all

 on: August 14, 2017, 06:18:57 AM 
Started by papel - Last post by Entropy-Soldier
Awesome!  I'm glad everything worked well!

 on: August 14, 2017, 05:23:04 AM 
Started by papel - Last post by papel

All perfectly correct.

It worked as expected. The best players in the match will appreciate your support.

Thank you so much, my friend!

 on: August 10, 2017, 01:14:01 AM 
Started by Jeron [SharpSh00tah] - Last post by namajnaG
Those are fantastic news, glad to hear everything is well and much better Sharp! Hope to see you around sometime!

 on: August 09, 2017, 04:46:04 PM 
Started by Jeron [SharpSh00tah] - Last post by basstronix
It's so good to hear that you've been doing well brother!

 on: August 09, 2017, 03:42:04 PM 
Started by Jeron [SharpSh00tah] - Last post by kraid
I'm glad that things worked out for you, Sharp.

 on: August 09, 2017, 02:23:49 PM 
Started by Jeron [SharpSh00tah] - Last post by Troy
That's pretty cool.  I guess it just show you that with a little bit of hard work, it is just a matter of time until things turn around.

Pages: [1] 2 3 ... 10