Author Topic: Custom ulx getting usergroup command?  (Read 6971 times)

0 Members and 2 Guests are viewing this topic.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Custom ulx getting usergroup command?
« 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?
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Custom ulx getting usergroup command?
« Reply #1 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)
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Custom ulx getting usergroup command?
« Reply #2 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?
Experiencing God's grace one day at a time.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Custom ulx getting usergroup command?
« Reply #3 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, :/
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Custom ulx getting usergroup command?
« Reply #4 on: November 18, 2013, 04:25:05 PM »
If you gave us specifics, we could try to address your concerns.
Experiencing God's grace one day at a time.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Custom ulx getting usergroup command?
« Reply #5 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
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Custom ulx getting usergroup command?
« Reply #6 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.
Experiencing God's grace one day at a time.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Custom ulx getting usergroup command?
« Reply #7 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.)
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Custom ulx getting usergroup command?
« Reply #8 on: November 18, 2013, 07:47:45 PM »
Lua + ULX module for 3d Virtual Reality holodeck... who knew.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Custom ulx getting usergroup command?
« Reply #9 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
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Custom ulx getting usergroup command?
« Reply #10 on: November 29, 2013, 06:54:00 PM »
Only teams have colors, but teams are not usergroups.
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Custom ulx getting usergroup command?
« Reply #11 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
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Custom ulx getting usergroup command?
« Reply #12 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?
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Custom ulx getting usergroup command?
« Reply #13 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.
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Custom ulx getting usergroup command?
« Reply #14 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?
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming