[QUOTE=infinitywrai;39188303]1. Is there any documentation on making and loading GWEN skins?
2. For making a simple menu, is it practical to just use surface/draw library functions + click hooks, instead of DButtons?[/QUOTE]
1. Don't know, never really seen a reason to need them
2. There's no reason to not use derma. If you don't like how the DButtons look, you could just use dbutton.Paint and use surface/draw libraries from there.
Anyone know why Gmod13 might not include any additional files in the initialization? I get errors like this because files with the code in are not being read.
[code]
[ERROR] gamemodes/dm/gamemode/cl_init.lua:146: bad argument #1 to 'pairs' (table expected, got nil)
1. pairs - [C]:-1
2. unknown - gamemodes/dm/gamemode/cl_init.lua:146
[/code]
I've included the files in init.lua but they are not being read.
[lua]
include("whatever.lua")
AddCSLuaFile("whatever.lua")
[/lua]
This a game mode from Gmod 12, so could anything be stopping it from including the files?
im new to lua and im trying to make it go ' if the player model is alyx, then set the run speed to 3000
[code]
function GM:PlayerSpawn(ply)
if ply:SetModel( "models/alyx.mdl" )
then ply:SetRunSpeed ( 3000 )
end
end
[/code]
obviously ply:setmodel isnt right though. what would i use instead
[B][URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index96ad.html"]Entity.GetModel [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG][/URL][/B]
[LUA]
function GM:PlayerSpawn(ply)
if ply:GetModel() == "models/alyx.mdl" then
ply:SetRunSpeed ( 3000 )
end
end
[/lua]
[QUOTE=Dachande;39192550]im new to lua and im trying to make it go ' if the player model is alyx, then set the run speed to 3000
[code]
function GM:PlayerSpawn(ply)
if ply:SetModel( "models/alyx.mdl" )
then ply:SetRunSpeed ( 3000 )
end
end
[/code]
obviously ply:setmodel isnt right though. what would i use instead[/QUOTE]
[lua]
function GM:PlayerSpawn(ply)
if ply:GetModel() == "models/alyx.mdl" then
ply:SetRunSpeed ( 3000 )
end
end
[/lua]
EDIT: Ninja
thanks guys
[editline]12th January 2013[/editline]
does luapad still work? im getting all kinds of weird errors i dont think i should be getting
[QUOTE=Dachande;39192656]thanks guys
[editline]12th January 2013[/editline]
does luapad still work? im getting all kinds of weird errors i dont think i should be getting[/QUOTE]
Luapad = Broken
I have
[lua]function PANEL:Init()
self.lblPing = vgui.Create("DLabel", self)
self.lblPing:SetText("Ping")
end[/lua]
then later on in the same file
[lua]function PANEL:PerformLayout()
self.lblPing:SizeToContents()
self.lblPing:SetPos(self:GetWide() - 50 - self.lblPing:GetWide()/2, self.PlayerFrame.y - self.lblPing:GetTall() - 3)
end[/lua]
My error:
[code][ERROR] lua/scoreboard/scoreboard.lua:117: attempt to index field 'lblPing' (a nil value)
1. unknown - lua/scoreboard/scoreboard.lua:117
[/code]
[editline]12th January 2013[/editline]
any ideas?
I'm using self.Owner:SetAnimation( PLAYER_ATTACK1 ) in my swep with the world and view models as the smg but the players world animation is still as if he's holding the pistol. What did I miss? Is attack1 just for a pistol hold or does it pull the attack1 animation from the weapon model itself?
-snip- below me
[QUOTE=Sean C;39193856]I'm using self.Owner:SetAnimation( PLAYER_ATTACK1 ) in my swep with the world and view models as the smg but the players world animation is still as if he's holding the pistol. What did I miss? Is attack1 just for a pistol hold or does it pull the attack1 animation from the weapon model itself?[/QUOTE]
You need to set the weapon's holdtype ([URL="http://wiki.garrysmod.com/page/Classes/Weapon/SetWeaponHoldType"]SetWeaponHoldType[/URL]) in SWEP:Initialize
I fixed my other problem, but does anyone know how to check if a player is warranted (clientside) on DarkRP?
[QUOTE=fairy;39194076]I fixed my other problem, but does anyone know how to check if a player is warranted (clientside) on DarkRP?[/QUOTE]
There is no way to see if they have a search warrant, but to see if they are wanted by the police you could use plyVar.DarkRPVars.wanted
[QUOTE=skullorz;39194114]There is no way to see if they have a search warrant, but to see if they are wanted by the police you could use plyVar.DarkRPVars.wanted[/QUOTE]
How would I go about making a new variable stored in player.DarkRPVars?
is there still a lua folder in gmod? literally cant find it, did garry change the way the system works or am i supposed to create the lua folder
[QUOTE=Dachande;39194469]is there still a lua folder in gmod? literally cant find it, did garry change the way the system works or am i supposed to create the lua folder[/QUOTE]
If you're talking about your clientside folder you have to make it.
yeah thats what i meant, thanks
I would like to know how, in Garry's Mod, to get a camera to stop doing this:
[code]
\__/
/ \
[/code]
and to, instead, do this:
[code]
__
/__\
/ \
[/code]
Which is to say, I don't want things that are above the camera to show the bottom surface, and the things below to show the top surface. I want a camera like Mario's, where all you can see is the top of the surfaces and the side that faces the camera.
For that matter, I also don't want it do skew the sides of the view.
SetCollisionGroup() wont works, i want make a "nocolide" player with the props and players but it don't works
[lua]
function coll(ply)
ply:SetCollisionGroup(COLLISION_GROUP_WORLD)
end
concommand.Add("PhyDebug", coll)
[/lua]
It just make player unable to push props.
How dare you push me to the page before the last! ... JK, but I don't want to post it again. It's basically, how do I make a 2D camera like Mario's?
How do I make an Orthogonal Camera! with lua?
[QUOTE=ExtReMLapin;39194753]SetCollisionGroup() wont works, i want make a "nocolide" player with the props and players but it don't works
[lua]
function coll(ply)
ply:SetCollisionGroup(COLLISION_GROUP_WORLD)
end
concommand.Add("PhyDebug", coll)
[/lua]
It just make player unable to push props.[/QUOTE]
You should use [url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index8483.html]this[/url]
is there a way to have the player spawn a prop through a script? what would it be?
[editline]12th January 2013[/editline]
what would the code look like to have him say like " /spawn prop " and it spawns the prop?
How do I make an Orthodontic Camera entity in lua? Specifically, how do I make a camera that doesn't have 3-Dimensional distortions, such as the bottom being visible if something is above the camera, and the horizontal skewing. I want a camera like the ones in Mario, where it isn't going to change how anything looks when the camera moves left, or right... or up, or down.
[editline]12th January 2013[/editline]
Okay, I figured it out, but it says that Ortho does this:
"... Orthographic mode seems to break the screen, no error however."
[QUOTE=Dachande;39195203]is there a way to have the player spawn a prop through a script? what would it be?
[editline]12th January 2013[/editline]
what would the code look like to have him say like " /spawn prop " and it spawns the prop?[/QUOTE]
[lua]
local dropped = ents.Create("prop_physics")
dropped:SetModel("whatevermdl")
dropped:SetPos( ply:GetPos() + Vector(0,0,40) + ply:GetForward() * 5 )
dropped:Spawn()
dropped:Activate()
[/lua]
I am trying to make a script that makes it night/day and I made a thread because I did not think and I need help with figuring what to do with engine.Lighstyle(int,string)
Thread: [url]http://facepunch.com/showthread.php?t=1239019[/url]
I think I need to do something like this. The example integer is 10, and string is "a".
[code] engine.LightStyle (10,"a")
render.RedownloadAllLightmaps
end [/code]
I have been told that Orthographic projection does actually work. How do I do that, though?
[code]function Swep:CalcView( PLAYER, PLAYPOS - Y*<Var>, <Angle that faces the world, with background behind the player>, 90--[[FOV]] )
local View = {}
View.Origin=PLAYPOS-Y*<Var>
View.angles=<Angle that faces the world, play in front>
View.fov=90
View.Ortho=true or View.ortho=true
return View
end[/code]
Hey,
I'm currently creating my scoreboard but how do I sort players by alphabet or by ULX Groups?
Currently using darkrp teams:
cat:SetLabel(team.GetName(a).. " (".. #team.GetPlayers(a) ..")")
For my matter, how do I get Orthographic Projection working and active? How do I use it, as in, make it happen?
[editline]13th January 2013[/editline]
Let me clear that up... how do I make a CalcView that is Orthographic?
[QUOTE=luavirusfree;39197184]For my matter, how do I get Orthographic Projection working and active? How do I use it, as in, make it happen?
[editline]13th January 2013[/editline]
Let me clear that up... how do I make a CalcView that is Orthographic?[/QUOTE]
You could also drops the fov low, to like 30 or something and you kind of get the effects of ortho. I've never tried the ortho params for calcview myself but just check the wiki example. You need a hook clientside for calcview that calls your function that passes a table with what you want. If you only wanted to change the fov for example you just send a table with the fov data changed to overwrite the defaults.As in
[lua]function myfunc(all those calcview params)
tabelnamewhatever = {}
tablenamewhatever.fov = 30 (default 75 I think)
return tablenamewhatever[/lua]
Doing it with the built in ortho stuff would be similar, give the wiiki a look it should come together and make sense.
1. How do I remove/round the corners on a PNG? For example, say I have a square PNG for my HUD, but I want to give it rounded corners.
2. Are there masking functions of some sort? Is it possible to make a curved health bar?
Sorry, you need to Log In to post a reply to this thread.