HUD drawing Tutorial. For learners!

on behalf of the Facepunch community this thread is no longer available to read. If you want to learn more lua just use gmod wiki. Too much complaining.

What.

?.. whats the problem?

[editline]17th May 2014[/editline]

here comes the shit ton of criticism and abuse for trying to help people learning lua…

You’re contradicting yourself in your “tutorial” by saying if they know nothing about functions or variables that they should leave. Then later on you end up introducing it anyway.

It just doesn’t make any sense at all.

no no. I imply that if they do not know what a variable or function is then to leave. I later explain what they do…
Its a rough post, im using a phone so its harder to write and explain correctly without being able to look back to to how hard it is. Plus its an opening statement. The purpose of this was to teach…Not being criticised for something that may be said wrong thats not part of the tutorial.
Theres a vast lot of differences between knowing 0 code and knowing a bit. its pointless taking a lesson on how to write literature if you dont know english. same applies here. Theres no point taking this lua tutorial if you have no knowledge on it and have no clue whats going on.

You’re contradicting yourself again. The point is, this wasn’t a very well constructed tutorial, no offense.

What you should have did was make a formatted tutorial which would be much easier to read.

The code format you chose isn’t clean either, you don’t explain why you use GM and you don’t explain the syntax for calling the MyHUD() function at all.

There is no explanation of where to put the file. I say this because using clientside hooks requires a specific syntax or location for this realm.

You should reconsider the way you present and explain your tutorial, I feel like it will cause a lot of confusion for people that are actually trying to learn glua.

Ill re-edit this tomorrow when i get my pc back! ill explain syntaxes an GM on a separate topic. Im explaining some basic things in this like the arguments and variables.
Ive gone from easiest to hardest (my opinion)
Once people can get a basic understanding of the code they can use what they learnt to read other people CLEAN code and come to understand it better off their own accord. My bad too, The owner of the code did mention it wasn’t clean, i forgot to state this.

I find your lack of maturity humourous.

If you can’t accept constructive criticism don’t post in the first place.

I only received this part of the paragraph at first "You’re contradicting yourself again. "
I thought you were repeating your self giving non-constructive criticism and trying to argue. I changed the reply after I received it all.

[editline]17th May 2014[/editline]

“Ill re-edit this tomorrow when i get my pc back! ill explain syntaxes an GM on a separate topic. Im explaining some basic things in this like the arguments and variables.
Ive gone from easiest to hardest (my opinion)
Once people can get a basic understanding of the code they can use what they learnt to read other people CLEAN code and come to understand it better off their own accord. My bad too, The owner of the code did mention it wasn’t clean, i forgot to state this.”

Why is the title image C++?,
Also, if it’s for ‘learners’ why are you telling them to piss off if they don’t know what a function is.

Here: http://forum.facepunch.com/showthread.php?t=1243669&p=39420702&viewfull=1#post39420702

[lua]function GM:HUDPaint()
MyHUD()
end

function MyHUD()[/lua]

Please for the love of Odin don’t override GM functions when you don’t need to (use hooks instead), and don’t make your function global if it doesn’t need to be.

The title image wont chnage on my phone, ill change it later. And i just explained this to brandonj!!

[editline]18th May 2014[/editline]

i explained this is not my code. Its not clean but im using the good parts as examples and teaching people what they do. If they came here to learn variables and functions im sure they arent going to notice or understand syntaxes and GM fuctions

Why not use your own code then?

im going to start making a small HUD for deathrun today and probably finish it tomorrow ill re-edit this whole post and start from scratch got to be honest its quite shit and very confusing. In the mean time ill get the HUD from gmod wiki as it should work and better to explain.

[editline]18th May 2014[/editline]

Ill change the drawing part though. What about creating a new function and using hook.Add?
eg
Code
function Functionname()
“Box code here”
end
hook.Add(“hooks”)

[editline]18th May 2014[/editline]

local gradient = surface.GetTextureID (“gui/gradient.vtf”)

function Drawhud()
local ply = LocalPlayer()
surface.SetDrawColor(Color(255,255,255,200))
surface.SetTexture( gradient )
surface.DrawTexturedRect( 0, ScrH()-50, 300, 50 )

draw.DrawText( "Health: "..ply:Health(), "HudHintTextLarge", 5, ScrH()-40, Color(255,0,0,200) )

end
hook.Add(“HudPaint”, “HudDraw”, DrawHUD
Would this still work?

  1. Use

 tags.
2. You're asking if something would work in your own HUD tutorial?
3. No, you aren't drawing the HUD anywhere.

http://cdn.steamcommunity.com//economy/emoticon/:rfacepalm:

I had a feeling he didn’t know what he was talking about when he stated that he didn’t even write the example script.

Yep i have no idea at all what im talking about. Im just assuming what all shit is. :wink:
all i did was ask if a piece of code I edited FOR YOUR BENEFITS so you would stop complaining would still work.
is that all you do is complain xD I change something for you double check with you if its correct and you still complain. How about i lock the thread and tell everyone trying to learn the basis of lua to go fuck themselves and try learn it on their own without any knoledge. Ill send them to the gmod wiki and expect them to code like garry after a day or two :slight_smile:

Grow up.

There’s a lot of people in the world that do this already.

If you want to lock the thread ask a mod to lock it or mark it as solved.

Grow up? wow that made me laugh. Your a nob mate. A new member who wanted to help others is being ranted at by some twat with a gold title who thinks hes bigger than everyone. :wink: get the mods on me as well if you like such a welcoming community!


(User was banned for this post ("Flaming/Shitpost" - Swebonny))