GoldenEye: Source Forums
Global Communications => Development Media => killermonkey's Blog => Topic started by: killermonkey on March 12, 2008, 05:28:03 am
-
Killer Monkey here, I am taking over Anthony's blog for today since I just made a significant step in coding. I have FULLY implemented LUA game modes! Thats correct, it has been extremely difficult, but with the help of Scott's base code I was able to do it over the past 5 days. In order to achieve this, I employed the following schematic:
(http://img.photobucket.com/albums/v687/killermonkey01/GE%20Source/blog_flowchart.jpg)
As you can see, the classes at the top are CGERules, CGEPlayer, and Gameinterface. These three classes are what the server uses to define the playing of a game.
CGERules are logical functions and events that are called and can be acted on. In these calls, CGERules calls functions from CGELUAGamePlay that interfaces with LUA. In the absence of any defined LUA functions, it happily goes about what it would do normally (IE NO GAMEPLAY). When the rules are created at map load, the LUA classes are also loaded into memory using the helper classes CGEGameModeSystem and CGEGameMode. These classes store the various LUA gamemodes that are detected in the 'scripts/gameplay/' folder. During a course of play any gamemode can be loaded at any time and it will restart the round and start every player on a clean slate!
CGEPlayer calls CGELUAGamePlay to get definitions that affect the player, such as whether or not he should respawn, his current armor/health level, and how many times he died (in this case for YOLT).
GameInterface is where all the magic begins. This is called upon initialization of the server dll and calls the CGELUAGamePlay's init() function that loads LUA. That means LUA remains loaded until the server is shutdown making level loads highly efficient and also maintains stability between map sessions by remembering your last Game Mode and reloading it for you.
Finally, all you, the server owner, has to do is create a .lua file and .txt file that defines the gameplay for the parser. The LUA file will contain the functions called by CGELUAGameplay, you will also have access to a plethora of Call Back functions defined to set and retrieve data necessary to modify the gameplay. All of this code is server side, the only thing the client will see are UserMessages to update their HUD/VGUI windows!
-
Well done mate :]
You are always welcome to blog here.
-
gaddam i wish i had a fucking clue what you were talking about
-
generally i read the programmer things, and just nod my head and pretend to understand. but i actually think i got this this time haha.
hey this means we get to play with trying out a lot of game mods without breaking the core code too since its all done through scripting.
-
Correct, I am working on a simpliler and more direct model for the Wiki, don't worry LoFi :)
-
gaddam i wish i had a fucking clue what you were talking about
-
gaddam i wish i had a fucking clue what you were talking about
-
:o LUA is probably the simplest of codings to learn starting out. This is definitely a big step, and I expect to have a shit load of game modes made by the community, and not just the developers!
Thanks goes out to all who made this possible!
-
Thanks goes out to all who made this possible!
Your welcome. I take full credit for all this work.... :P Just kidding Killermonkey and Anthony. Great job guys! :)
-
Thats correct, it has been extremely difficult, but with the help of Scott's base code I was able to do it over the past 5 days
And Scott ;)
-
LUA rocks :D It's good to see things are in progress.
-
I've been really enjoying these blogs anthony and killermonkey..PLEASE keep them coming so I can hear how progress is going :)