Cakescript G2 Fixes Here. Get them while they are hot.

OK, I’ve been working on a new gamemode (it’s not SeriousRP, that’s still underway)

The new gamemode is based on Cakescript G2. As you all know, Cakescript G2 1.0.4 is broken

Here are the fixes:

CakeScriptG2/gamemode/charactercreate.lua
replace:



local PlyCharTable = CAKE.PlayerData[ CAKE.FormatSteamID( ply:SteamID() ) ]["characters"];


with:



local PlyCharTable = CAKE.PlayerData[ CAKE.FormatSteamID( ply:SteamID() ) ]["characters"] or {};


CakeScriptG2/gamemode/cl_charactercreate.lua (Fix for vgui error)
replace:



models = {};


with:



ValidCakeModels = {};


replace:



table.insert( models, data:ReadString( ) )


with:



table.insert( ValidCakeModels, data:ReadString( ) )


replace:



table.insert( models, data:ReadString( ) )


with:



table.insert( ValidCakeModels, data:ReadString( ) )


CakeScriptG2/gamemode/cl_playermenu.lua:
replace:



mdlPanel:SetModel( models[1] )


with:



mdlPanel:SetModel( ValidCakeModels[1] )


replace:



i = #models;


with:



i = #ValidCakeModels;


replace:



mdlPanel:SetModel(models*);


with:



mdlPanel:SetModel(ValidCakeModels*);


replace:



if(i > #models) then


with:



if(i > #ValidCakeModels) then


replace:



mdlPanel:SetModel(models*);


with:



mdlPanel:SetModel(ValidCakeModels*);


replace:



if(!table.HasValue(models, ChosenModel)) then


with:



if(!table.HasValue(ValidCakeModels, ChosenModel)) then


CakeScriptG2/gamemode/cl_init.lua: (cl_binds errors Fix)

  • Move cl_binds.lua include to the bottom of the list of includes

CakeScriptG2/gamemode/concmd.lua: (Spelling fix)
replace:



CAKE.SendChat( ply, "This is not a purchaseable door!" );


with:



CAKE.SendChat( ply, "This is not a purchasable door!" );


CakeScriptG2/gamemode/init.lua: (make sure files are copied client side) maybe they are already who knows.
replace:



GM.Name = "Cakescript G2";



with:



GM.Name = "Cakescript G2";

-- Add Client Side files
AddCSLuaFile( "cl_binds.lua" );
AddCSLuaFile( "shared.lua" );
AddCSLuaFile( "player_shared.lua" );
AddCSLuaFile( "cl_hud.lua" );
AddCSLuaFile( "cl_charactercreate.lua" );
AddCSLuaFile( "cl_playermenu.lua" );
AddCSLuaFile( "cl_init.lua" );


  • Move the util.lua include between error_handling and hooks lua includes (fixes adding admin commands in admin_cc.lua)


include( "error_handling.lua" ); -- Error handling functions
include( "util.lua" ); -- Functions
include( "hooks.lua" ); -- CakeScript Hook System


Would anyone like a diff version of this? :3

[editline]05:51PM[/editline]

I could make one. (In case you don’t know what diff is, http://en.wikipedia.org/wiki/Diff )

I used a diff to create it in the first place but I’ve edited the script quite a bit so it’s not quite the same any more to make a diff from.

Someone can release a 1.0.4a if they like with these fixes / make a diff. I mainly posted this here like that so people can update their already-deployed-but-broken scripts.

I’m still looking for a solution for the broken hands / weapons. They are just not usable at the moment. If anyone knows the solution to that, please do post it so we can get all the fixes together. Cakescript G3 may be coming… but G2 is broken and I’m currently trying to use it, I’m sure many others are too.

Well, good job on fixing all these problems. CSG3 is well under way and I’ve been betatesting it with many scripters and community owners so they can get a feel for it.

You made a mistake on the last 2 of cl_charactercreate the ones above them and those are the same.

Thanks a lot for this phil :3, again you’re a benefit to us.

I did the 1.0.4a and released it in Gamemodes, All credits to you guys mostly. I gave myself 1 credit point :3 I feel special.

Some of the guns don’t work because the animations are broken.

Simplest solution?

change this in init.lua:
include(“animations.lua”)
–include(“animations.lua”)

Anyone know how soon until G3 is released?

May try out G2 with these fixes in the meantime…

Nice bump man!

Doesn’t Really matter, this is a good thread, I’m glad this was bumped so I could find it.

OP I love you :slight_smile:

Due to these fixes I decided to give cakescript another try. However when I try to press ok to select a model I get:

[lua]
includes/extensions/table.lua:103: bad argument #1 to ‘pairs’ (table expected, got nil) is not a valid model!
[/lua]

I didn’t spot any mistakes that I could have made while copieing.

Edit:

Fixed it. The line
[lua] if( table.HasValue( models, mdl ) ) then [/lua]
in cl_charactercreate had to be ValidCakeModels instead of models.

Sorry, but I am wondering.
I have downloaded http://www.garrysmod.org/downloads/?a=view&id=87145 that is using your fixes. But when I type “rp_setflags” it says that its an invalid command. Any clue?

rp_admin setflags player flag

[editline]05:18PM[/editline]

or rp_admin setflag player flag

dont remember

Thanks Knallex :wink:

Also, Animations are broken.
Opened “Init.lua” and changed


include("animations.lua")

to


 --include("animations.lua")

Now it uses default animations, but it fixed it.

[editline]08:06PM[/editline]

But now,

] rp_admin setflag Heineken CP
Unknown Command: ‘rp_admin’

Why?

[editline]08:08PM[/editline]

NVM, rejoined, fixed,

[editline]08:20PM[/editline]

But, animations are tlike T-Minges, howto fix?

Awesome work. This could maybe turn out like a serious alternative to DarkRP now.

Can anyone help me? I have broken animations!
OWS etc. walk like they are snowboarding!

Install source 2007 models on your server.

I did.
So I put them in Garrysmod/Garrysmod?