GoldenEye: Source Forums

  • November 21, 2024, 12:29:30 pm
  • Welcome, Guest
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: GES Python Library now on GitHub!  (Read 27868 times)

0 Members and 1 Guest are viewing this topic.

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
GES Python Library now on GitHub!
« on: April 30, 2013, 11:16:39 am »

Ok everyone, great news!

I have posted the v4.2.3 python library up on my GitHub repository. I will be pushing all future updates to this repository so that plugin authors can keep track of our API.

Feel free to submit bugs, pull requests, or anything else to this repo and I will incorporate them into GES build.

Please note, the GES Python Library is now licensed under the GNU GPL v3, please read the LICENSE file for more information.

Logged

Joe

  • Secret Agent
  • **
  • Posts: 139
  • Reputation Power: 54
  • Joe has an aura about them.Joe has an aura about them.Joe has an aura about them.Joe has an aura about them.Joe has an aura about them.Joe has an aura about them.Joe has an aura about them.Joe has an aura about them.Joe has an aura about them.Joe has an aura about them.
  • Offline Offline
Re: GES Python Library now on GitHub!
« Reply #1 on: May 04, 2013, 05:52:04 pm »

The game play manager is failing to load, I've tried launching DAD mode and Deathmatch mode:

Quote
File: ges\server\py\ge_pygameplay.cpp
Line: 761
Assert: Failed to load python game play manager!
Logged
Free games:FPS + RTS: Renegade X & Battlezone 1.5,RTS: 7 Kingdoms & Open Red Alert, TBS:Hedgewars, playcatan.com & www.wesnoth.org

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: GES Python Library now on GitHub!
« Reply #2 on: May 04, 2013, 06:03:53 pm »

Yah, do NOT replace your files locally. This code relies heavily on C++ changes from v4.2.3.

Only use this for the new Eclipse predefines for now.
Logged

Troy

  • GE:S Coder
  • 00 Agent
  • ***
  • Posts: 821
  • Reputation Power: 260
  • Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!
  • Offline Offline
Re: GES Python Library now on GitHub!
« Reply #3 on: May 20, 2013, 12:44:49 am »

The tournamentdm file is out of date.

http://forums.geshl2.com/index.php/topic,7007.0.html

Also, maybe you should think about including Arsenal?

http://forums.geshl2.com/index.php/topic,7002.0.html
« Last Edit: May 20, 2013, 12:46:28 am by Troy »
Logged
Complete - Arsenal, One Bullet is Enough, Tournament DM v2, TurboDM
Defunct - Agent Under Fire
VC - Being such a dick, KM must be stroked before springing into action.

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: GES Python Library now on GitHub!
« Reply #4 on: May 20, 2013, 03:08:30 am »

I haven't pushed my changes to github yet... cool your jets
Logged

Troy

  • GE:S Coder
  • 00 Agent
  • ***
  • Posts: 821
  • Reputation Power: 260
  • Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!
  • Offline Offline
Re: GES Python Library now on GitHub!
« Reply #5 on: May 20, 2013, 03:13:52 am »

I wasn't rushing you...?  I just was making a statement.
« Last Edit: May 20, 2013, 03:16:19 am by Troy »
Logged
Complete - Arsenal, One Bullet is Enough, Tournament DM v2, TurboDM
Defunct - Agent Under Fire
VC - Being such a dick, KM must be stroked before springing into action.

Troy

  • GE:S Coder
  • 00 Agent
  • ***
  • Posts: 821
  • Reputation Power: 260
  • Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!
  • Offline Offline
Re: GES Python Library now on GitHub!
« Reply #6 on: May 24, 2013, 08:34:35 pm »

I've had a look at Arsenal on GitHub.  There's two things that I've noticed:

1. Line 77 can be changed to this:

Code: [Select]
if weaponList != weaponListCopy

