CakeScript - A Brand New Roleplay Gamemode (It can be any kind, too!)

CakeScript is a new modular, pluggable, general roleplaying script (and/or gamemode, in technical terms).

[release]Generic Coding

All presently released/leaked gamemodes (original copies) were designed for one RP in mind, making it a tedious task to change it for your personal needs. While people may have somewhat accomplished changing TacoScript for things like Real Life RP and Stalker RP in the past, it was never very stable and it took some time to do it.

CakeScript will be a general roleplaying script that can be modified by the use of plugins, explained in a later section.[/release][release]The ID Card - Not Implemented (into a swep)
Pull out a SWEP and see your personal details on the card that you are holding. No more HUD, instead your information will be displayed on the front of an ID card by using the ‘Toolgun Technology’. As seen in Sandbox, when you pull out your toolgun, it will scroll the STOOL name on it. Same rules apply, instead it is your character info.

Personal Wristwatch - Not Implemented (into a swep)
Enhanced with Foszor’s Day/Night script, the server will have it’s own time and date, of which can be seen on yet another SWEP, except it’s a wristwatch. The server progresses by a ‘server’ minute, and will progress hours, days, months, and years. The timescale is also changeable, and I have calculated that 0 is a server minute per frame, 30 is a real second for a server minute, and every extra 30 is one extra real second per server minute. Cut 30 in half and it’s one real second for two server minutes.

Realistic Death
Having a good RP, and you get loaded with a few bullets by the local SWAT team and suddenly your in that good old train station yet again? Well, in CakeScript you won’t instantly die. You’ll turn into a ragdoll, look through the eyes of that ragdoll, and be able to talk. Eventually you will die (there’s a meter showing the progress of your death), but there’s some time to say your goodbyes or for a teammate to save your life once you’re down. Don’t worry, you can give up and just type !acceptdeath to respawn. Another factor to this is that your body will stay there to be taken away, but if someone doesn’t get your body you’ll eventually rot/decay progressively.

Typing…
Sick of it when you are trying to interactively roleplay but you can’t finish what you wanted to do because of your TYPING SPEED? Well, other people can now see when you are typing, as Typing… will appear over your head if the chat window is open.[/release][release]Modular and Pluggable
Release your custom plugins to the community and be able to modify the gamemode functionality and roleplay. Hook into the CakeScript and gamemode functions, and modify the script to what you need it to be, or just download already-made plugins, by just throwing them into the plugins folder.
[/release][release]Doors
Each team can have any number of ‘Door Groups’, which will enable the script to make certain doors exclusively able to be opened only by certain teams. All you have to do is fly around the map and execute rp_adddoor # while looking at doors in their open and closed positions. Any team with the specified # in their DoorGroups table will be able to open that door.
[/release][release]Credits
[ul]LuaBanana - Gamemode Coding[/ul]
[ul]Foszor - Day/Night Script[/ul]
[ul]Rick Darkoliono - NPC Animations[/ul]
[ul]FacePunch Community - Ideas, support, etc[/ul]
[/release]

[release]An Example of a Roleplay Scheme
[lua]
– RLRP CakeScript Plugin
PLUGIN.Name = “Real Life RP”

if(SERVER) then
– Create RLRP teams
CAKE.AddTeam(“Police”, Color(0, 0, 255, 255), true, “models/humans/group03/”, true, {“weapon_glock”}, {}, “police”, “1”);
CAKE.AddTeam(“SWAT”, Color(0, 0, 255, 255), true, “models/police.mdl”, false, {“weapon_glock”, “weapon_mp5”}, {}, “swat”, “1”);

