GoldenEye: Source Forums

Debriefing => Questions, Help, & How To's => Topic started by: Deadly Porkchop on March 14, 2009, 01:08:34 am

Title: Disable body armor?
Post by: Deadly Porkchop on March 14, 2009, 01:08:34 am
Me and some friends play as a group normally and we all agree that (just like in the old days) body armor gives people a huuuge advantage. Which is nice most of the time. But we've wondered if there's a way to disable body armor to make it more of a struggle to survive opposed to just running for new body armor when yours runs low. Is there any way to disable body armor from spawning, or is it a map thing?
Title: Re: Disable body armor?
Post by: killermonkey on March 14, 2009, 01:40:10 am
We have implemented a LUA callback that disables body armor. If you want me to write you a custom deathmatch script that disables the body armor let me know :)
Title: Re: Disable body armor?
Post by: Deadly Porkchop on March 14, 2009, 11:08:05 pm
That would be awesome, thanks. Let me know how you want to communicate about this.
Title: Re: Disable body armor?
Post by: killermonkey on March 14, 2009, 11:45:49 pm
Ok buddy, I made it for you (took all of 10 seconds): http://www.divshare.com/download/6810244-470

Just plop the two files in your scripts/gameplay folder and type ge_gameplay dmnoarmor and you are set!

If you are really ambitious you can pretty much do ANYTHING with our LUA commands: http://wiki.goldeneyesource.net/index.php/Category:Lua
and learning LUA isn't that hard, and could be rewarding for custom LAN games or simple modifications.

A nice trick, if you want people to START with body armor but not be able to collect it, is to add: PlayerSetArmor(player, GE_MAX_ARMOR); to the PostPlayerSpawn(...) callback.

ex.
Code: [Select]
function PostPlayerSpawn( player )
          PlayerSetArmor(player, GE_MAX_ARMOR);
end
Title: Re: Disable body armor?
Post by: Deadly Porkchop on March 15, 2009, 12:07:53 am
Thanks man.
Title: Re: Disable body armor?
Post by: VC on March 15, 2009, 01:27:27 am
"If you are really ambitious you can pretty much do ANYTHING with our LUA commands"

Although, if you are VC-ambitious, you hound KM until commands are added. : )
Title: Re: Disable body armor?
Post by: Sp1nn3y on March 15, 2009, 03:14:50 am
"If you are really ambitious you can pretty much do ANYTHING with our LUA commands"

Although, if you are VC-ambitious, you hound KM until commands are added. : )

And thus is why we love you.
Title: Re: Disable body armor?
Post by: Mark [lodle] on March 15, 2009, 03:42:31 am
And the rage quit when none of it works :P
Title: Re: Disable body armor?
Post by: Doc.NO on March 15, 2009, 12:44:12 pm
If you are really ambitious you can pretty much do ANYTHING with our LUA commands
Hmmm, waiting for sound CB as well as GUI :D
Title: Re: Disable body armor?
Post by: Mark [lodle] on March 15, 2009, 02:35:32 pm
Make a new thread, outline what you want and we will see if it is plausible
Title: Re: Disable body armor?
Post by: VC on March 15, 2009, 05:03:29 pm
I've needed a sound callback since I started L&LD.  KM should be all over that, now that the release of 3.1 is completed.
Title: Re: Disable body armor?
Post by: drukqaddik on December 08, 2009, 06:39:17 am
ok. im gonna post here because it has the info i need in it already. i have an idea for a gamemode that i want to code in lua. havin a little trouble.

stole a line from VC's code for l&ld
constBaronRegenerationAmount = GE_MAX_HEALTH * 0.25;

not sure how to get it to work on a kill tho. i want it to work when

function PlayerKilled( victim, killer )
   if ( victim == killer ) then
      AddToPlayerScore( killer, -1 );
   elseif ( IsTeamplay() and GetPlayerTeam(killer) == GetPlayerTeam(victim) ) then
      AddToPlayerScore( killer, -1 );
   else
      -- In DM we add TEAM and PLAYER scores on a kill
      -- We don't care if teamplay is enabled, if its not this will be ignored
      AddToTeamScore( GetPlayerTeam(killer), 1 );
      AddToPlayerScore( killer, 1 );
   end
end

killer gets GE_MAX_HEALTH * 0.10 added and then when health is full to add armor. but i didnt see any lua "checks" to see if char has anything. maybe i just didnt look hard enough and i know this mode will be slaughter but i think it will be fun.


also cant get that spawn with armor to work on dmnoarmor( Dr. No Armor)
Title: Re: Disable body armor?
Post by: Mark [lodle] on December 08, 2009, 09:12:16 am
You looking for this: http://wiki.goldeneyesource.net/index.php/Lua_PlayerArmor or http://wiki.goldeneyesource.net/index.php/Lua_PlayerSetArmor
Title: Re: Disable body armor?
Post by: killermonkey on December 08, 2009, 01:38:51 pm
Remember the sequencing.