(I highly doubt someone is going to change the CVar value of ar_randomweapons to 1 in the code itself.  If they did, all that would happen when the admin reloaded the game mode is it would revert to the default list and then when re-shuffle the weapons on round begin.  The same thing would happen if a game mode other than Arsenal was being played and then it was loaded in.)

2. Line 326 can be changed to this:

Code: [Select]
for i in range( self.GetLevel( player ) + 1, maxLevel ):

Also, I don't like the fact that you're showing the final weapon if the player presses g after they've won the round.  The Arsenal box shouldn't come up at all.  Even though the player's weapon hasn't changed, they have already completed that level.
« Last Edit: May 24, 2013, 09:25:03 pm by Troy »
Logged
Complete - Arsenal, One Bullet is Enough, Tournament DM v2, TurboDM
Defunct - Agent Under Fire
VC - Being such a dick, KM must be stroked before springing into action.

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: GES Python Library now on GitHub!
« Reply #7 on: May 24, 2013, 08:35:57 pm »

Thank you for the feedback. I incorporated those changes with exception to your last comment.
« Last Edit: May 24, 2013, 09:23:22 pm by killermonkey »
Logged

Troy

  • GE:S Coder
  • 00 Agent
  • ***
  • Posts: 821
  • Reputation Power: 260
  • Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!
  • Offline Offline
Re: GES Python Library now on GitHub!
« Reply #8 on: May 25, 2013, 12:43:50 am »

I noticed that TDM uses the old PlaySoundToTeam.  I guess it should be changed to PlaySoundTo now.
Logged
Complete - Arsenal, One Bullet is Enough, Tournament DM v2, TurboDM
Defunct - Agent Under Fire
VC - Being such a dick, KM must be stroked before springing into action.

Troy

  • GE:S Coder
  • 00 Agent
  • ***
  • Posts: 821
  • Reputation Power: 260
  • Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!
  • Offline Offline
Re: GES Python Library now on GitHub!
« Reply #9 on: May 25, 2013, 05:26:10 am »

I've made a change to Arsenal's PrintWeapon function:

   
Code: [Select]
def PrintWeapons( self, player ):
if not player or self.GetLevel( player ) > maxLevel:
return

arWeapons = ""
for i in range( self.GetLevel( player ), maxLevel ):
name = GEWeapon.WeaponPrintName( weaponList[i][0] )
arWeapons += "Level %i: #%s\n" % ( i + 1, name )

if arWeapons.count( ":" ) == 5:
break

arWeapons += "\nFinal level %i: #%s\n" % ( len( weaponList ), GEWeapon.WeaponPrintName( weaponList[-1][0] ) )
GEUtil.PopupMessage( player, "#GES_GP_ARSENAL_NAME", arWeapons )

I do not like the function you made because it shows the next 5 levels and always the final level.  This doesn't work because if you're on the final level, and press g, it shows that one.  I've corrected that by always showing the current level, the next four levels and the final level.  The reason I've chosen this route is because you have not bypassed your weapon, so it should show it in the popup window as you're still on it.  This could be good for if you've joined a game late and you're wanting to know which level you're been given or if you've been stuck on a level and want to refresh your memory which it is.  With my way, a return statement is only needed when the player wins the round.  If you were to always show what's in the future, a return statement would have to be written for when the player's on the final weapon and when he has won the game.  Also, if a player is on the final weapon, they're hitting g trying to find out what's left, and they're not seeing anything, they might get confused and wonder why nothing is happening.

I'd also like to note that making final weapon all capitalized like so "FINAL WEAPON" looked like hell.  You've already drawn enough attention to that line with a double line break.  That is plenty.
« Last Edit: May 25, 2013, 08:14:28 am by Troy »
Logged
Complete - Arsenal, One Bullet is Enough, Tournament DM v2, TurboDM
Defunct - Agent Under Fire
VC - Being such a dick, KM must be stroked before springing into action.

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: GES Python Library now on GitHub!
« Reply #10 on: May 25, 2013, 08:36:08 pm »

