Gday all,
What is an object's angular velocity measured in? Degrees per tick? second? minute?
[QUOTE=towerofpower256;39659793]Gday all,
What is an object's angular velocity measured in? Degrees per tick? second? minute?[/QUOTE]
[lua]print(self:GetLocalAngularVelocity())[/lua]
Imo its returns an angle (pitch, yaw, roll) and the values are its speed on each axes.
snp
[QUOTE=James0roll;39660489]I need a modeler, anyone want to be my modeler? Because I am using god damn cinder blocks for bread for my gamemode.[/QUOTE]This is the lua section.
There is a perfectly active section of the forum dedicated to modelling.
[QUOTE=James0roll;39660489]I need a modeler, anyone want to be my modeler? Because I am using god damn cinder blocks for bread for my gamemode.[/QUOTE]
Something common like this takes 20 seconds to search up on garrysmod.org
[url]http://www.garrysmod.org/downloads/?tag=Bread[/url]
snp
[QUOTE=CrashLemon;39659856][lua]print(self:GetLocalAngularVelocity())[/lua]
Imo its returns an angle (pitch, yaw, roll) and the values are its speed on each axes.[/QUOTE]
Correct but what is the unit of measurement that angular velocity is measured in? I've got an object that has a yaw angular momentum of 20 but 20 per what?
To be used to calculate how long an object will take to stop spinning if a constant amount of reverse angular velocity is applied.
Need some help. My NPC shop is not spawning like it should, the vector pos is set but yet no spawning. Any ideas?
[QUOTE=Gmremie;39665180]Need some help. My NPC shop is not spawning like it should, the vector pos is set but yet no spawning. Any ideas?[/QUOTE]
NPCEntity:Spawn()
NPCEntity:Activate()
Do you have that?
Quick question, is HTML embedding disabled? I'm trying to embed a media player to play a stream and it says "Missing plugin".
[QUOTE=Ice Tea;39665280]NPCEntity:Spawn()
NPCEntity:Activate()
Do you have that?[/QUOTE]
Actually no, but where is that supposed to be? Originally I followed [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index7853.html"]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index7853.html[/URL]
I need someone to fix an addon for me.
Download for the currently broken addon that needs fixing: [url]http://www.mediafire.com/?385mmkqm9ak5t7g[/url]
[QUOTE=Remscar;34505482][IMG]http://dl.dropbox.com/u/26392940/r1Bnl.png[/IMG](3)
Lua questions that don't deserve their own thread go here.
This means things like:
How to add jobs in DarkRP,
Where to find PERP,
How to shoot ponies out of a gun.
and if your IQ is above 30, then things like why vehicles aren't working on Linux servers.
[B]COOL STUFF TO LOOK AT!
[/B][U][B]General Faqs[/B][/U]: [URL]http://www.facepunch.com/threads/868561-Need-help-READ-THIS-FIRST[/URL]
[B][U]HOW TO LUA?[/U]:[/B] [url]http://wiki.garrysmod.com/?title=Lua_Tutorial_Series[/url]
[U][B]GLUA WIKI[/B][/U]: [url]http://wiki.garrysmod.com[/url]
[B]Previous threads that your probably wont look at:[/B]
[URL=http://www.facepunch.com/threads/931152-What-do-you-need-help-with-V1]Thread 1[/URL]
[URL=http://www.facepunch.com/threads/1068418]Thread 2[/URL][/QUOTE]
The "How to Lua" and "General Faqs" links are broken.
[QUOTE=Abyss;39667785]The "How to Lua" and "General Faqs" links are broken.[/QUOTE]
OP is banned so there's no fixing it, unless someone contacts a mod to change it.
Not sure where the general faqs were pointing earlier or what they said, but the lua tutorials are [url=http://wiki.garrysmod.com/page/Lua/Tutorials]here[/url] now.
[QUOTE=Charrax][ERROR] gamemodes/darkrp/gamemode/client/hud.lua:132: attempt to perform arithmetic on global 'Width' (a nil value)[/QUOTE]
You need to define the variables before you use them:
[CODE]surface.SetFont("HUDMainTwo")
local Width, Height = surface.GetTextSize(LocalPlayer().DarkRPVars.job)
draw.RoundedBox(6, midx - 64, hudypos2, Width / 2, hudheight / 2, Color( 50, 50, 50, 120 ))
[/CODE]
I realy can't get this shit working.
[lua]
render.SetScissorRect( 29, ScrH() - 76, 1, ScrH() - 27, true )
surface.DrawTexturedRectRotated(30, ScrH() - 76, 80, 80,0)
surface.DrawTexturedRectRotated(75, ScrH() - 74, 80, 80,180)
render.SetScissorRect( 29, ScrH() - 76, 1, ScrH() - 27, false)
[/lua]
[img]http://puu.sh/26aTt[/img]
I realy don't understand how the SetScissorRect works. When I set it on, it just removes the two textured boxes.
I need some help with my code. Simply it doesnt work.
I have an entity in the map im playing its name is "es1" with the obsolete pic
Shared:
[CODE]team.SetUp( 1, test, Color (0, 0, 255, 255))
team.SetSpawnPoint( test, "es1" )[/CODE]
Init:
[CODE]AddCSLuaFile( "shared.lua" )
AddCSLuaFile( "cl_init.lua" )
include( 'shared.lua' )
function spawn1( pl )
pl:SetTeam( 1 )
pl:Spawn()
end
add.concommand( spawn1, "spawn1" )[/CODE]
[QUOTE=Persious;39670430]I realy can't get this shit working.
[lua]
render.SetScissorRect( 29, ScrH() - 76, 1, ScrH() - 27, true )
surface.DrawTexturedRectRotated(30, ScrH() - 76, 80, 80,0)
surface.DrawTexturedRectRotated(75, ScrH() - 74, 80, 80,180)
render.SetScissorRect( 29, ScrH() - 76, 1, ScrH() - 27, false)
[/lua]
[img]http://puu.sh/26aTt[/img]
I realy don't understand how the SetScissorRect works. When I set it on, it just removes the two textured boxes.[/QUOTE]
Ben's photoshop skills come to the rescue once again!
Well i never used this but it seems quite simple. Let me explain it to you with the power of photoshop!
Lets say we got a health bar(this represents only the health bar, so the bar on left only):
[IMG]http://puu.sh/26c2f[/IMG]
- Yellow square is the ScrissorRect
- Red thingy is the health which is currently cut out by ScissorRect
- Gray thingy is the background of the health bar which is going to be filling up
Now if you just rotate the Red bar, it should appear to be filling up the gray bar:
[IMG]http://puu.sh/26c7s[/IMG]
Again, i never used this, this might be wrong.
[QUOTE=Persious;39670430]I realy can't get this shit working.
[lua]
render.SetScissorRect( 29, ScrH() - 76, 1, ScrH() - 27, true )
surface.DrawTexturedRectRotated(30, ScrH() - 76, 80, 80,0)
surface.DrawTexturedRectRotated(75, ScrH() - 74, 80, 80,180)
render.SetScissorRect( 29, ScrH() - 76, 1, ScrH() - 27, false)
[/lua]
[img]http://puu.sh/26aTt[/img]
I realy don't understand how the SetScissorRect works. When I set it on, it just removes the two textured boxes.[/QUOTE]
Use x+width and y+heigth in ScissorRect and it will clip stuff outside of that rect
[CODE]
render.SetScissorRect( x,y,x+width,y+heigth, true/false )[/CODE]
Ah, I get it now! Thanks.
[editline]21st February 2013[/editline]
[QUOTE=grobov13;39670957]Use x+width and y+heigth in ScissorRect and it will clip stuff outside of that rect
[CODE]
render.SetScissorRect( x,y,x+width,y+heigth, true/false )[/CODE][/QUOTE]
There's still a problem. Why the fuck does the png I'm using start on the middle with the coordinates? That's what messes it up
Quick Question,
Does anyone have a simple snippet/line of code that would work to change a viewmodel's material?
I'm planning on making a dynamic camo system for weapons, and have been wondering this for a while.
Sorry for not having any code to post, wanna get everything down before I actually start coding it.
Thanks in advance for any help received!
[QUOTE=DevilMarkes;39669291]You need to define the variables before you use them:
[CODE]surface.SetFont("HUDMainTwo")
local Width, Height = surface.GetTextSize(LocalPlayer().DarkRPVars.job)
draw.RoundedBox(6, midx - 64, hudypos2, Width / 2, hudheight / 2, Color( 50, 50, 50, 120 ))
[/CODE][/QUOTE]
Alright, but I get this error only when joining the server:
[ERROR] gamemodes/darkrp/gamemode/client/hud.lua:140: bad argument #1 to 'GetTextSize' (string expected, got nil)
1. GetTextSize - [C]:-1
2. DrawPlayerInfo - gamemodes/darkrp/gamemode/client/hud.lua:140
3. DrawHUD - gamemodes/darkrp/gamemode/client/hud.lua:382
4. unknown - gamemodes/darkrp/gamemode/client/hud.lua:477
I am pretty sure it is because while joining the player has no job. So it cannot find the text size.
It never occurs again. I only get see it after I joined.
[QUOTE=Charrax;39674805]Alright, but I get this error only when joining the server:
[ERROR] gamemodes/darkrp/gamemode/client/hud.lua:140: bad argument #1 to 'GetTextSize' (string expected, got nil)
1. GetTextSize - [C]:-1
2. DrawPlayerInfo - gamemodes/darkrp/gamemode/client/hud.lua:140
3. DrawHUD - gamemodes/darkrp/gamemode/client/hud.lua:382
4. unknown - gamemodes/darkrp/gamemode/client/hud.lua:477
I am pretty sure it is because while joining the player has no job. So it cannot find the text size.
It never occurs again. I only get see it after I joined.[/QUOTE]
[lua]
surface.SetFont("HUDMainTwo")
local Width, Height = surface.GetTextSize(LocalPlayer().DarkRPVars.job or "No Jobs")
[/lua]
[QUOTE=Persious;39671458]Ah, I get it now! Thanks.
[editline]21st February 2013[/editline]
There's still a problem. Why the fuck does the png I'm using start on the middle with the coordinates? That's what messes it up[/QUOTE]
TextureRectRotated draws material from center at specified coordinates to make rotating stuff easier. If you want to make circle shaped bars - actual texture should be like this (aka square):
[t]http://bbq.to/c3acc2479763d51308d5bdb0e8991acc_e0d0.png[/t]
So you can draw both background and bars at same coordinates without unnessesary adjusting.
for some reason, you can see other people in the gamemode, but you cant see your own model:
[IMG]http://cloud-2.steampowered.com/ugc/594744376214718331/A8115EFF9D3CE7EE958D09EE2AE96854D215D5CB/[/IMG]
This pic is of me via using the camera toolgun and looking at myself from third person.
[QUOTE=nuttyboffin;39676833]for some reason, you can see other people in the gamemode, but you cant see your own model:
-Snip-
This pic is of me via using the camera toolgun and looking at myself from third person.[/QUOTE]
What rock have you been living under? :P
Jk .. joking! ..
Its a standard problem with the 157 update. [url=http://facepunch.com/showthread.php?t=1247068&p=39633653&viewfull=1#post39633653]Fixed in the next update[/url]:
Info: [url]http://facepunch.com/showthread.php?t=1247068[/url]
[QUOTE=Nak;39677872]What rock have you been living under? :P
Jk .. joking! ..
Its a standard problem with the 157 update. [url=http://facepunch.com/showthread.php?t=1247068&p=39633653&viewfull=1#post39633653]Fixed in the next update[/url]:
Info: [url]http://facepunch.com/showthread.php?t=1247068[/url][/QUOTE]
Ah, thanks, hadnt noticed!
Can someone give me a example how to put the steam avatar on the hud ? Like ive been trying , but it keeps recreating and causing FPS issues, so any example would be great
[QUOTE=havejack;39680348]Can someone give me a example how to put the steam avatar on the hud ? Like ive been trying , but it keeps recreating and causing FPS issues, so any example would be great[/QUOTE]
Just don't recreate it? Put something like
[code]if (!MyPanel:IsValid()) then MyPanel = ... end[/code]
Sorry, you need to Log In to post a reply to this thread.