PrePlayerSpawn(..) is called BEFORE the player is put into the world with health and armor and PostPlayerSpawn(...) is called afterwards. If you spawn them with modified health/armor you must do it in PostPlayerSpawn.

Same theory goes with PreRoundBegin and PostRoundBegin in terms of gameplay changes. Where PostRoundBegin is called AFTER the players are respawned and the world is reset.
Title: Re: Disable body armor?
Post by: drukqaddik on December 08, 2009, 09:31:11 pm
ok. well, ill work on it later. anyone have dm in python layed out so i can edit some stuff for b4 to get it ready for the switch?
Title: Re: Disable body armor?
Post by: major on December 08, 2009, 09:45:00 pm
Here is GunGame:

http://wiki.goldeneyesource.net/index.php/GunGame_Py
Title: Re: Disable body armor?
Post by: drukqaddik on December 08, 2009, 11:12:10 pm
cool. ill see what i can come up with. seems way more clear than lua, but well see how that goes lol.
Title: Re: Disable body armor?
Post by: Mark [lodle] on December 09, 2009, 02:01:35 am
Yeah thats the whole reason for the switch. Makes coding the gamemodes easier and easier for us to bind c++ stuff to python meaning more stuff can be done.
Title: Re: Disable body armor?
Post by: drukqaddik on December 09, 2009, 02:17:56 am
ya. i see more variables available already
Title: Re: Disable body armor?
Post by: killermonkey on December 09, 2009, 03:50:12 am
NOTE THIS IS NOT FINAL

Code: [Select]
from GamePlay import PYBaseGamePlay

import GEEntity, GEPlayer, GEUtil, GEWeapon, GEMPGameRules, GEGlobal

class DeathMatch(PYBaseGamePlay):
def __init__(self):
super(DeathMatch, self).__init__()

def GetIdent(self):
return "DeathMatch"

def GetPrintName(self):
return "#GES_GP_DEATHMATCH_NAME"

def GetHelpString(self):
return "#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):
self.CreateCVar("dm_fraglimit", "0", "Enable frag limit for DeathMatch.")
self.LoadConfig()

def PreRoundBegin(self):
GEMPGameRules.SetAllowTeamSpawns( False )
GEMPGameRules.ResetAllPlayersScores()

def OnPlayerKilled(self, victim, killer, weapon):

#what exactly got killed?
if not victim:
return

#death by world
if not killer:
victim.IncrementScore( -1 )
return

if victim.GetId() == killer.GetId():
killer.IncrementScore( -1 )
elif GEMPGameRules.IsTeamplay() and killer.GetTeamNumber() == victim.GetTeamNumber():
killer.IncrementScore( -1 )
else:
# In DM we add TEAM and PLAYER scores on a kill
# We don't care if teamplay is enabled, if its not this will be ignored
team = GEMPGameRules.GetTeam(killer.GetTeamNumber())
team.IncrementScore( 1 )
killer.IncrementScore( 1 )

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.GetRoundsWon() + teamJ.GetScore()
mScore = teamM.GetRoundsWon() + teamM.GetScore()

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

if not GEUtil.IsValidPlayerIndex(i):
continue

player = GEUtil.GetMPPlayer(i)

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

And some shitty first-cut wiki documentation:
http://wiki.goldeneyesource.net/index.php/Category:Python
Title: Re: Disable body armor?
Post by: Mark [lodle] on December 09, 2009, 04:11:10 am
And some shitty first-cut wiki documentation:

:'(
Title: Re: Disable body armor?
Post by: drukqaddik on December 12, 2009, 04:20:25 am
cool. so when can i test it out? ;)
Title: Re: Disable body armor?
Post by: Mark [lodle] on December 12, 2009, 11:18:37 am
Send me a version of your gameplay (check profile for email) and i might see if we can grant you early access to beta 4 to see if it works. :P
Title: Re: Disable body armor?
Post by: drukqaddik on December 14, 2009, 04:43:11 am
guess i know what im doin tonight
Title: Re: Disable body armor?
Post by: drukqaddik on December 15, 2009, 12:38:34 am
is there any way i could get a copy of l&ld if it has been done yet? i need to see how a few things are used as far as defining one player vs all the others. i have the base set up i just need to define a few more things. once i get it set up i will submit it.

Spectre is what its called.
Title: Re: Disable body armor?
Post by: drukqaddik on December 15, 2009, 01:28:54 am
also how do i define a sound?
Title: Re: Disable body armor?
Post by: Mark [lodle] on December 15, 2009, 01:32:49 am
You cant define your own sound but you can play sounds all ready in the game. Have a look at the sound files in the script folder
Title: Re: Disable body armor?
Post by: drukqaddik on December 15, 2009, 01:35:54 am
so can i add a sound? im tryin to get something like !voodoo. but instead of controlling the player using i want it to make a sound come from all of the other players defined
Title: Re: Disable body armor?
Post by: Mark [lodle] on December 15, 2009, 02:15:30 pm
Use !voodoo as its bound to a key
Title: Re: Disable body armor?
Post by: drukqaddik on December 15, 2009, 11:18:57 pm
K