– Add selectable characters
CAKE.AddModels({“models/humans/group01/male_01.mdl”,
“models/humans/group01/male_02.mdl”,
“models/humans/group01/male_03.mdl”,
“models/humans/group01/male_04.mdl”,
“models/humans/group01/male_06.mdl”,
“models/humans/group01/male_07.mdl”,
“models/humans/group01/male_08.mdl”,
“models/humans/group01/male_09.mdl”,
“models/humans/group02/male_01.mdl”,
“models/humans/group02/male_02.mdl”,
“models/humans/group02/male_03.mdl”,
“models/humans/group02/male_04.mdl”,
“models/humans/group02/male_06.mdl”,
“models/humans/group02/male_07.mdl”,
“models/humans/group02/male_08.mdl”,
“models/humans/group02/male_09.mdl”,

          "models/humans/group01/female_01.mdl",
          "models/humans/group01/female_02.mdl",
          "models/humans/group01/female_03.mdl",
          "models/humans/group01/female_04.mdl",
          "models/humans/group01/female_06.mdl",
          "models/humans/group01/female_07.mdl",
          "models/humans/group02/female_01.mdl",
          "models/humans/group02/female_02.mdl",
          "models/humans/group02/female_03.mdl",
          "models/humans/group02/female_04.mdl",
          "models/humans/group02/female_06.mdl",
          "models/humans/group02/female_07.mdl"});

end
[/lua]
The above is the default plugin for the Real Life Roleplay schematic (Very basic, but proof of concept.)

[lua]
CAKE.AddTeam(string TeamName, color Color, boolean DefaultModel, string DefaultModelPath, boolean PartialModel, table Weapons, table Ammo, string FlagKey, table DoorGroups);
[/lua]
The above is the team adding function.

[lua]
Teams[1] = {};
Teams[1][“name”] = “Citizen”; – Team Name
Teams[1][“color”] = Color( 0, 255, 0, 255 ); – Team Color, will show up when someone is talking in OOC/when you look at them.
Teams[1][“DefaultModel”] = false; – Do they have a default model that they get when they spawn?
Teams[1][“DefaultModelPath”] = “”; – What’s the path to their default model?
Teams[1][“PartialModel”] = false; – Is their model path PARTIAL?
Teams[1][“Weapons”] = {}; – What weapons do they spawn with?
Teams[1][“Ammo”] = {}; – What ammo do they spawn with?
Teams[1][“FlagKey”] = “citizen”; – What flag key is used when using rp_flag?
Teams[1][“DoorGroup”] = {}; – What doors can they open?
[/lua]
is the equivalent of…
[lua]
CAKE.AddTeam(“Citizen”, Color( 0, 255, 0, 255 ), false, “”, false, {}, {}, “citizen”, {});
[/lua]

Whereas
[lua]
Teams[1] = {};
Teams[1][“name”] = “SWAT”; – Team Name
Teams[1][“color”] = Color(0, 0, 255, 255); – Team Color, will show up when someone is talking in OOC/when you look at them.
Teams[1][“DefaultModel”] = true; – Do they have a default model that they get when they spawn?
Teams[1][“DefaultModelPath”] = “models/police.mdl”; – What’s the path to their default model?
Teams[1][“PartialModel”] = false; – Is their model path PARTIAL?
Teams[1][“Weapons”] = {“weapon_glock”, “weapon_mp5”}; – What weapons do they spawn with?
Teams[1][“Ammo”] = {}; – What ammo do they spawn with?
Teams[1][“FlagKey”] = “swat”; – What flag key is used when using rp_flag?
Teams[1][“DoorGroup”] = {1}; – What doors can they open?
[/lua]
is the equivalent of…
[lua]
CAKE.AddTeam(“SWAT”, Color(0, 0, 255, 255), true, “models/police.mdl”, false, {“weapon_glock”, “weapon_mp5”}, {}, “swat”, {1});
[/lua]

This
[lua]
Teams[2] = {};
Teams[2][“name”] = “United Militia”; – Team Name
Teams[2][“color”] = Color( 255, 0, 0, 255 ); – Team Color, will show up when someone is talking in OOC/when you look at them.
Teams[2][“DefaultModel”] = true; – Do they have a default model that they get when they spawn?
Teams[2][“DefaultModelPath”] = “models/humans/group03/”; – What’s the path to their default model?
Teams[2][“PartialModel”] = true; – Is their model path PARTIAL?
Teams[2][“Weapons”] = {}; – What weapons do they spawn with?
Teams[2][“Ammo”] = {}; – What ammo do they spawn with?
Teams[2][“FlagKey”] = “um”; – What flag key is used when using rp_flag?
Teams[2][“DoorGroup”] = {}; – What doors can they open?
[/lua]
is the equivalent of…
[lua]
CAKE.AddTeam(“United Militia”, Color( 255, 0, 0, 255 ), true, “models/humans/group03/”, true, {}, {}, “swat”, {});
[/lua]

