[QUOTE=Xervion;37293897]I tried that, and here is what I get when I try to run it with "lua_run_cl":
[CODE] lua_run_cl lua/hud.lua
[LuaCmd:1] '=' expected near '/'
[/CODE]
And when I just try to run it with lua_run, it gives me nothing, along with making it autorun.[/QUOTE]
Use lua_openscript_cl to open files, and not lua_run_cl.
I can't include files in another folder for some reason. This is what I try to do on the client: [I]include( "items/test.lua" )[/I]. This is the error I get: [I]Couldn't include file 'items\test.lua' (File not found)[/I].
Any ideas? I can include files in the same folder just fine. And the folder & file exist.
[QUOTE=Panto;37296234]I can't include files in another folder for some reason. This is what I try to do on the client: [I]include( "items/test.lua" )[/I]. This is the error I get: [I]Couldn't include file 'items\test.lua' (File not found)[/I].
Any ideas? I can include files in the same folder just fine. And the folder & file exist.[/QUOTE]
I'm having the same issues. I've also noticed that I can include across folders, serverside.
How the hell do you get gestures to work for models?
[code]
Ent:SetPlaybackRate(1)
Ent:RestartGesture(0)
Ent:SetCycle(0)
[/code]
Tried combinations of LookupSequence and such, nothing ever happens.
[QUOTE=TylerB;37296929]How the hell do you get gestures to work for models?
[code]
Ent:SetPlaybackRate(1)
Ent:RestartGesture(0)
Ent:AnimSetGestureWeight( 0, 1 )
Ent:SetCycle(0)
[/code]
Tried combinations of LookupSequence and such, nothing ever happens.[/QUOTE]
Whats the name of the sequence your trying to use?
[editline]18th August 2012[/editline]
Could you also provide a bit more code.
[QUOTE=Aide;37297069]Whats the name of the sequence your trying to use?
[editline]18th August 2012[/editline]
Could you also provide a bit more code.[/QUOTE]
Ent:RestartGesture(Ent:LookupSequence("taunt01"))
I was working on an e2 with an extension for Lua, and I was running that code on a hologram.
[code]
local Ent = Entity("+holoEntity(1):id()+")
[/code]
Quick problem, i use the wiki-approved way of finding the current ammo of another player but it just lists the max amount the weapon can contain (e.g. 256 for smg).
Where target is a player.
ammo = target:GetAmmoCount(target:GetActiveWeapon():GetPrimaryAmmoType( ))
Thanks for your help :)
[QUOTE=smallfry;37294247]Is there an easy way to show a visible line ingame to debug traces? [url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index332a.html]render.DrawBeam[/url] seems like the way to go, but I can't get it to show anything (working within the primary attack function of a SWEP).[/QUOTE]
Depends why you want to draw the line. If you want it for debugging, look up the debugoverlay library.
If you actually want a nice looking line (not 1px wide) for a weapon firing effect, your best bet is to make a scripted effect. They're fairly simple, have a look through existing effects if the tutorials on the wiki don't help.
[QUOTE=Lexic;37290041]When in doubt, put a print statement. Try shoving print(x, y) before the line which errors and see what it outputs.[/QUOTE]
Well it prints nil nil, but the thing is, this never used to happen in GM12. Any ideas whats causing this to happen?
[QUOTE=smallfry;37294247]Is there an easy way to show a visible line ingame to debug traces? [url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index332a.html]render.DrawBeam[/url] seems like the way to go, but I can't get it to show anything (working within the primary attack function of a SWEP).[/QUOTE]
Show us your code.
[QUOTE=Crap-Head;37298267]Well it prints nil nil, but the thing is, this never used to happen in GM12. Any ideas whats causing this to happen?[/QUOTE]
Garry might've broken the function when he fiddled with the fonts.
You are setting up your font with the new method right? If you are, post a bug report in the GM13 forum. If you're not, go read the changelog to see how the new system works.
[QUOTE=Lexic;37298952]Garry might've broken the function when he fiddled with the fonts.
You are setting up your font with the new method right? If you are, post a bug report in the GM13 forum. If you're not, go read the changelog to see how the new system works.[/QUOTE]
Fonts set up with the new table system. Gonna post a bug report now, thank you!
Hey guys, how can I validate a model path on the client without using ClientsideModel? Spawning an entity for the sake of a single test is not an optimal approach :v:
Right now I've got this set up;
[lua]local model = ClientsideEntity(path, RENDERGROUP_OPAQUE)
if !model then return "models/error.mdl" end
return path[/lua]
It's a bit inefficient :D
[QUOTE=Splambob;37299178]Hey guys, how can I validate a model path on the client without using ClientsideModel? Spawning an entity for the sake of a single test is not an optimal approach :v:
Right now I've got this set up;
[lua]local model = ClientsideEntity(path, RENDERGROUP_OPAQUE)
if !model then return "models/error.mdl" end
return path[/lua]
It's a bit inefficient :D[/QUOTE]
[url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexcb0c.html]util.IsValidModel?[/url]
For some reason I thought that was server only, thanks for proving me wrong <3
Would anyone know what fonts like HUDNumber and Trebuchet were renamed to? Perhaps a list of the new fonts?
[QUOTE=Crap-Head;37299348]Would anyone know what fonts like HUDNumber and Trebuchet were renamed to? Perhaps a list of the new fonts?[/QUOTE]
They were all removed in 13, you have to recreate them yourself.
No-one really seems to know what their exact settings/parameters were either.
util.IsValidModel seems to be unreliable?
[code]
"hello!" returns false
"models/holograms/hq_icosphere.mdl" returns true
"models/props_combine/breenbust.mdl" returns false
"models/Combine_Scanner.mdl" returns false
"models/error.mdl" returns true
[/code]
All the model paths are valid and work with ClientsideModel.
Clientside in GM12 btw.
[QUOTE=Drakehawke;37299550]No-one really seems to know what their exact settings/parameters were either.[/QUOTE]
[code]
"HUDNumber"
{
"1"
{
"name" "Trebuchet MS"
"tall" "40"
"weight" "900"
}
}
[/code]
See resources/GmodSchemes.res file.
bot_sendcmd doesn't work and nor does ConCommand on bots work so I have no idea on how to execute commands from bots.
[QUOTE=CGNick;37300022]bot_sendcmd doesn't work and nor does ConCommand on bots work so I have no idea on how to execute commands from bots.[/QUOTE]
Maybe try SendLua & RunConsoleCommand?
[QUOTE=Drakehawke;37300048]Maybe try SendLua & RunConsoleCommand?[/QUOTE]
But I'm trying to execute commands such as +forward, for movement and such.
[QUOTE=Undefined;37299815][code]
"HUDNumber"
{
"1"
{
"name" "Trebuchet MS"
"tall" "40"
"weight" "900"
}
}
[/code]
See resources/GmodSchemes.res file.[/QUOTE]
For whatever reason, i cannot find this file in my resources folder. Also tried my resource folder, its not there. Mind uploading it?
[QUOTE=Crap-Head;37301103]For whatever reason, i cannot find this file in my resources folder. Also tried my resource folder, its not there. Mind uploading it?[/QUOTE]
Probably in the GCF?
Is there a function to set a players active weapon? I know there is "GetActiveWeapon()" but is there a way to to set it instead of getting it. Any help is appreciated in advance.
Pseudo Code Of What I Mean...
[lua]
ply:Give("weapon_pistol")
ply:SetActiveWeapon("weapon_pistol")
[/lua]
Ive been trying to make a !donate command that would open the Steam Browser with the URL and Im not exactly sure how to do that :|
[QUOTE=Zandorum;37302078]Ive been trying to make a !donate command that would open the Steam Browser with the URL and Im not exactly sure how to do that :|[/QUOTE]
[url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index2c41.html[/url]
[QUOTE=Mythikos;37301950]Is there a function to set a players active weapon? I know there is "GetActiveWeapon()" but is there a way to to set it instead of getting it. Any help is appreciated in advance.
Pseudo Code Of What I Mean...
[lua]
ply:Give("weapon_pistol")
ply:SetActiveWeapon("weapon_pistol")
[/lua][/QUOTE]
Player:SetActiveWeapon( Entity wep )
Player:ConCommand( "use <weapon_class>\n" )
[QUOTE=Crap-Head;37301103]For whatever reason, i cannot find this file in my resources folder. Also tried my resource folder, its not there. Mind uploading it?[/QUOTE]
As Drakehawk said, it's in the GCF. Use [url=http://nemesis.thewavelength.net/index.php?p=26]GCFScape[/url] then open SteamApps/garrysmod content.gcf.