Ulysses

General => Off-Topic => Topic started by: Bite That Apple on November 17, 2013, 02:08:14 AM

Title: Custom ulx getting usergroup command?
Post by: Bite That Apple on November 17, 2013, 02:08:14 AM
Well first off, I should make this clear. I do not use the wiki for ulx as I hate it, and it's just not very 'good', no offense to any of you if one of you have written it. I just don't really like it, and confuses me a lot more than I need to be confused, so it's best if I ask my rare questions here anyways.

What is the command that detects what usergroup a player is on, not the garry's one, the ulx one?
Title: Re: Custom ulx getting usergroup command?
Post by: Bite That Apple on November 17, 2013, 02:14:01 AM
Actually... I just found it.

ply:GetUserGroup

why wasn't this added to the default garry's mod functions anyways... I NOE UNDERSTAND GARRY ?


(This can be closed or w/e)
Title: Re: Custom ulx getting usergroup command?
Post by: Megiddo on November 17, 2013, 03:37:27 PM
Chaos, it's not a wiki, and it's generated directly from the source code. What's confusing about it?
Title: Re: Custom ulx getting usergroup command?
Post by: Bite That Apple on November 18, 2013, 07:26:31 AM
Chaos, it's not a wiki, and it's generated directly from the source code. What's confusing about it?

...it's just not... well written I feel. I've had issues trying to find what I need from 'generated source code'. Sorry, :/
Title: Re: Custom ulx getting usergroup command?
Post by: Megiddo on November 18, 2013, 04:25:05 PM
If you gave us specifics, we could try to address your concerns.
Title: Re: Custom ulx getting usergroup command?
Post by: Bite That Apple on November 18, 2013, 04:45:40 PM
If you gave us specifics, we could try to address your concerns.

It's more of a personal preference of mine, I would never want you to change anything because it's more of the way I like to be able to read things. I best sum this up, but I feel dirty saying it on this forum. I'm just not.. familiar on how ulx script works. I don't really understand it at all, so for me to go on the docs, it would basically waste my time as I just don't understand how any of it works. You guys also made like your own version of lua with ulx :p
Title: Re: Custom ulx getting usergroup command?
Post by: Megiddo on November 18, 2013, 04:58:54 PM
Hmm, fair enough. Thank you for sharing. :)

We did intentionally shy away from Garry's modifications to Lua and in the process made some of our own. I can understand why it may feel overwhelming.
Title: Re: Custom ulx getting usergroup command?
Post by: Bite That Apple on November 18, 2013, 05:36:26 PM
Hmm, fair enough. Thank you for sharing. :)

We did intentionally shy away from Garry's modifications to Lua and in the process made some of our own. I can understand why it may feel overwhelming.

Thank you for understanding. My New Year's revolution is to learn how some of ULX works. Most of my new addons are going to be working alongside with ULX for now on (Most of my addons are for ulx anyways). Yeah, soon enough I'll have four major projects to be dealing with. One being learn the ulx way, second being my newest gamemode, third being the completion of my MySQL chat, and lastly being my Top Secret addon that will change the world around us (If you're using my addon of course.)
Title: Re: Custom ulx getting usergroup command?
Post by: JamminR on November 18, 2013, 07:47:45 PM
Lua + ULX module for 3d Virtual Reality holodeck... who knew.
Title: Re: Custom ulx getting usergroup command?
Post by: Bite That Apple on November 29, 2013, 06:37:19 PM
So now I'm at a different issue...

Would there be a way to get the usergroup color while using this command ply:GetUserGroup
Title: Re: Custom ulx getting usergroup command?
Post by: Megiddo on November 29, 2013, 06:54:00 PM
Only teams have colors, but teams are not usergroups.
Title: Re: Custom ulx getting usergroup command?
Post by: JamminR on November 29, 2013, 08:32:19 PM
What Megiddo said.
Bit more - All UTeam does is assign teams to groups, and not always the same name.
To make it a bit more complicated, Gmod's teams are numbers I think (and now that I read more on it at the wiki, it's the Source engine that makes them numbers)
ULib groups + Gmod Teams + ULX's UTeam = it can all be done, there's just LOTS of translations and checks to be done.
Helpful commands such as team.GetColor, team.GetPlayers and team.GetName would serve you well.
http://wiki.garrysmod.com/page/team (http://wiki.garrysmod.com/page/team)
Title: Re: Custom ulx getting usergroup command?
Post by: Bite That Apple on November 30, 2013, 12:02:12 AM
Well this addon I'm making specifically is using ulx/ulib, but it doesn't work well when it's on non-sandbox gamemodes. Though I could use ply:GetUserGroup() but I need to able to get the color of that usergroup, and the team name of that usergroup.  I honestly have spent two weeks on this and I do not want to put effort into basically going through ulx and trying to find out how uteam works exactly...

So any suggestions?
Title: Re: Custom ulx getting usergroup command?
Post by: Megiddo on November 30, 2013, 07:48:58 AM
If you're only looking for ULX compatibility, you can pull the information from the ULib.ucl.groups table (just do not modify the data there). All the color information is stored there, if the usergroup is assigned a team. I don't have the format in front of me at the moment, but this should get you on the right track.
Title: Re: Custom ulx getting usergroup command?
Post by: JamminR on November 30, 2013, 10:10:53 AM
Chaos, just realize that, part of the challenge you'll find is that many people don't use UTeam, and allow gamemodes to set team colors if any.
Megiddo, does our UCL group contain color information if not assigned in UTeam?
That is, will our table update when a team color gets assigned by another non-ulx/ulib function?
Title: Re: Custom ulx getting usergroup command?
Post by: Megiddo on November 30, 2013, 10:15:14 AM
Megiddo, does our UCL group contain color information if not assigned in UTeam?
That is, will our table update when a team color gets assigned by another non-ulx/ulib function?

No, it was never intended to record/present that information.