My first WIP gamemode ever, well... first steps in lua too...
75 replies, posted
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.
[media]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[/media]
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 :)
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:
[media]http://free0.hiboox.com/images/4109/16e2c8bb8765c52686f06a83aee46cf1.jpg[/media]
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:
[img]http://free0.hiboox.com/images/4209/diapo9e358bac47c8b1aa50ee8bb6ade448e9.jpg?17[/img]
[img]http://free0.hiboox.com/images/4209/diapod1e66bee87727dfd30ccf99c992c060d.jpg?39[/img]
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 :P
Otherwise, lookin' good :)
[QUOTE='-[ Fizzadar ]-;17791901']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 :P
Otherwise, lookin' good :)[/QUOTE]
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.
[QUOTE=die_angel;17792174]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.[/QUOTE]
I *think* you do not include the "materials/" but I'm not sure.
[QUOTE=Levybreak;17792475]I *think* you do not include the "materials/" but I'm not sure.[/QUOTE]
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.
[img]http://free0.hiboox.com/images/4209/diapo6bb2f53dac56fc250aea45f3a17e18c0.jpg?8[/img]
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.
[img]http://free0.hiboox.com/images/4209/diapo862b03b132cebebcb7221ebed3e38bbe.jpg?19[/img]
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 :D
how did you get it to go black in the background?
[QUOTE=Roleplay World;17834639]how did you get it to go black in the background?[/QUOTE]
[lua]surface.SetColor(0,0,0,255)
surface.DrawRect(0,0,ScrW(),ScrH())[/lua]
I never thought it would be hard.
On another note, if you're looking for something to make your script a little more original, there was one idea that I've had that has never been in a roleplaying script.
Just think, Sims build mode, in an RP gamemode. It'd give more possibility for something to do.
[QUOTE=GreyIOutcast;17834745][lua]surface.SetColor(0,0,0,255)
surface.DrawRect(0,0,ScrW(),ScrH())[/lua]
I never thought it would be hard.
On another note, if you're looking for something to make your script a little more original, there was one idea that I've had that has never been in a roleplaying script.
Just think, Sims build mode, in an RP gamemode. It'd give more possibility for something to do.[/QUOTE]
*nod* i will think about it, but i'm nowhere near the point i could make that for now.
For the blackout, Drawrect is less than preferable because when you hit escape the screen goes back to normal, i use:
[lua]
local Sup = {}
Sup[ "$pp_colour_addr" ] = 0
Sup[ "$pp_colour_addg" ] = 0
Sup[ "$pp_colour_addb" ] = 0
Sup[ "$pp_colour_brightness" ] = 0
Sup[ "$pp_colour_contrast" ] = 0
Sup[ "$pp_colour_colour" ] = 0
Sup[ "$pp_colour_mulr" ] = 0
Sup[ "$pp_colour_mulg" ] = 0
Sup[ "$pp_colour_mulb" ] = 0
DrawColorModify( Sup )
[/lua]
I don't think i will have much to show today, this morning i decided that i should change the name of ALL my functions and variables... TWICE...
still repairing...
Want someone else in your "team" perhaps? I r to learing Lua atm.
Well, for now I prefer to work alone, but thanks for the offer.
Okay as i predicted i spent most of the day fixing what i broke, i THINK it's pretty much working again as expected.
In the meantime i finally managed to decompile a citizen/refugee model, cram into it the playermodel AND npc anims (who know, i might have a use for them) and recompile it successfully.
After several hours of pain between the decompiler crashing on me and having to readjust the uv coordinates on each of the seven lods, this is the result, and it works perfectly ingame.
[img]http://free0.hiboox.com/images/4209/2af54d843a53d7dc2eda9534c9d8ea7a.jpg[/img]
I've been having waaay too much fun with the qc command "$texturegroup skinfamilies" and i managed to integrate into the model 7 different skins i found on garrysmod.org, i could add more but...
I have trouble finding skins that are both satisfying and kinda stick to my vague game concept idea (yeah i like those scrubs outfits, i think it would look great in a post a pocalyptic zombie world, tho it wouldn't protect that much i guess...).
Anyway, that's where i'm headed for the "wearable" concept, of course i want to also have outfits that use different models, but hey, every games recycle stuffs like this.
Of course, just in case you're wondering, all the credits will be given to their respective creators, unless i actually decide to make every single texture from scratch (gulp).
Beautiful. This cannot be your first (or maybe it's just your first gamemode that you've showed facepunch?)
Wait, you have playermodels of those? Or are you setting civilian skins on those playermodels? What what whaaaat?
[QUOTE=cas97;17851103]Beautiful. This cannot be your first (or maybe it's just your first gamemode that you've showed facepunch?)[/QUOTE]
No, seriously it's my first gamemode, the first time i actually attempt something, instead of looking around what has already been done.
I do have some previous programing experience but i didn't like the lua syntax, well... on second thought it's not that bad ...
[QUOTE=PoliticalM;17851980]Wait, you have playermodels of those? Or are you setting civilian skins on those playermodels? What what whaaaat?[/QUOTE]
I decompiled the default HL2 citizen npc, added the playermodel animations, and added skin settings for it so it can use those reskins sets i got on garrysmod.org without needing a distinct model for each of them, i can now use Ent:SetSkin( <value between 0-6> ) and it changes the texture set of the model, one model for the 7 outfits. It has both the playermodel animations and the npc animations so it's pretty flexible.
I don't know if the way the playermodel selection work would be able to use the skins, but for a gamemode it works fine with Ent:SetModel()
I still have to do the same with the 13 other faces but it's good enough for a proof of concept.
EDIT:
I jsut discovered that the faces from the citizen/rebel group1,2,3 are actually lightly different from eachothers, i'm just thinking about the possible .. implications .. of adding facemap skins on top of the clothes skin.
that would make it like... each possibilities offered by one face is multiplied by 3, so instead of 9 male and 6 females i would have 27 males and 18 females
You are making this gamemode with an attitude that pretty much guarantees success. Not many people around here can claim that ya know. (Including me)
Sorry, you need to Log In to post a reply to this thread.