[release][h2]Forgotten Story[/h2]
Forgotten Story is a RPG-like gamemode I've been redoing for way too many times now.
Every time I restarted it, though, I had learned a lot in the process.
This time I feel I'm going to finish it, and made a thread at a server's forums. ( original: [url]http://carbonicservers.com/showthread.php?tid=379[/url] )
Now I've decided to move it over to facepunch and give you guys a look at it as well.
[/release]
[release][h2]Inventory[/h2]
So the first thing I did was making an inventory, which ended up as:
[video=youtube]http://www.youtube.com/watch?v=cOQ5r6TYhVI[/video]
After some work it became:
[img]http://i.imgur.com/YY1C9.png[/img]
As you can see armor parts now fully render.
[/release]
[release][h2]Armor[/h2]
Then I decided to make armor.
The first problem I had with this was deciding how to make it easier to create armor, and came up with a simple solution.
Everyone has probably seen PAC, so making something that works in a similar way would make it possible to create armor for everyone, whether you know lua or not.
Instead of making an addon, I made a swep.
[video=youtube]http://www.youtube.com/watch?v=U02Mhw55_S4[/video]
This is an older video, but it should show you how it works.
[/release]
[release][h2]Characters[/h2]
After this it was mostly bug fixing and making a better character menu.
Creating a character came first, and this works in the following way.
[img]http://i.imgur.com/qV59W.png[/img][img]http://i.imgur.com/PPQAG.png[/img]
It tells you if your name is valid, and when you click "Confirm" it will check if the name is already in use.
If it is, a popup will be shown telling you that you should change your name as it's been taking already.
Next up was the character menu that actually shows you your characters.
I decided that it was best to show the character wearing the fully rendered armor.
The result:
[img]http://i.imgur.com/4Virh.jpg[/img]
The characters aren't ordered, but this is just a minor problem.
[/release]
[release][h2]Parties[/h2]
I'm sure you're all familiar with parties.
You form a party with other players and you get shared exp and other bonuses.
I'm a big fan of the concept myself, so I pretty much had to add it.
So the way this works is simple:
First you open the scoreboard which, for now, looks something like this:
[img]http://i.imgur.com/ETVMG.png[/img]
Then you select the player you want to invite for a party:
[img]http://i.imgur.com/yRmMU.png[/img]
This player is then given a popup asking whether or not they want to join your party.
If they accept you're given the option of naming your party:
[img]http://i.imgur.com/OK8oN.png[/img]
And there you have it!
The gold star tells you who the leader is, and when the party is formed only the leader can recruit new party members.
If you wish to change the partyleader and you're the leader yourself, simply click on another party member's name, and hit change partyleader:
[img]http://i.imgur.com/IyXYF.png[/img]
[img]http://i.imgur.com/Pg1UL.png[/img]
That's all there is to it!
Next to this, when a party is formed it will be given a random color.
In chat this color will be shown as well as the name of your party:
[img]http://i.imgur.com/IyRd9.png[/img]
Team chat is now also party chat, so if you wish to discuss something with just your party, simply say something in team chat.
[/release]
[release][h2]Trading[/h2]
What use are items without shops and trading.
So I decided to start on trading first, since that's more important.
The menu is made with simplicity in mind:
[img]http://i.imgur.com/YCl4Z.png[/img]
To get one item from your inventory to the trade slots or vice versa, you simply right click that item.
After that you can freely move it around in those slots.
Whenever the second player adds an item it shows up in top slots:
[img]http://i.imgur.com/Gtv7s.png[/img]
If a player presses accept the other player will be notified that they wish to trade with these items:
[img]http://i.imgur.com/XJPyx.png[/img]
To prevent scamming, whenever you move an item in or out of the trade slots both players will be forced to hit Accept again so you can't remove an item and hit accept really quickly.
As you can see I lost the shoes and helmet, and got new sunglasses:
[img]http://i.imgur.com/fJBbA.png[/img]
Things I plan to add to the menu: A chatbox so you can chat with the other player without bothering the rest or using steamchat / console.
[/release]
[release][h2]Quests[/h2]
Quests are of course added, and consist from killing npcs, finding items and maybe even talking to other friendly npcs.
A simple example:
[video=youtube]http://www.youtube.com/watch?v=PPDvMpiTUL0[/video]
[/release]
So facepunch, tell me what you think!
[editline]21st July 2011[/editline]
[release][h2]The SWep[/h2]
As said and shown before, I made a swep for the creation of armor.
I am giving that swep away for those of you who would like to create armor.
When making armor, please keep these things in mind:
Once you've made an armor part, reply to this post with the code and a screenshot of the armor so everyone knows what it looks like before trying it. Also mention what armor part it is, the name of the armor and a small description.
The following armor parts can be made:
*Helmet
*Body
*Gloves
*Pants
*Boots
*Shield
[/release]
[release]
[h2]Example[/h2]
[b]Name[/b]: Badass
[b]Armor part[/b]: Helmet
[b]Description[/b]: One badass armor piece.
[b]Picture[/b]: [img]http://i.imgur.com/7FXiv.png[/img]
[b]Code[/b]: [code][ "Models" ] = {
{ [ "Offset" ] = Vector( 3.7999999523163, -4.5, 1.5 ), [ "Color" ] = Color( 0, 0, 0, 255), [ "Skin" ] = 0, [ "Scale" ] = Vector( 0.019999999552965, 0.019999999552965, 0.10000000149012 ), [ "Bone" ] = "ValveBiped.Bip01_Head1", [ "Material" ] = "phoenix_storms/black_chrome", [ "Model" ] = "models/props_phx/construct/glass/glass_angle180.mdl", [ "Angular Offset" ] = Angle( 0, 15, 90 ) },
{ [ "Offset" ] = Vector( 3.7999999523163, -4.5, -1.2000000476837 ), [ "Color" ] = Color( 0, 0, 0, 255), [ "Skin" ] = 0, [ "Scale" ] = Vector( 0.019999999552965, 0.019999999552965, 0.10000000149012 ), [ "Bone" ] = "ValveBiped.Bip01_Head1", [ "Material" ] = "phoenix_storms/black_chrome", [ "Model" ] = "models/props_phx/construct/glass/glass_angle180.mdl", [ "Angular Offset" ] = Angle( 0, 15, 90 ) },
{ [ "Offset" ] = Vector( 3.7000000476837, -4.6999998092651, 0.60000002384186 ), [ "Color" ] = Color( 0, 0, 0, 255), [ "Skin" ] = 0, [ "Scale" ] = Vector( 0.0099999997764826, 0.0099999997764826, 0.019999999552965 ), [ "Bone" ] = "ValveBiped.Bip01_Head1", [ "Material" ] = "", [ "Model" ] = "models/hunter/tubes/tube1x1x1d.mdl", [ "Angular Offset" ] = Angle( 0, -180, 180 ) },
{ [ "Offset" ] = Vector( 3.5, -2.2000000476837, 2.7999999523163 ), [ "Color" ] = Color( 0, 0, 0, 255), [ "Skin" ] = 0, [ "Scale" ] = Vector( 0.019999999552965, 0.019999999552965, 0.0099999997764826 ), [ "Bone" ] = "ValveBiped.Bip01_Head1", [ "Material" ] = "", [ "Model" ] = "models/hunter/blocks/cube025x5x025.mdl", [ "Angular Offset" ] = Angle( 0, 10, 10 ) },
{ [ "Offset" ] = Vector( 3.5, -2.2000000476837, -2.5999999046326 ), [ "Color" ] = Color( 0, 0, 0, 255), [ "Skin" ] = 0, [ "Scale" ] = Vector( 0.019999999552965, 0.019999999552965, 0.0099999997764826 ), [ "Bone" ] = "ValveBiped.Bip01_Head1", [ "Material" ] = "", [ "Model" ] = "models/hunter/blocks/cube025x5x025.mdl", [ "Angular Offset" ] = Angle( 0, 10, -10 ) },
{ [ "Offset" ] = Vector( 0.60000002384186, -6.1999998092651, 0.60000002384186 ), [ "Color" ] = Color( 255, 255, 255, 255), [ "Skin" ] = 0, [ "Scale" ] = Vector( 0.070000000298023, 0.029999999329448, 0.029999999329448 ), [ "Bone" ] = "ValveBiped.Bip01_Head1", [ "Material" ] = "models/shiny", [ "Model" ] = "models/XQM/cylinderx2.mdl", [ "Angular Offset" ] = Angle( 10, 90, 0 ) },
{ [ "Offset" ] = Vector( 0.60000002384186, -5.3000001907349, 0.40000000596046 ), [ "Color" ] = Color( 225, 115, 0, 255), [ "Skin" ] = 0, [ "Scale" ] = Vector( 0.029999999329448, 0.029999999329448, 0.029999999329448 ), [ "Bone" ] = "ValveBiped.Bip01_Head1", [ "Material" ] = "models/shiny", [ "Model" ] = "models/XQM/cylinderx2.mdl", [ "Angular Offset" ] = Angle( 10, 90, 0 ) }
}[/code]
[/r
Looks pretty cool.
[release][h2]Guide[/h2]
*Once you have the swep in your hands, press [b]Mouse 2[/b] to open the menu.
*Hold [B]Mouse 2[/B] and move your mouse to rotate around the selected bone.
*Hold [B]Mouse 2[/B] and [B]E[/B], then move your mouse [B]up[/B] or [B]down[/B] to zoom in / out.
*Once you think the armor part is done, press [B]Left Control[/B] + [B]X[/B] and a message should be printed to your chat saying that the code has been copied to your clipboard.
*[B]Red line[/B]: This is the [B]X[/B] offset.
*[B]Green line[/B]: This is the [B]Y[/B] offset.
*[B]Blue line[/B]: This is the [B]Z[/B] offset.
[/release]
[release][h2]Menu[/h2]
The menu on the left side of the screen should look something like this:
[img]http://i.imgur.com/M1b3l.png[/img]
I'll break it up in each part and explain what it does.
First you got your big ol' [B]Add Model[/B] button.
This button adds a new model into the model list on the right.
At first this model will be a baby, but we'll get to that later.
[img]http://i.imgur.com/1M5si.png[/img]
Next up: [B]Load Armor[/B]:
[img]http://i.imgur.com/LQlQJ.png[/img]
Let's say you've made an armor before.
When you hit the button a second menu will pop up.
[img]http://i.imgur.com/JfRH9.png[/img]
All you need to do is paste the code it gave you before in here and hit Load.
The swep will do everything for you.
Then there's the [B]Angular Offset[/B].
[img]http://i.imgur.com/gapty.png[/img]
This rotates the model around the model's center ( The point where the X, Y and Z axis lines come together ).
This shouldn't be too hard to grasp.
Next up is the [B]Bone[/B]:
[img]http://i.imgur.com/sKprS.png[/img]
This means what bone the model will be 'parented' to.
If you select the head, the model will be parented to the players head.
This is perfect for hats and helmets.
Gloves for example should use the left or right hand.
Then there's [B]Color[/B]:
[img]http://i.imgur.com/Ru2w1.png[/img]
This part should be self explanatory.
Following [B]Color[/B] is [B]Misc[/B].
[img]http://i.imgur.com/qWs4N.png[/img]
The first textbox is the [B]Model[/B] of the model.
The second one is the [B]Material[/B].
All very simple, I'm sure you'll understand it.
Now we've gotten to [B]Offset[/B]:
[img]http://i.imgur.com/CyVet.png[/img]
When you look at the model, you see the [B]red[/B], [B]green[/B] and [B]blue[/B] lines.
When you move the [B]X[/B] slider, for example, the model will move over the red line.
This way you can move models away from the center of the bone.
Usage for this is, for example, moving a helmet part high enough that it's above the head.
The last thing I've added is [B]Scale[/B]:
[img]http://i.imgur.com/vxoMM.png[/img]
Where [B]Offset[/B] moves the model over the lines, [B]Scale[/B] changes the size.
Just play around with it, I'm sure you'll know how it works in no time.
That was the adjustment menu.
Now I'm sure you'll be wondering about the 2nd menu on the right side of the screen.
This menu is even simpler than the 1st one.
It shows all the models you've created so far, and the model you have currently selected will have a green rectangle around it in there:
[img]http://i.imgur.com/3h2X4.png[/img]
As you can see the model I've currently selected has a green rectangle around it.
Say I'd like to remove the last model I've added, because I feel like it's unnecessary.
How would you go about doing that, you say?
It's easy: Simply click the icon and a menu should pop up.
[img]http://i.imgur.com/DsE9s.png[/img]
As you can see you've got 2 choices:
*Select the model so you can change its values like [B]Offset[/B] and [B]Scale[/B].
*Remove the model.
This should have covered everything you need to know.
[/release]
Looks nice
Currently working on giving NPCs levels and everything that comes with it.
Uses a .txt for convenience sake, and is easily adjusted.
The values are seperated by tabs.
[code]
//NPC Name Level Variation
npc_headcrab 3 2
npc_zombie 15 5
npc_antlion 25 5
[/code]
Let's take the headcrab out as an example.
So first you see npc_headcrab, this is the headcrab's class.
Underneath Level you see a 3: This is the standard level.
Then with Variation you say how much his level may vary, in this case 2.
This means that headcrabs can spawn with a level between 1 and 5 ( 3 - 2 and 3 + 2 ).
Work on the menus.
[QUOTE=_NewBee;31248984]Work on the menus.[/QUOTE]
What a helpful response.
"Work on the menus."
Clearly says what is wrong with them and what I should change.
Thank you so much for this useful post.
[QUOTE=xThaWolfx;31249307]What a helpful response.
"Work on the menus."
Clearly says what is wrong with them and what I should change.
Thank you so much for this useful post.[/QUOTE] Not much more to say really. They look ugly.
[QUOTE=_NewBee;31249365]Not much more to say really. They look ugly.[/QUOTE]
I program, I don't design.
I know they look ugly, but I can't help it..
Every time I try to make it look better it only gets worse ):
Besides, it's an early WIP.
At this stage I don't give a damn whether or not the menus look ugly, I only care if they work or not.
[QUOTE=xThaWolfx;31249583]I program, I don't design.
I know they look ugly, but I can't help it..
Every time I try to make it look better it only gets worse ):
Besides, it's an early WIP.
At this stage I don't give a damn whether or not the menus look ugly, I only care if they work or not.[/QUOTE] Then you're not a very good *scripter
Alright, NPC spawning is all done.
You can make a spawn with just 1 line saying how many NPCs should be there, what their respawn time should be and you also supply 2 Vectors which are the 2 corners of the spawn.
[code]
GM:AddNPCSpawn( Vector( -1782, 842, 128 ), Vector( -1431, 365, 128 ), "npc_zombie", 20, 25 )
[/code]
This would create a zombie spawn between the first 2 vectors, spawn 20 zombies and when one of those zombies dies, it will respawn after 25 seconds.
Next to this I've been working on the inventory to make armor easier to use.
For every armor part it now adds an armor slot in which you can drag armor.
[img]http://i.imgur.com/jAjBl.png[/img]
As you can see the skull, which is just a place holder for now, is placed on the top slot.
Since I don't have any textures yet you can't see which slot resembles which armor part but that's not a big problem.
When you place the armor part on the slot you will wear that armor part, when you put it back in your inventory you take it off again.
And last but not least I've spent some time on the menus.
I'm terrible when it comes to this but it beats the previous one.
Once again tell me what you think and what I should change.
I like the inventory., _NewBee is a dumbass.
[highlight](User was banned for this post ("Flaming." - postal))[/highlight]
- in all honestly i would hardly call that flaming..
This looks fantastic, mate. Keep up the good work, hope this comes up to what you want :). Gonna add anything that looks fancy, say...spells, considering the RPG outlook?
Liiiiike giant nuclear fireballs?
the inventory looks a bit like an optical illusion when im looking at it from the corner of my eye. :smile:
Its a nice design as well.
[QUOTE=Killer_Steel;31283872]This looks fantastic, mate. Keep up the good work, hope this comes up to what you want :). Gonna add anything that looks fancy, say...spells, considering the RPG outlook?
Liiiiike giant nuclear fireballs?[/QUOTE]
Magic is indeed one of the things I plan to add.
Both attack and support spells as parties will be implemented as well.
As an aside note, I'm currently working on making the inventory render the whole armor instead of just a single model.
So far so good!
[img]http://i.imgur.com/mpb1d.png[/img]
It may not look perfect but that's of later concern.
It works like a charm, and that's what counts eh?
[QUOTE=Big Bang;31289896]Pro tip, encode this
[code]
[ "Models" ] = {
{ [ "Offset" ] = Vector( 3.7999999523163, -4.5, 1.5 ), [ "Color" ] = Color( 0, 0, 0, 255), [ "Skin" ] = 0, [ "Scale" ] = Vector( 0.019999999552965, 0.019999999552965, 0.10000000149012 ), [ "Bone" ] = "ValveBiped.Bip01_Head1", [ "Material" ] = "phoenix_storms/black_chrome", [ "Model" ] = "models/props_phx/construct/glass/glass_angle180.mdl", [ "Angular Offset" ] = Angle( 0, 15, 90 ) },
{ [ "Offset" ] = Vector( 3.7999999523163, -4.5, -1.2000000476837 ), [ "Color" ] = Color( 0, 0, 0, 255), [ "Skin" ] = 0, [ "Scale" ] = Vector( 0.019999999552965, 0.019999999552965, 0.10000000149012 ), [ "Bone" ] = "ValveBiped.Bip01_Head1", [ "Material" ] = "phoenix_storms/black_chrome", [ "Model" ] = "models/props_phx/construct/glass/glass_angle180.mdl", [ "Angular Offset" ] = Angle( 0, 15, 90 ) },
{ [ "Offset" ] = Vector( 3.7000000476837, -4.6999998092651, 0.60000002384186 ), [ "Color" ] = Color( 0, 0, 0, 255), [ "Skin" ] = 0, [ "Scale" ] = Vector( 0.0099999997764826, 0.0099999997764826, 0.019999999552965 ), [ "Bone" ] = "ValveBiped.Bip01_Head1", [ "Material" ] = "", [ "Model" ] = "models/hunter/tubes/tube1x1x1d.mdl", [ "Angular Offset" ] = Angle( 0, -180, 180 ) },
{ [ "Offset" ] = Vector( 3.5, -2.2000000476837, 2.7999999523163 ), [ "Color" ] = Color( 0, 0, 0, 255), [ "Skin" ] = 0, [ "Scale" ] = Vector( 0.019999999552965, 0.019999999552965, 0.0099999997764826 ), [ "Bone" ] = "ValveBiped.Bip01_Head1", [ "Material" ] = "", [ "Model" ] = "models/hunter/blocks/cube025x5x025.mdl", [ "Angular Offset" ] = Angle( 0, 10, 10 ) },
{ [ "Offset" ] = Vector( 3.5, -2.2000000476837, -2.5999999046326 ), [ "Color" ] = Color( 0, 0, 0, 255), [ "Skin" ] = 0, [ "Scale" ] = Vector( 0.019999999552965, 0.019999999552965, 0.0099999997764826 ), [ "Bone" ] = "ValveBiped.Bip01_Head1", [ "Material" ] = "", [ "Model" ] = "models/hunter/blocks/cube025x5x025.mdl", [ "Angular Offset" ] = Angle( 0, 10, -10 ) },
{ [ "Offset" ] = Vector( 0.60000002384186, -6.1999998092651, 0.60000002384186 ), [ "Color" ] = Color( 255, 255, 255, 255), [ "Skin" ] = 0, [ "Scale" ] = Vector( 0.070000000298023, 0.029999999329448, 0.029999999329448 ), [ "Bone" ] = "ValveBiped.Bip01_Head1", [ "Material" ] = "models/shiny", [ "Model" ] = "models/XQM/cylinderx2.mdl", [ "Angular Offset" ] = Angle( 10, 90, 0 ) },
{ [ "Offset" ] = Vector( 0.60000002384186, -5.3000001907349, 0.40000000596046 ), [ "Color" ] = Color( 225, 115, 0, 255), [ "Skin" ] = 0, [ "Scale" ] = Vector( 0.029999999329448, 0.029999999329448, 0.029999999329448 ), [ "Bone" ] = "ValveBiped.Bip01_Head1", [ "Material" ] = "models/shiny", [ "Model" ] = "models/XQM/cylinderx2.mdl", [ "Angular Offset" ] = Angle( 10, 90, 0 ) }
[/code]
Into GLON, so you can save them while taking less space, and also enabling you to use any datatype without it coming up as a string. You'll find it much more handy.[/QUOTE]
This is put into a lua file.
If I were to encode it small changes would require to load it into the swep, adjust it and then resave it.
And GLON does save some space, but not a whole lot.
All things considered I prefer this method over GLON.
[QUOTE=xThaWolfx;31290027]This is put into a lua file.
If I were to encode it small changes would require to load it into the swep, adjust it and then resave it.
And GLON does save some space, but not a whole lot.
All things considered I prefer this method over GLON.[/QUOTE]
How are you saving into a Lua file? I thought Garry disabled that.
[QUOTE=Big Bang;31290851]How are you saving into a Lua file? I thought Garry disabled that.[/QUOTE]
You did not read the guide at all, did you?
Menus still need improvement.
[QUOTE=_NewBee;31292375]Menus still need improvement.[/QUOTE]
In case you hadn't noticed, not too many people, including myself, care for your judgement.
[QUOTE=xThaWolfx;31291013]You did not read the guide at all, did you?[/QUOTE]
I'm sorry I fail to see the point of not saving anything to file.
And you have some kinda attitude. May wanna tone it down.
[QUOTE=Big Bang;31293535]I'm sorry I fail to see the point of not saving anything to file.
And you have some kinda attitude. May wanna tone it down.[/QUOTE]
The swep will return code that you use in a file.
Every armor piece has values like price, defense etc etc.
One of those values is the model table.
The returned code [B]is[/B] that model table.
And I have no clue what you mean by my attitude.
If you mean my responses to _NewBee, all he did is complaint.
Now that's not a problem as long as you provide details of wat exactly is wrong.
That's called constructive criticism..
He means the snarky replies to his posts. Also, I thought you could only write text files, not .lua files?
I seem to understand now that the SWEP, which I don't understand why it is a SWEP simply outputs code for the creation of items on the actual gamemode.
Now my question is, why a SWEP? Maybe you've figured out something about them that I don't know about.
[QUOTE=Big Bang;31302723]I seem to understand now that the SWEP, which I don't understand why it is a SWEP simply outputs code for the creation of items on the actual gamemode.
Now my question is, why a SWEP? Maybe you've figured out something about them that I don't know about.[/QUOTE]
That is exactly what it does.
The reason I made a SWEP for it is because it keeps everything in a single file and is simple to edit.
They hold all the useful functions for right click, think etc and are both clientside and serverside.
So instead of having to make an addon with multiple files I made a SWEP.
There aren't that many advantages but I just made it into a SWEP because at the time, and even now, I thought it was easier.
[QUOTE=xThaWolfx;31292525]In case you hadn't noticed, not too many people, including myself, care for your judgement.[/QUOTE]
Mistakes happen, deal with it and fix them.
[QUOTE=_NewBee;31305582]Mistakes happen, deal with it and fix them.[/QUOTE]
[img]http://cdn1.knowyourmeme.com/i/000/088/536/original/emot-frogout.gif?1292656457[/img]