So All the files are in the right place. I've Check A bunch of times!
ERROR CODE:
Lua initialized (Lua 5.1)
Couldn't include file 'GadgetSRP\gamemode\cl_init.lua' (File not found) (<nowhere>)
[cpp]
There was a problem opening the gamemode file 'GadgetSRP/gamemode/cl_init.lua'
Registering gamemode 'GadgetSRP' derived from 'base'
I'm making my own mod.. I'm new at this so.. I'm learning as I go!
Edited:
Init looks like this!
include( 'shared.lua' )
include( "cl_hut.lua" )
include( "cl_resources.lua" )
// Clientside only stuff goes here
function hidehud (name)
for k, v in pairs("CMudHealth", "CHudBattery") do --Lets Hide The HUD!
if name == v then return false end
end
end
hook.Add("HUDShouldDraw", "hidehud", hidehud)
function GM:HUDpaint()
self:BaseClass:HUDPaint()
local person == LocalPlayer()
local Health == localPlayer():Health()
surface.CreateFont("mailartrubberstamp",64,400,fal se,false,"gfont")
surface.SetTextColor( 255, 255, 255, 255 )
surface.SetTextPos( 34, (ScrH()/2)+(ScrH()/4) )
surface.SetFont("gfont")
Surface.DrawText( Health )
end
- just doing some HUD testing off a tut :3
Use [noparse][lua][/lua][/noparse] tags please, and double check that everything is named correctly.
[lua]include( "cl_hut.lua" )[/lua]
You need to AddCSLuaFile cl_init.lua
[lua]local person == LocalPlayer()
local Health == localPlayer():Health()[/lua]
If you are declaring something, you use one "=".
[QUOTE=Hyper Iguana;35691443] = [/QUOTE]
[lua]AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )[/lua]
Added to Init...
Cl_init still wont load!
[editline]24th April 2012[/editline]
Still need Help :3
[editline]24th April 2012[/editline]
Still need help :3
It's called cl_init and not Cl_init, right?
I've had huge problems when people put capital letters in entity names, so don't ever capitalise any code or folder about garrysmod.
I see many issues such as a space inside the keywords false, the for loop you have isn't even a table, and Luanda is case sensitive.
Let me update the original post.. the copy paste function added some spaces... and its c_init
[editline]24th April 2012[/editline]
[QUOTE=ShastySpy;35691373]So All the files are in the right place. I've Check A bunch of times!
ERROR CODE:
Lua initialized (Lua 5.1)
Couldn't include file 'GadgetSRP\gamemode\cl_init.lua' (File not found) (<nowhere>)
[cpp]
There was a problem opening the gamemode file 'GadgetSRP/gamemode/cl_init.lua'
Registering gamemode 'GadgetSRP' derived from 'base'
I'm making my own mod.. I'm new at this so.. I'm learning as I go!
Edited:
cl_init looks like this!
[lua]
include( 'shared.lua' )
// Clientside only stuff goes here
function hidehud (name)
for k, v in pairs("CMudHealth", "CHudBattery") do --Lets Hide The HUD!
if name == v then return false end
end
end
hook.Add("HUDShouldDraw", "hidehud", hidehud)
function GM:HUDpaint()
self:BaseClass:HUDPaint()
local person = LocalPlayer()
local Health = localPlayer():Health()
surface.CreateFont("mailartrubberstamp",64,400,false,false,"gfont")
surface.SetTextColor( 255, 255, 255, 255 )
surface.SetTextPos( 34, (ScrH()/2)+(ScrH()/4) )
surface.SetFont("gfont")
Surface.DrawText( Health )
[/lua]
- just doing some HUD testing off a tut :3[/QUOTE]
Can you take a screenshot of your folder structure for us?
You NEED a cl_init.lua file to be added inside of the init.lua.
To add a clientside file you addcslua file it inside of init.lua and include it in the cl_init.lua. Problem solved.
[QUOTE=brandonj4;35701929]You NEED a cl_init.lua file to be added inside of the init.lua.
To add a clientside file you addcslua file it inside of init.lua and include it in the cl_init.lua. Problem solved.[/QUOTE]
No not problem solved. This guy's cl_init.lua is clearly missing.
[QUOTE=Matt-;35711769]No not problem solved. This guy's cl_init.lua is clearly missing.[/QUOTE]
That's pretty much what I just said. Shasty Spy, before making a gamemode I would look at scripts first and maybe start editing code and modifying other mods before starting a gamemode from scratch.
[QUOTE=brandonj4;35714387]That's pretty much what I just said.[/QUOTE]
No you didn't; what you said didn't make any sense, especially since he's testing locally.
[QUOTE=Matt-;35715253]No you didn't; what you said didn't make any sense, especially since he's testing locally.[/QUOTE]
He doesn't even know how to declare a variable. What makes you think that he will make a gamemode?
[quote]
local person == LocalPlayer()
local Health == localPlayer():Health()
[/quote]
How does this not make sense?
You need to have a [B]cl_init.lua, init.lua and shared.lua file[/B] all inside of your gamemodes folder for your whole entire gamemode to work. They all must be added correctly with [B][U]include() and AddCSLuaFile()[/U][/B]
Okay brandonj4. Since November 2011 you have made 42 threads in this forum; each one was asking for help with the most simple things. I have been developing Garry's Mod gamemodes and addons for several years now, I know my way around the folder structure, I know how most hooks work, I know how most functions work. You don't know best, you can't help this guy, [B]you have no idea what you're talking about[/B].
[QUOTE=Matt-;35719870]Okay brandonj4. Since November 2011 you have made 42 threads in this forum; each one was asking for help with the most simple things. I have been developing Garry's Mod gamemodes and addons for several years now, I know my way around the folder structure, I know how most hooks work, I know how most functions work. You don't know best, you can't help this guy, [B]you have no idea what you're talking about[/B].[/QUOTE]
Yes, I do know what I am talking about. On top of that, having this come from someone who is a brony.. I really don't give a shit about what you think.
I do believe Matt is correct Brandon, the only reason that error would be showing up is if the file doesn't exist.
[QUOTE=brandonj4;35720136]Yes, I do know what I am talking about. On top of that, having this come from [b]someone who is a brony[/b].. I really don't give a shit about what you think.[/QUOTE]
So.. Me liking a show means I have no idea what I'm talking about? [URL="http://www.youtube.com/watch?feature=player_embedded&v=YPjFavgKO5I"]Gabe Newell is a brony.[/URL]
Furthermore, the OP is testing [b]locally[/b], AddCSLuaFile will solve nothing because that is for sending Lua files to clients. The OP just needs to post his folder structure and we can probably see what his issue is from there. No need to be so hostile.
[QUOTE=Jamie932;35720193]I do believe Matt is correct Brandon, the only reason that error would be showing up is if the file doesn't exist.[/QUOTE]
I have said this already quoting my post:
[QUOTE][B]You need to have a cl_init.lua, init.lua and shared.lua file all inside of your gamemodes folder for your whole entire gamemode to work. They all must be added correctly with include() and AddCSLuaFile()[/B][/QUOTE]
[QUOTE=brandonj4;35720245]I have said this already quoting my post:[/QUOTE]
Actually, you said this after rating me dumb, ripping on the OP's programming abilities and making no sense: [I]"You NEED a cl_init.lua file to be added inside of the init.lua."[/I]
[QUOTE=brandonj4;35720136]Yes, I do know what I am talking about. On top of that, having this come from someone who is a brony.. I really don't give a shit about what you think.[/QUOTE]
I highly doubt a users personal choice in TV shows really affects their programming ability.
[QUOTE=benjojo;35720876]I highly doubt a users personal choice in TV shows really affects their programming ability.[/QUOTE]
Did I ever say that? No I didn't. It affects my personal opinion about them. Why do people have to change words around to get things to go their way?
[QUOTE=brandonj4;35724055]Did I ever say that? No I didn't. It affects my personal opinion about them. Why do people have to change words around to get things to go their way?[/QUOTE]
You have a horrible perspective of life if you think that because, someone likes something you don't like it immediately makes you better than them. I strongly recommend you just drop this argument now as you're clearly making a fool of yourself.
[QUOTE=Matt-;35724380]You have a horrible perspective of life if you think that because, someone likes something you don't like it immediately makes you better than them. I strongly recommend you just drop this argument now as you're clearly making a fool of yourself.[/QUOTE]
Someone who likes watching ponies play on television that is a teenager isn't normal.
Also, it's funny how someone would spend $2 on me, I feel so special.
[QUOTE=brandonj4;35725606]Someone who likes watching ponies play on television that is a teenager isn't normal.[/QUOTE] I still don't see how it matters.
[QUOTE=brandonj4;35725606]Someone who likes watching ponies play on television that is a teenager isn't normal.[/QUOTE]
Once again, Why does this even come into this thread?
include( 'shared.lua' )
// Clientside only stuff goes here
function hidehud (name)
for k, v in pairs({"CHudHealth", "CHudBattery"}) do --Lets Hide The HUD!
if name == v then return false end
end
end
hook.Add("HUDShouldDraw", "hidehud", hidehud)
function GM:HUDPaint() //Capital P. Case matters.
self:BaseClass:HUDPaint()
local person = LocalPlayer()
local Health = LocalPlayer():Health() //Capital L. Case matters in Lua.
surface.CreateFont("mailartrubberstamp",64,400,false,false,"gfont")
surface.SetTextColor( 255, 255, 255, 255 )
surface.SetTextPos( 34, (ScrH()/2)+(ScrH()/4) )
surface.SetFont("gfont")
Surface.DrawText( Health )
end //Missed an end.
[QUOTE=brandonj4;35720136]Yes, I do know what I am talking about. .[/QUOTE]
Please refer to your title
[QUOTE=nick_9_8;35741189]Please refer to your title[/QUOTE]
I like how someone got so fed up with me they actually spent 2$ on me.
Are you still arguing? You've lost, just leave.
[QUOTE=brandonj4;35745347]I like how someone got so fed up with me they actually spent 2$ on me.[/QUOTE]
Oh right, I forgot $2 is something that will completely change someone's life...
Sorry, you need to Log In to post a reply to this thread.