Everything else is pretty easy to understand.
[/release][release]Commands
Please note all console commands starting with rp_ can be said in chat by replacing rp_ with !

CVARS:
daytime_speed <timescale> - Basically says how fast the sun and clock go. 30 is one real second to server minute, 60 is two real seconds to server minute, 15 is half a real second to server minute, 0 is a server minute per frame.

Admin Commands:
rp_adddoor <doorgroup> - Adds a door to a doorgroup, you must do this for both the door’s opened and closed positions.
rp_setflags <rp name> <flag keys> - Set someones flags
rp_tooltrust <rp name> <0/1> - Give someone tooltrust
rp_setteam <rp name> <team number> - Will make someone be set to a certain team and respawn

Player Commands:
rp_flag <flag key> - Flags you
rp_charmenu - Brings up character creation/loading menu
rp_equip - Equips you with the things you need, just incase you don’t get them.
rp_acceptdeath - If you died, this will automatically set your respawn timer down to 0 seconds left.
rp_changename - Sets your RP name.
rp_job - Sets your job.
[/release]

[release]Creating an RP Schema
As a tutorial was requested, I will be showing you a more in-depth example of making a Roleplay Scheme for CakeScript.

Ok, so you’ve downloaded CakeScript and you want to make your own scheme.

First off, you need to create a lua file within the plugins directory of the gamemode. My example will be hl2rp.lua, and it will be stored in garrysmod/gamemodes/CakeScript/gamemode/plugins/hl2rp.lua

To start out the plugin, you should begin by putting this at the top of the file.

[lua]
– HL2 RP CakeScript Plugin
PLUGIN.Name = “Half-Life 2 RP”
PLUGIN.Type = “Scheme”
[/lua]

Now we will begin the team creation.

The syntax for adding a team via a function is the following:
[lua]
CAKE.AddTeam(string TeamName, color Color, boolean DefaultModel, string DefaultModelPath, boolean PartialModel, table Weapons, table Ammo, string FlagKey, table DoorGroup);
[/lua]

Now, what we need to know first off is the team name. Considering this is an HL2 RP schematic, the name probably will be “Civil Protection”.

The team color is generally the color of the persons name. Civil Protection and Combine in general usually like a darkish blue. Now remember, color consists of red, green, blue and alpha. So, if we wanted a darkish blue we would have red=0, green=0, blue=200, and alpha=255. 255 is the max value of color in RGB scales. Alpha represents the transparency, of which we will not be using. In ‘GLua’ terms, a color would be like so:
[lua]
Color( r, g, b, a )
[/lua]
In our case it would be
[lua]
Color( 0, 0, 200, 255 )
[/lua]

Now we have our color, so lets move on to other variables.

DefaultModel basically means, does the player spawn with his default character that he selected when he made his character, or does the team set a model for him. In this case we will be setting this to true, because a CP has the models/police.mdl.

DefaultModelPath is the path to the default model. If you don’t have a default model, just set this to “”. In our case we will be setting this to models/police.mdl

PartialModel is used for citizen model reskins such as City 08 or Group03. It takes the original model of the player, cuts it down to its suffix (for example male_07.mdl), and appends it (puts it at the end of) the DefaultModelPath. We won’t be using this, but in the case of a rebel this would be set to true, and DefaultModelPath would be set to models/humans/Group03/

