Jump to content

Nick

Technical Administrator
  • Content Count

    565
  • Joined

  • Last visited

  • Days Won

    8

Nick last won the day on November 16 2019

Nick had the most liked content!

Community Reputation

866 Silver 4

About Nick

  • Rank
    Forum Administrator
  • Birthday 09/04/1998

Personal Information

  • Location
    Denmark

Computer Information

  • CPU
    Intel i7-4790k
  • GPU
    MSI GTX 980 Ti Gaming 6
  • Ram
    4x8gb DDR3

Recent Profile Visitors

11,620 profile views
  1. Quarantine

    I initially thought it'd be easy for me to just stay at home (since all my uni stuff and work can be done remotely anyway), but I must admit that I started missing getting out quite fast, haha. I started running again (haven't done so for a few years) which really helps keep my head clear. I visit my girlfriend, or she visits me, every few days since we live close by each other (and our combined household size is just 3 people). Been talking a lot more with family lately (especially the older members, aha) over Messenger and phone, which is always nice, but corona should really not be the reason I get in touch with them. πŸ˜… Oh, yeah... I bought a Valve Index in December so I could play Half-Life: Alyx at release (without getting impacted by stocking issues), but my darn left controller broke last month, and I am still going through RMA. So no HL:A for me yet since I don't wanna use my HTC Vive. Would have been a great distraction from corona though, haha. πŸ˜„ I have seen a spike in my motivation for stuff such as GFL which is always nice. I've been less prone to just mindlessly play League of Legends. I am not sure why tbh. It might be because that sitting on my ass all day makes me want to be more productive while sitting on my ass. All in all, corona hasn't affected me that much.
  2. Hi, @Kittinger. Happy to hear that! I just read through the work you sent in DMs; it looks very promising, so it'll be a +1 from me! I also asked in the DM, but I'll ask again here: Are you alright with me sharing your work with the rest of the team? πŸ˜„
  3. Your application has been accepted. Welcome to the team! I'll send you a DM soon to get you fully on-board. πŸ˜„
  4. Hi, @MicLieg! Thanks for applying! You sound like a solid dev from how you've described yourself. Do you have any projects or code you could show us? I was also wondering if you already have experience with SourceMod or if that's some thing you'd like to learn? πŸ˜„
  5. I actually don't think there is much difference in terms of instructions between doing this or not. And I agree with you that it is much cleaner as you avoid a lot of nested if-statements. My software architecture professor taught us to do it too. πŸ˜„ Just to show it working I'll share an example in Lua: local whitelist = {"35", "36", "37", "38", "39", "40", "41", "42", "43", "14", "15", "16", "24", "25", "26" } hook.Add("PlayerUse", "SWRPButtons", function (ply, ent) --print(ent:GetModel()) local e = ent:GetModel() e = tostring(e) if !table.HasValue(whitelist, tostring(ply:Team())) then if ent:GetClass() == "func_button" then if e == "*426" || e == "*424" || e == "*413" || e == "*425" || e == "*176" || e == "*159" || e == "*158" || e == "*157" || e == "*371" || e == "*370" || e == "*412" || e == "*413" || e == "*486" || e == "*487" || e == "*726" || e == "*187" || e == "*58" || e == "*405" || e == "*187" || e == "*58" || e == "*696" || e == "*40" || e == "*43" then return false; end end else return true; end end); This code has a lot of issues, so I made a few changes an adapted above technique and it came a lot easier on the eye (at least to me): local whitelisted_teams = {"35", "36", "37", "38", "39", "40", "41", "42", "43", "14", "15", "16", "24", "25", "26" } local restricted_buttons = {"*426", "*424", "*413", "*425", "*176", "*159", "*158", "*157", "*371", "*370", "*412", "*413", "*486", "*487", "*726", "*187", "*58", "*405", "*187", "*58", "*696", "*40", "*43"} hook.Add("PlayerUse", "SWRPButtons", function (ply, ent) -- Ignore non-buttons if ent:GetClass() ~= "func_button" then return end -- Ignore buttons that are not restricted. local e = tostring(ent:GetModel()) if !table.HasValue(restricted_buttons, e) then return end -- Reject use if the player is not on a whitelisted team. if !table.HasValue(whitelisted_teams, tostring(ply:Team())) then return false end end);
  6. To be honest, I'd take @_Rocket_'s advice with a grain of salt. It is often a bad idea to do micro-optimizations right off the bat. Your code might use one or two instructions less, but you'd not feel any difference unless it's a very critical part of the code. However, with the reduced readability you'll have a hard time understanding, debugging, and expanding your code. I'd rather recommend writing your code how you'd like to write, and then find "hot paths" through profiling tools, and then do the micro-optimizations as the very last step or only if necessary. I threw the two pieces of code into a compiler for fun, and the readable version seemingly uses less instructions: https://godbolt.org/z/dh4vpT Our dear compilers are very smart, and they can optimize a lot of things for us, but we can quickly confuse the compiler by trying to be smart ourselves. This is another reason why I recommend letting testing dictate what code you micro-optimize. You should also avoid putting implementations into header files. Header files are intended to only contain definitions (not implementations), so you can use the defined behavior without having to recompile the code which would slow your compilation down and probably increase your binary's file size. This happens because the pre-processor just stuffs everything you #include into the "same file" and then compiles that. Thus if you split the code into .h and .cpp, it will work after linking since the defined behavior can be found in another compilation unit (the .cpp). The other way around the behavior will be compiled every time you use. So first solution (split code into .h and .cpp): store compiled code in one compilation unit and use it through linking in other units. Second solution (having your code in .h): Store the compiled code in every compilation unit that uses it. In some cases the latter is faster due to in-lining, but then you're really deep into micro-optimizing. You can read a little more about it here: https://stackoverflow.com/a/583271 Personally, I'd just stick with the classic .h+.cpp. πŸ˜„ EDIT: Aren't the two code snippets different too? If I gave it a reference to a variable containing 10000, then the first code snippet would not modify the variable, but the 2nd snippet will always add 1.
  7. Hm, might be worthwhile to rebrand my memey post into something more appealing. I'll look into it! In other news, I finally got my GPU working with FaH. πŸ˜„
  8. I had a good talk with @Cryotheum on Discord. Your work is nice, and you seem very motivated, and I think you'd make a great member of the team. +1
  9. Thanks for the talk on Discord! You seem quite solid from what I've seen, so it's a +1 from me for now. πŸ˜„ I'll wait for a few more opinions.
  10. Denied due to inactivity.
  11. Hi, @Kittinger. I look at the code you sent, and it looks pretty solid (shows understanding of a lot of things in impressively few lines! πŸ˜ƒ). I apologize for the delay in the handling of your application, are you still interested in becoming a developer?
  12. Hi, @s4mple. That's alright. Thanks for your interest and feel free to reapply in the future! πŸ˜„
  13. Alright, feel free to add me on Discord, then we'll have a chat. My handle is Nick 🍌#6127. πŸ˜„
  14. Hi, @Paul. Your application has been accepted! I'll send you a DM soon with information to get you started. Welcome to the team! πŸ˜„
×
×
  • Create New...