I settled with this compromise solution, it looks great in game too:

Code: [Select]
	def PrintWeapons( self, player ):
# Player's at the max level don't see this message
if not player:
return

curr_level = self.GetLevel( player )
if curr_level == maxLevel:
GEUtil.PopupMessage( player, "#GES_GP_ARSENAL_NAME", "You are on the final level!" )
return

# Start with the player's current level
arWeapons = "Current Level %i: #%s\n\n" % ( curr_level + 1, GEWeapon.WeaponPrintName( weaponList[curr_level][0] ) )

# Output up to the next 4 weapons for this player, not including the final weapon
count = 0
for i in range( curr_level + 1, maxLevel ):
count += 1
arWeapons += "Level %i: #%s\n" % ( i + 1, GEWeapon.WeaponPrintName( weaponList[i][0] ) )
if count == 4:
break

# Tack on the final weapon
arWeapons += "\nFinal Level %i: #%s\n" % ( len( weaponList ), GEWeapon.WeaponPrintName( weaponList[-1][0] ) )

GEUtil.PopupMessage( player, "#GES_GP_ARSENAL_NAME", arWeapons )
Logged

Troy

  • GE:S Coder
  • 00 Agent
  • ***
  • Posts: 821
  • Reputation Power: 260
  • Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!
  • Offline Offline
Re: GES Python Library now on GitHub!
« Reply #11 on: May 26, 2013, 12:17:36 am »

That looks pretty damn good from the code.
« Last Edit: May 26, 2013, 04:48:25 am by Troy »
Logged
Complete - Arsenal, One Bullet is Enough, Tournament DM v2, TurboDM
Defunct - Agent Under Fire
VC - Being such a dick, KM must be stroked before springing into action.

Troy

  • GE:S Coder
  • 00 Agent
  • ***
  • Posts: 821
  • Reputation Power: 260
  • Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!Troy is awe-inspiring!
  • Offline Offline
Re: GES Python Library now on GitHub!
« Reply #12 on: May 26, 2013, 04:47:56 am »

I've tested your code.  In my opinion, some adjustments need to be made.  We can't have a double line break after the current level.  The reason being is this:



I think it's best to make Current Level x and Final Level x a lower case l.  Also, I don't think a double line break needed if there isn't a gap between the levels.  Lastly, you forgot a return statement for when the player wins.

Code: [Select]
	def PrintWeapons( self, player ):
if not player:
return

lvl = self.GetLevel( player )
if lvl > maxLevel:
return

if lvl < maxLevel:
# Start with the player's current level
arWeapons = "Current level %i: #%s\n" % ( lvl + 1, GEWeapon.WeaponPrintName( weaponList[lvl][0] ) )

# Output up to the next 4 weapons excluding the final weapon
count = 0
for i in range( lvl + 1, maxLevel ):
count += 1
arWeapons += "Level %i: #%s\n" % ( i + 1, GEWeapon.WeaponPrintName( weaponList[i][0] ) )
if count == 4:
break

# Tack on the final weapon
if lvl + 5 < maxLevel:
arWeapons += "\nFinal level %i: #%s\n" % ( len( weaponList ), GEWeapon.WeaponPrintName( weaponList[-1][0] ) )
else:
arWeapons += "Final level %i: #%s\n" % ( len( weaponList ), GEWeapon.WeaponPrintName( weaponList[-1][0] ) )

GEUtil.PopupMessage( player, "#GES_GP_ARSENAL_NAME", arWeapons )
else:
GEUtil.PopupMessage( player, "#GES_GP_ARSENAL_NAME", "You are on the final level!" )

Gapped



Not Gapped

« Last Edit: May 26, 2013, 07:28:19 am by Troy »
Logged
Complete - Arsenal, One Bullet is Enough, Tournament DM v2, TurboDM
Defunct - Agent Under Fire
VC - Being such a dick, KM must be stroked before springing into action.
Pages: [1]   Go Up