The weapons variable is basically a list of what weapons the person spawns with. Now you MUST remember that this is a table, thus it must begin with { and end with }. Our Civil Protection unit will spawn with a pistol and a stunstick. So, set this variable to…
[lua]
{"weapon_pistol, “weapon_stunstick”}
[/lua]

The ammo variable isn’t really functioning so we’ll skip that part. Just put {} in place of it.

The flagkey is basically what is used in the rp_flag command and rp_setflags command. We’ll make the flagkey cp.

DoorGroup is a table as well. This is what enables a team to have it’s own doors that only they (or teams that have the same doorgroup number) can open. We’ll set this to 1, and afterwards you’ll need to go around the map you are going to use and run rp_adddoor 1 in console (A bind is usually better), for both the opened and closed door positions. You must be looking at the door. Don’t worry, it saves it by map name.

Ok, so now that we have all our variables, let’s get to it!

The variables all put together will equal this:
[lua]
CAKE.AddTeam(“Civil Protection”, Color( 0, 0, 200, 255 ), true, “models/police.mdl”, false, {“weapon_pistol”, “weapon_stunstick”}, {}, “cp”, {1});
[/lua]

Adding it to the plugin file is pretty simple. Just throw it in there, but make sure it’s enclosed within if(SERVER), otherwise it may just run on clientside!

Also, remember, to add ‘selectable’ models when a character is created, just put this in there.
[lua]
CAKE.AddModels(table Models);
[/lua]

Put a table of the models you’d like to add.
In HL2RP it’s usually like this…
[lua]
CAKE.AddModels({“models/humans/group01/male_01.mdl”,
“models/humans/group01/male_02.mdl”,
“models/humans/group01/male_03.mdl”,
“models/humans/group01/male_04.mdl”,
“models/humans/group01/male_06.mdl”,
“models/humans/group01/male_07.mdl”,
“models/humans/group01/male_08.mdl”,
“models/humans/group01/male_09.mdl”,
“models/humans/group02/male_01.mdl”,
“models/humans/group02/male_02.mdl”,
“models/humans/group02/male_03.mdl”,
“models/humans/group02/male_04.mdl”,
“models/humans/group02/male_06.mdl”,
“models/humans/group02/male_07.mdl”,
“models/humans/group02/male_08.mdl”,
“models/humans/group02/male_09.mdl”,

          "models/humans/group01/female_01.mdl", 
          "models/humans/group01/female_02.mdl", 
          "models/humans/group01/female_03.mdl", 
          "models/humans/group01/female_04.mdl", 
          "models/humans/group01/female_06.mdl", 
          "models/humans/group01/female_07.mdl", 
          "models/humans/group02/female_01.mdl", 
          "models/humans/group02/female_02.mdl", 
          "models/humans/group02/female_03.mdl", 
          "models/humans/group02/female_04.mdl", 
          "models/humans/group02/female_06.mdl", 
          "models/humans/group02/female_07.mdl"}); 

[/lua]
That will enable players to select the City 07 citizen models when creating their character.

So, all in all, the full plugin code is as such.
[lua]
– HL2 RP CakeScript Plugin
PLUGIN.Name = “Half-Life 2 RP”
PLUGIN.Type = “Scheme”

if( SERVER ) then
CAKE.AddTeam(“Civil Protection”, Color( 0, 0, 200, 255 ), true, “models/police.mdl”, false, {“weapon_pistol”, “weapon_stunstick”}, {}, “cp”, {1});
CAKE.AddModels({“models/humans/group01/male_01.mdl”,
“models/humans/group01/male_02.mdl”,
“models/humans/group01/male_03.mdl”,
“models/humans/group01/male_04.mdl”,
“models/humans/group01/male_06.mdl”,
“models/humans/group01/male_07.mdl”,
“models/humans/group01/male_08.mdl”,
“models/humans/group01/male_09.mdl”,
“models/humans/group02/male_01.mdl”,
“models/humans/group02/male_02.mdl”,
“models/humans/group02/male_03.mdl”,
“models/humans/group02/male_04.mdl”,
“models/humans/group02/male_06.mdl”,
“models/humans/group02/male_07.mdl”,
“models/humans/group02/male_08.mdl”,
“models/humans/group02/male_09.mdl”,

          "models/humans/group01/female_01.mdl",
          "models/humans/group01/female_02.mdl", 
          "models/humans/group01/female_03.mdl", 
          "models/humans/group01/female_04.mdl", 
          "models/humans/group01/female_06.mdl", 
          "models/humans/group01/female_07.mdl", 
          "models/humans/group02/female_01.mdl", 
          "models/humans/group02/female_02.mdl", 
          "models/humans/group02/female_03.mdl", 
          "models/humans/group02/female_04.mdl", 
          "models/humans/group02/female_06.mdl", 
          "models/humans/group02/female_07.mdl"}); 

end
[/lua]

Thanks for reading. Enjoy your RP scheme.

Please note though, it’s generally a good idea to only have one RP plugin in the folder at a time, because they WILL both be run, thus combining the teams and models.[/release]

[release]
[tab]Name: [/tab]CakeScript

[tab]Version: [/tab]Public Beta RC2

[tab]Description: [/tab]Second release of CakeScript, adds LOTS of bugfixes (some still remain), and new GUI (f1)


ANIMATIONS FIXED

[tab]Requirements: [/tab]None, but don’t use ULX with this version. All models that a player will ever use must be uploaded. (no more GCF)
Admin commands must be run from player console.

[tab]Screenshots: [/tab]

http://www.garrysmod.org/img/dl/37550_1.jpg

http://www.garrysmod.org/img/dl/37550_2.jpg

http://www.garrysmod.org/img/dl/37550_3.jpg

[tab]Download:[/tab]
http://www.garrysmod.org/img/?t=dll&id=37550
[/release]

[release]
[tab]Name: [/tab]CakeScript

[tab]Version: [/tab]Public Beta RC1

[tab]Description: [/tab]First release of CakeScript

[tab]Requirements: [/tab]None, but don’t use ULX with this version.

[tab]Screenshots: [/tab]

http://www.garrysmod.org/img/dl/36896_1.jpg

[tab]Download:[/tab]
http://www.garrysmod.org/img/?t=dll&id=36896
[/release]

[release]Due for Next Release
[ul]GUI color changeable by plugins[/ul]
[ul]Auto adding models to the animations system[/ul]
[ul]Toggleable HUD[/ul]
[ul]Broadcast fix[/ul]
[ul]Compatibility with ULX (The PlayerSay is being overriden by ULX hooks)[/ul]
[/release]

Animations aren’t broken by my script. Upload all HL2 models from the GCF to your server, along with any other models that will be used. ALL models that will be used MUST be located on the server!

[release]SVN Info
URL: http://38.100.236.40:8080/svn/cakescript/trunk/
user: anon
pass: anon
[/release]

Cool. Glad to see you are going to release it.

[release]SVN Info
URL: http://38.100.236.40:8080/svn/cakescript/trunk/
user: anon
pass: anon
[/release]

Glad to see this :), If you are looking for LUA Scripters I am happy to help.

