My first WIP gamemode ever, well... first steps in lua too...

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.

http://free0.hiboox.com/images/4109/adad01042d8b8b07ead583cdf43b1d78.jpg[/media]
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.

[media]http://free0.hiboox.com/images/4109/ba89618e29989964a2b39daae9ddd435.jpg[/media]
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

[media]http://free0.hiboox.com/images/4109/9fdd3527f2d32c2b79de2a2dd74b353d.jpg[/media]
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.

[media]http://free0.hiboox.com/images/4109/48ad363d5cb6fb019db76ac9d7d4dc1e.jpg

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.

well i think it looks greate, and if it is your first script, well then it is some Good work :slight_smile:

Looks like progress keep coding and you will get better. I hope it goes well.

Nice! Well there is a good way of making things! I always start making functionality first and later VIsual… And I dot some shitty derma menu. That at the end I understand fuck what I did! xD

First shot?Isn’t bad.

This is the first guy i have ever seen who isn’t the idea guy,he is doing a ton of LUA work!
Keep it up!

Today i’ve been writing mostly helper functions to prepare for the character creation:

-Check sanity on text only strings.
-Check sanity on text only number only strings.
-Capitalise words (for player names).
-Round numbers for display.
-Count number of Identities for a given player.
-Populating the available face list.
-Stubbing of the Character creation con command.

I added a characterlist refresh concommand to be called as soon as the panel displays (so you don’t have to hit refresh, and an interesting oddity happened, the Umsg to show the character list arrive “too early” on player spawn, wich in turn makes the character con command to be blocked (
RunConsoleCommand blocked - sent before player spawned )

So i added a 1 second timer before triggering the umsg.

Yeah it’s my first real shot at lua, i have my personal gripe about it’s syntax but otherwise it isn’t too bad.

-EDIT-
Thought i might add this:

http://free0.hiboox.com/images/4109/16e2c8bb8765c52686f06a83aee46cf1.jpg

Today’s update, i made a preliminary version of the character creation form, hold FirstName, LastName, Sex and CharacterID picture

I’m going to use ids for the picture instead of full paths because in the event i decide to update, lets imagine for a minute, more characters it will make potentially LESS errors than hardcoding the model paths.

so here it is:

http://free0.hiboox.com/images/4209/diapo9e358bac47c8b1aa50ee8bb6ade448e9.jpg?17

http://free0.hiboox.com/images/4209/diapod1e66bee87727dfd30ccf99c992c060d.jpg?39

The face list reload if you change the gender pull down list, default to male.

I’m encountering a little roadblock however, i would like a little icon to display near first/last name when they are “compliant” with the naming rules (no spaces, no numbers or symbols) and a little cross when they fail the check, but they show as pink checkers, i’m sure about the file path considering i copied it from Gmod’s gcfs but do i have to precache it or something?

Looks nice! Word of advice on the code, don’t use NWBool for stuff that doesn’t need to be “public”. NWvars are sent to all users, so everyone knows about every NW, if you’re doing “user settings” I’d keep it linear, if you get me :stuck_out_tongue:

Otherwise, lookin’ good :slight_smile:

Thanks, i just replaced the NWBools by ply.vars wich are synced Server -> Client through Umsg.

Do you have any idea why the icons do not show? i’m trying to use “materials/gui/silkicons/check_off” for instance.

I think you do not include the “materials/” but I’m not sure.

You’re right -_- i feel stupid. removing materials/ solved it.

I revamped the character creation page, it now has a “spell check” for First and last name (it puts a green mark if the name contains no numbers, spaces or symbols)

I also changed the position of the face selection box, it was kinda annoying me to have no “feedback” for the user of what face he actually selected, this is now solved with a nifty DModelPanel.

I’m now very close to the make the final part wich is adding the character to the server, with all the sanity checks required.

Stay tuned.

http://free0.hiboox.com/images/4209/diapo6bb2f53dac56fc250aea45f3a17e18c0.jpg?8

Very nice.

I like the spell check sign.

Tiny update, initially i was thinking about making a complex system with error messages popping near the field that needs fixing and where the server send you back what is wrong with your character, i moved to a much simpler way, the create button in grayed out as long as all the checks aren’t green.

Now i’m thinking of adding a button to “check for availability” of your character name. that you need to press before the Create button become available.

EDIT:
Or maybe have the “Create character” button first be labeled “check for availability” and if the server give the green light, the button become “Create character”

Something like that…

[editline]07:05AM[/editline]

It seems i can’t sleep, so i’ve been rearranging the Character creation window a little.

http://free0.hiboox.com/images/4209/diapo862b03b132cebebcb7221ebed3e38bbe.jpg?19

It now features a “check for availability” button for your name, this button is grayed out as long as your name doesn’t comply to the rules.
Also the final little checkmark that unlock the “create character” button only goes green if the server gives you the “ok” for the name you chose, i’m currently working on the info popups that display when you chose a name that is already in use or which contain one of the banned words ("stuffs like Admin, or swear words, whatever i put in there i guess)

Of course ,I don’t know if i already mentioned it, but i double check everything one more time on the server’s side, well … at least everything that is important.

It’s looking better and better, Keep up the good work.

Lookin’ good, what’s the overall gamemode idea?

Well, i don’t have a very clear roadmap at the moment, i’m just writing what i consider to be the core elements i will need no matter where i’m going after.

I envision some sort of “simulated environement” , peoples will scream “yet another RP mod” but i don’t think it’s that much of a RP gamemode.

My base idea is , a world populated with zombies, a certain time after the initial outbreak, players are still human and need to survive, gather food, shelter, weapons.
The gamemode isn’t supposed to push players into a specific gameplay, i want it to be a really immersive and non restrictive experience.
Even if the setting is a post zombie outbreak, it’s not a gamemode that is about bashing zombies day and night like L4D, it’s about the players, the zombies are only a setting to add pressure on the player’s minds.
I want to add numerous ways for the players to work together, aswell as numerous ways for players to betray eachothers.

It’s a bit like throwing a couple of lab rats into a maze and see what happens i guess :smiley:

how did you get it to go black in the background?