Okay this might not be amazing, i might not have leet amazing things to show, but at least i’m doing it myself, and from scratch. I thought i might create my own thread for this gamemode, so if peoples want to post constructive criticism, well fire away.
I also do realise that for my first ever lua script it might be a wee bit ambitious, but i had no fantastic ideas for making a swep or a sent, i will get there with a gamemode eventually anyway.
I’m thinking about using this post as a sort of log of what i’m doing on my gamemode development adventure.
I wanted to make some sort of logon system into my gamemode so the first thing i did was to find a way to hide the view temporarly and ghost the player in a spectator ish mode.
Then i started making the derma menu, the server use a mix of Networked booleans and umessages to control the client’s screen and wich menus to show, the characters use tweaked SpawnIcons.
I added those nifty little DermaMenu to control each character slots, it’s just a test character list and i hadn’t made any persistent storage at this point, it’s just stubbed so the server send the infos for each character tag and the client displays them.
When there are more than 3 a scrollbar appear
If you hit delete it pop this small menu to ask you to confirm, i’m not sure i like it this way, i rather see it like a tree menu coming from the first one, it would be more clear.
The create character button only open a dummy derma panel for now so i didn’t bother screening it.
The refresh button trigger a flushing of the character list and send a con command to the server wich re fetch the character list and pump it back to the client through umesg.
Since con commands can be easily manipulated, i make a minimum of checks on the server side, for example all the con commands related to this menu are only listened to as long as you are in logon state.
Don’t mind the filler text… -_-
This new panel is my first ‘persistent’ database attempt,on Logon every New steamID gets added to a table and i keep track if they accepted the server 'rules, aka this panel, if you click the refuse button it simply disconnect you, if you hit accept it will remember it so that next time you connect it passes you directly to the character selection screen.
I’m using Sqlite for now but i’m keeping all the database functions together so if i decide to change my DB system i only need to rewrite one script. All the tables self install if they do not exist yet.
Also all the texts are kept in a localisation file for easy translation.
I’m not exactly happy with how this panel look but it’snot the most important element for now, it’s a vgui.HTML panel, but i don’t like the “see through” scrollbar, if someone has a better method to display scrollbar enabled non modifiable text, i’m all ears.
Next step i think i need to write a basic character db, write the character creation/deletion process and get rid of my stub character data.