-snip-

I can do the following:

[ul]VGUI, GUI And HUD Scripting[/ul]
[ul]A Dedicated Server[/ul]
[ul]Gamemode Coder[/ul]
[ul]Model And Skinning[/ul]

Anyone who wants the script get hold of me ile be publically releasing this shizz :slight_smile:

**


(User was banned for this post (Reason: Trolling.) [event] 47917 [/event])

**

**


(User was permabanned for this post (Reason: Dickhead) [event] 48524 [/event])

**

I do not care.

-snip-

Okies then i will release it :slight_smile:

Dude, stop being a dick and grow up man? What is your problem?

‘Apparently’ he was going to pay me 50-100 euros a month, like he is paying Robbis_1, but I turned it down. I don’t sell out my friends.

Paying you for what?

P.S. Check your Inbox :slight_smile:

Well here is the link for anyone who wants it :slight_smile:
*** LINK REMOVED ***

I could not give 2 shits your lose!

Yes, there’s the link. Enjoy guys.
I’ll be releasing a better version soon.

Also, go back to 3rd grade and learn grammar. :downs:

Whatever your lose :slight_smile:

Actually I don’t lose. This gains my script popularity. :slight_smile:
Although, be careful guys, I don’t know if he’s gonna put a virus in that shit or something. Probably gonna try and discredit me.

Reply on that, I can give you a nice 42 Slot Dedicated Server, Runs like a charm I have 3 people that manage it, including me. It has had up to 42 players on it once running Dark RP and the average ping was 50 or so.

Don’t feed the troll and just ignore him.

Wise words mate.