Guthen / guthlevelsystem

Garry's Mod Level System
Apache License 2.0
12 stars 0 forks source link

Pretty much everything the linked addon has that this one doesn't have already #7

Closed KekkyShmekky closed 2 years ago

KekkyShmekky commented 2 years ago

https://steamcommunity.com/sharedfiles/filedetails/?id=1747642523&searchtext=levelling+system

Guthen commented 2 years ago

Well, I think there are only 2 features my system does lack compared to Topher's one which are XP Bonus for Usergroups and Prestige, the others are already implemented.

However, I might add them when I will have enough time to work on this addon.

Thankx for your suggestion though :p

KekkyShmekky commented 2 years ago

Hey so I actually looked through the GitHub and didn't see any mention of custom HUD positioning for clients, so it would also be great to have that in there to work with other HUDs. Thanks!

Guthen commented 2 years ago

Hmm yes, the position can only be modified by the server, I'm not sure if players would want to edit the position by themselves but I could add that aswell

Guthen commented 2 years ago

I'm listing tasks of this issue todo below to clarify a bit

Todo:

Guthen commented 2 years ago

8 has just been resolved

KekkyShmekky commented 2 years ago

Hey so I noticed players don't get XPs for killing NPCs on this pack even though I tried making it work with this

if ( not ent:IsNPC() and not ent:IsNextBot() and not scripted_ents.IsBasedOn(ent:GetClass(), "npc_creature_base")) or not take then return end

https://steamcommunity.com/sharedfiles/filedetails/?id=1516718459

Certurix commented 2 years ago

This addon use a custom Class, so yes its not working by default, because its not using the default SNPCS Class of Garry's Mod.

"if ( not ent:IsNPC() and not ent:IsNextBot() and not scripted_ents.IsBasedOn(ent:GetClass(), "npc_creature_base")) or not take then return end" Is this code working?

Guthen commented 2 years ago

Hey, you should create a new issue for this problem (since it's mostly already fix, you don't have to, but please report in new issues in the future). I will try to give a look tonight. Thanks for the report :p

Guthen commented 2 years ago

Alright, I just made a commit (not so much changes in the code as you can tell) which should fix compatibility with any other mods (in theory). I tested it with the addon you just gave and it works fine now, tell me if it is for you too

KekkyShmekky commented 2 years ago

Hey so the fix worked. Thanks!

Guthen commented 2 years ago

Nice, no problem :)

KekkyShmekky commented 2 years ago

Hey so I recently updated to 1.8.0 and I found that I can't see the addon's HUD anymore for some reason

Guthen commented 2 years ago

Hey so I recently updated to 1.8.0 and I found that I can't see the addon's HUD anymore for some reason

Hey, did you edit anything, like the sh_config.lua or the HUD file? If so, ensure that guthlevelsystem.DrawHUD is set to true & and guthlevelsystem.SelectedHUD is set to a correct value (or send what you edit)

KekkyShmekky commented 2 years ago

Hey so DrawHUD is set to true and the selected HUD is "default_text"

Guthen commented 2 years ago

Hey so DrawHUD is set to true and the selected HUD is "default_text"

Sounds fine, I have no ideas why it's not working though. Does it do the same if you re-install the mod without touching to the files (even the config files)?

KekkyShmekky commented 2 years ago

Hey so I just reinstalled the mod without touching anything at all, and it still doesn't show the HUD.

Guthen commented 2 years ago

Hm, that's weird, did you install an other addon (HUD or anything) recently?

If so, try to remove them or enter this command in your game's console (when you are in your server) to see which one could conflict: lua_run_cl PrintTable( hook.GetTable()["HUDShouldDraw"] ) (you can send the output here)?

You have to set the convar sv_allowcslua 1 in your server's console first. If you find the cause, tell me

Guthen commented 2 years ago

@Certurix have the same problem than you and the above idea didn't really helped, so it might be my fault, I will try to figure it out on a local dedicated server, I will inform you on my progress

Guthen commented 2 years ago

Just found out that HUD files weren't sent to client upon connection causing the HUD code to not run and to throwing errors. This issue should be fixed now

KekkyShmekky commented 2 years ago

I still can't see the HUD even after a restart. I printed the hook tables via ULX and your hook didn't actually show up anywhere.

Guthen commented 2 years ago

So the fix I just made does not work? Do you have any errors while joining your server (check the 'Problems' menu of gmod)?

For the hooks, if you did it with the ulx luarun command, it's normal that it shows nothing because it's run server-side and not client-side, and server do not handle HUDs. It's why I asked specifically to run it in your game's console

KekkyShmekky commented 2 years ago

The ulx gethooktable command is actually meant to be run on players and HUDShouldDraw didn't yield any of your hooks/events even when I ran it on myself.

I also didn't find any errors while joining the server.

Guthen commented 2 years ago

Alright, just made a fix thanks to Sidroz on my discord server, it should definitely work. Lemme know

KekkyShmekky commented 2 years ago

Hey so the HUD shows, but it doesn't seem to update its position live like before the update.

Guthen commented 2 years ago

Hey so the HUD shows, but it doesn't seem to update its position live like before the update.

Yes, you also have to save the cl_hud.lua to apply your changes in the HUDs

KekkyShmekky commented 2 years ago

Tried that with no luck

EDIT: Nvm it works now!

Guthen commented 2 years ago

Nice!