Ulysses

Ulysses Stuff => General Chat & Help and Support => Topic started by: gamexplor on December 16, 2016, 03:38:24 PM

Title: How do I do make my groups target other groups like this?
Post by: gamexplor on December 16, 2016, 03:38:24 PM
So these are my groups: owner, coowner, headadmin, superadmin, admin, dmoderator, moderator, dtrialmoderator, trialmoderator, donator, user

I want to make them be able to ONLY target other players that are the SAME or ranks BELOW their rank. I've been struggling with the can target ULX command but can't seem to get it to work, does anyone know possibly how I'd do this?
Title: Re: How do I do make my groups target other groups like this?
Post by: iViscosity on December 16, 2016, 04:05:18 PM
Set each group's 'can_target' to !%<group ONE higher than them>.

For example, "admin's" 'can_target' should be !%superadmin, which means they can target everything except superadmin and everything that inherits from it (I.E., 'admin' and below)



Say you had the following groups: superadmin, admin, operator, users
If you want each group to target their own group and any groups under them, you'd set their can_target to be this:





superadmin: *  (or leave blank)
admin: !%superadmin
operator: !%admin
user: !%operator
For more information: read this. (http://forums.ulyssesmod.net/index.php/topic,5346.0.html)
Title: Re: How do I do make my groups target other groups like this?
Post by: gamexplor on December 16, 2016, 05:43:32 PM
Set each group's 'can_target' to !%<group ONE higher than them>.

For example, "admin's" 'can_target' should be !%superadmin, which means they can target everything except superadmin and everything that inherits from it (I.E., 'admin' and below)


For more information: read this. (http://forums.ulyssesmod.net/index.php/topic,5346.0.html)
Hey, thanks a lot for your reply. I managed to get it working, but my problem now is dmoderator and dtrialmoderators can target owners. My question is if I have a 4 different moderator groups, (dtrialmoderator, dmoderator, moderator, and trialmoderator) what would they all be?
Title: Re: How do I do make my groups target other groups like this?
Post by: roastchicken on December 16, 2016, 06:08:02 PM
Just set their can_targets to %<the group above them>. For example, I assume dtrialmoderator is under dmoderator so you would set dtrialmoderator's can_target to %dmoderator
Title: Re: How do I do make my groups target other groups like this?
Post by: JamminR on December 16, 2016, 08:01:12 PM
Hey Roastchicken, he's wanting to not target groups above.
Sounds like he's got some split inheritance.

gamexplor, you need to make sure your groups inherit in a straight line from 'top' to 'bottom'.
Sounds like you have some moderator groups inheriting a group below it, but the groups higher than your moderator groups don't necessarily inherit linearly.
On a scale of 10 being highest group, and 1 being lowest, 10 should inherit 9 should inherit 8 should inherit 7 should inherit ... 1
and on the can_target, 1 !%2, 2 !%3, 3...

As iviscoity linked, please see and read the entire discussion at http://forums.ulyssesmod.net/index.php/topic,5346.0.html
Your questions have been asked an answered there already, i'm pretty sure.

Title: Re: How do I do make my groups target other groups like this?
Post by: gamexplor on December 18, 2016, 10:13:49 AM
Hey Roastchicken, he's wanting to not target groups above.
Sounds like he's got some split inheritance.

gamexplor, you need to make sure your groups inherit in a straight line from 'top' to 'bottom'.
Sounds like you have some moderator groups inheriting a group below it, but the groups higher than your moderator groups don't necessarily inherit linearly.
On a scale of 10 being highest group, and 1 being lowest, 10 should inherit 9 should inherit 8 should inherit 7 should inherit ... 1
and on the can_target, 1 !%2, 2 !%3, 3...

As iviscoity linked, please see and read the entire discussion at http://forums.ulyssesmod.net/index.php/topic,5346.0.html
Your questions have been asked an answered there already, i'm pretty sure.

Sorry for the late replies, so for example.
Owner being the highest rank, would inherit off of co-owner (which is the next one down)?
Title: Re: How do I do make my groups target other groups like this?
Post by: iViscosity on December 18, 2016, 10:15:11 AM
Yes, that's how you would do it.
Title: Re: How do I do make my groups target other groups like this?
Post by: gamexplor on December 18, 2016, 10:38:05 AM
Yes, that's how you would do it.
I've tried editing all the inheritance and everything and a dtrialmoderator can still pick up an owner. This is my setup:

User: can target !%operator
Noaccess: Inherits from user, can target: !%user
Operator: inherits from user, can target: !%donator
admin: inherits from operator, can target: !%superadmin
superadmin: inherits from admin, can target: !%headadmin
headadmin: inherits from superadmin, can target: !%coowner
coowner: inherits from headadmin, can target: !%owner
owner: inherits from coowner, can target: *
donator: inherits from user, can target: !%trialmoderator
trialmoderator: inherits from donator, can target: !%dtrialmoderator
dtrialmoderator: inherits from trialmoderator, can target: !%moderator
moderator: inherits from dtrialmoderator, can target: !%dmoderator
dmoderator: inherits from moderator, can target: !%admin

Any ideas?
Title: Re: How do I do make my groups target other groups like this?
Post by: gamexplor on December 19, 2016, 08:24:37 AM
Bump, still wondering if anyone could let me know how to fix this. I know I've had some links to help me but they didn't do the job.
Title: Re: How do I do make my groups target other groups like this?
Post by: Bytewave on December 19, 2016, 09:15:52 AM
Again, you need to flatten your inheritance tree, or manually specify what groups can be targeted with the # tag. Example: admin should target user, donator, and moderator, so can_target would be #user,#donator,#moderator.
Title: Re: How do I do make my groups target other groups like this?
Post by: gamexplor on December 19, 2016, 09:19:19 AM
Again, you need to flatten your inheritance tree, or manually specify what groups can be targeted with the # tag. Example: admin should target user, donator, and moderator, so can_target would be #user,#donator,#moderator.

I have all the inheritances setup though, it's just the dtrialmoderator and dmoderator I don't understand what to do with them, sorry...
Title: Re: How do I do make my groups target other groups like this?
Post by: iViscosity on December 19, 2016, 09:40:19 AM
You have Operator AND Donator inheriting from user, which means you have a split inheritance (or branching) tree. What they're suggesting is have it in a linear tree, where only one group inherits from another (like the default user < operator < admin < superadmin). The reason those groups can target higher groups like that is because they are not in the same branch, which means most of their inheritances and can_targets don't apply. You need to have it in a linear tree, like (user < donator < trialmoderator < dtrialmoderator < etc.)

In other words, make each group inherit only from the group directly below it, with that group inheriting from the one directly below it. Make sure no two groups inherit from the same group.

I hope that makes sense.

Edit: As a side note, not a great idea to have a group inherit from superadmin, as Garry's Mod recognises superadmin as having root access. Read more here: Groups vs. Teams - Why having an owner group is useless and stupid (https://forums.ulyssesmod.net/index.php?topic=6291.0)

Sent using Tapatalk. Owner of iViscosity Gaming.
Title: Re: How do I do make my groups target other groups like this?
Post by: Stickly Man! on December 19, 2016, 10:05:41 AM
Here, let me help you visualize the issue:
(http://ulyssesmod.net/xgui/forum_images/inheritance_tree.jpg)

This is what we mean when we say "inheritance branching"- all of your groups are not connected in a single line. The ULX targeting system does not work well with these kind of setups, unfortunately. It's a known limitation we plan on addressing in ULX 4.

The reason why this doesn't work is, well, let's focus on your can_target for 'dtrialmoderator'. Currently, you have it set to '!%moderator', which means that 'dtrailmoderators' can't target anyone in the group moderator, or any group that inherits from moderator (this is what !% does, the ! just inverts it). So in your terms, it's saying "dtrialmoderator can't target moderator and dmoderator". However, this says nothing about operator, noaccess, or any of your other groups.

Now, you would think you could just specify '!%moderator,!%admin' so that 'dtrialmoderator' can't target moderators or above AND admins and above, but the comma is a SET UNION operator (in terms of players you can target), and the end result is that they cancel each other out, and they'll be able to target anyone.


So, the first (less messy) solution would be to line up all of your groups so they inherit in a single line. This obviously puts some restrictions on which levels you give access to for certain commands (e.g., if you were trying to put operator between donator and trialmoderator, but you wanted operator to have a specific command that you don't want trialmoderator or higher to have, and you don't want operator to have all of the commands that trialmoderator has). But, you can work around that problem by using groupdeny: In my example, you would give operator the command you want, then groupdeny that command at the trialmoderator level.
EDIT: groupdeny only removes existing access to a group, not inherited. I should be slapped for forgetting that. This functionality exists on a per-user level though.

The other solution which allows you to keep this branching inheritance requires you to manually specify and maintain a list of groups each group can target. It's a bit tedious to set up, and even more tedious to maintain if you change your group structure, but it is fairly straightforward. Basically, for each group, you just keep a list of all of the groups you want to target using the # operator. To get you started:

Code: [Select]
user: ^
noaccess: ^
This will let user and noaccess (if you want) to only target themselves.

Code: [Select]
operator: #user
donator: #user
admin: #operator,#donator,#user
trialmoderator: #donator,#user
dtrialmoderator: #trialmoderator,#donator,#operator,#user
moderator: #dtrialmoderator,#trialmoderator,#donator,#operator,#user
dmoderator: #moderator,#dtrialmoderator,#trialmoderator,#donator,#operator,#user
admin: #dmoderator,#moderator,#dtrialmoderator,#trialmoderator,#donator,#operator,#user
... and so on.
Title: Re: How do I do make my groups target other groups like this?
Post by: Bytewave on December 19, 2016, 12:33:27 PM
Here, let me help you visualize the issue:
(http://ulyssesmod.net/xgui/forum_images/inheritance_tree.jpg)
<offtopic>Huh, nice visualization.
I wonder how hard text-based graphing, especially in Lua, would be. Having a ULX command to draw the inheritance tree to console or something would be useful in visualizing branching inheritance trees like the above.</offtopic>
Title: Re: How do I do make my groups target other groups like this?
Post by: iViscosity on December 19, 2016, 12:34:21 PM
<offtopic>Huh, nice visualization.
I wonder how hard text-based graphing, especially in Lua, would be. Having a ULX command to draw the inheritance tree to console or something would be useful in visualizing branching inheritance trees like the above.</offtopic>
*cracks knuckles*

Sent using Tapatalk. Owner of iViscosity Gaming.

Title: Re: How do I do make my groups target other groups like this?
Post by: Bytewave on December 19, 2016, 12:38:10 PM
*cracks knuckles*
I've put light thought into the idea, but haven't come up with much yet. gl;hf
Title: Re: How do I do make my groups target other groups like this?
Post by: gamexplor on December 19, 2016, 02:18:46 PM
You have Operator AND Donator inheriting from user, which means you have a split inheritance (or branching) tree. What they're suggesting is have it in a linear tree, where only one group inherits from another (like the default user < operator < admin < superadmin). The reason those groups can target higher groups like that is because they are not in the same branch, which means most of their inheritances and can_targets don't apply. You need to have it in a linear tree, like (user < donator < trialmoderator < dtrialmoderator < etc.)

In other words, make each group inherit only from the group directly below it, with that group inheriting from the one directly below it. Make sure no two groups inherit from the same group.

I hope that makes sense.

Edit: As a side note, not a great idea to have a group inherit from superadmin, as Garry's Mod recognises superadmin as having root access. Read more here: Groups vs. Teams - Why having an owner group is useless and stupid (https://forums.ulyssesmod.net/index.php?topic=6291.0)

Sent using Tapatalk. Owner of iViscosity Gaming.

Here, let me help you visualize the issue:
(http://ulyssesmod.net/xgui/forum_images/inheritance_tree.jpg)

This is what we mean when we say "inheritance branching"- all of your groups are not connected in a single line. The ULX targeting system does not work well with these kind of setups, unfortunately. It's a known limitation we plan on addressing in ULX 4.

The reason why this doesn't work is, well, let's focus on your can_target for 'dtrialmoderator'. Currently, you have it set to '!%moderator', which means that 'dtrailmoderators' can't target anyone in the group moderator, or any group that inherits from moderator (this is what !% does, the ! just inverts it). So in your terms, it's saying "dtrialmoderator can't target moderator and dmoderator". However, this says nothing about operator, noaccess, or any of your other groups.

Now, you would think you could just specify '!%moderator,!%admin' so that 'dtrialmoderator' can't target moderators or above AND admins and above, but the comma is a SET UNION operator (in terms of players you can target), and the end result is that they cancel each other out, and they'll be able to target anyone.


So, the first (less messy) solution would be to line up all of your groups so they inherit in a single line. This obviously puts some restrictions on which levels you give access to for certain commands (e.g., if you were trying to put operator between donator and trialmoderator, but you wanted operator to have a specific command that you don't want trialmoderator or higher to have, and you don't want operator to have all of the commands that trialmoderator has). But, you can work around that problem by using groupdeny: In my example, you would give operator the command you want, then groupdeny that command at the trialmoderator level.


The other solution which allows you to keep this branching inheritance requires you to manually specify and maintain a list of groups each group can target. It's a bit tedious to set up, and even more tedious to maintain if you change your group structure, but it is fairly straightforward. Basically, for each group, you just keep a list of all of the groups you want to target using the # operator. To get you started:

Code: [Select]
user: ^
noaccess: ^
This will let user and noaccess (if you want) to only target themselves.

Code: [Select]
operator: #user
donator: #user
admin: #operator,#donator,#user
trialmoderator: #donator,#user
dtrialmoderator: #trialmoderator,#donator,#operator,#user
moderator: #dtrialmoderator,#trialmoderator,#donator,#operator,#user
dmoderator: #moderator,#dtrialmoderator,#trialmoderator,#donator,#operator,#user
admin: #dmoderator,#moderator,#dtrialmoderator,#trialmoderator,#donator,#operator,#user
... and so on.

Thank you very much to both of you! I have managed to fix this issue by deleting the 'noaccess' and 'operator' user group, which maybe wasn't the best option. But it worked as they were having to be targeting 2 groups.
Title: Re: How do I do make my groups target other groups like this?
Post by: JamminR on December 19, 2016, 03:29:28 PM
Stickly, for ULX 4, I want that data text visualization method incorporated into XGUI.
So basically, I could take groups like that, drag/drop the ovals in between, and have XGUI adjust the inheritance like so.
Imagine Scratch programming language, but, for XGUI and group management. Snap.... click .. inherit set .. can_target default to not above.
:P

Gameexplor, if you bump one more time in less than 72 hours, I'm banning you.
We told you your answer several times, if you don't understand it then you need to ask differently.
This is a slow paced forum.
You didn't get lost in the mix... we simply didn't see your last question in the time you impatiently felt you needed.
Title: Re: How do I do make my groups target other groups like this?
Post by: gamexplor on December 19, 2016, 04:17:33 PM
Stickly, for ULX 4, I want that data text visualization method incorporated into XGUI.
So basically, I could take groups like that, drag/drop the ovals in between, and have XGUI adjust the inheritance like so.
Imagine Scratch programming language, but, for XGUI and group management. Snap.... click .. inherit set .. can_target default to not above.
:P

Gameexplor, if you bump one more time in less than 72 hours, I'm banning you.
We told you your answer several times, if you don't understand it then you need to ask differently.
This is a slow paced forum.
You didn't get lost in the mix... we simply didn't see your last question in the time you impatiently felt you needed.

I didn't bump... I said thank you for solving my issue. Wtf?
Title: Re: How do I do make my groups target other groups like this?
Post by: JamminR on December 19, 2016, 07:05:59 PM
...
Bump
Title: Re: How do I do make my groups target other groups like this?
Post by: gamexplor on December 20, 2016, 10:52:54 AM

I don't remember posting the "...", but I remember saying "bump".
Anyhow the issue is fixed now, so it's all over.
Title: Re: How do I do make my groups target other groups like this?
Post by: Stickly Man! on December 22, 2016, 09:30:28 AM
Glad I could help you figure it out!

<offtopic>Huh, nice visualization.
I wonder how hard text-based graphing, especially in Lua, would be. Having a ULX command to draw the inheritance tree to console or something would be useful in visualizing branching inheritance trees like the above.</offtopic>

The whole concept of auto-generated graphs via text descriptions is a fascinating one to me, but it is pretty complex. We do actually have ULib.ucl.getInheritanceTree (http://ulyssesmod.net/docs/files/lua/ulib/shared/sh_ucl-lua.html#ucl.getInheritanceTree) that you can use with PrintTable as a poor man's graph though. This website uses Graphviz, I highly recommend checking it out and trying it out on a Linux box.

Stickly, for ULX 4, I want that data text visualization method incorporated into XGUI.
So basically, I could take groups like that, drag/drop the ovals in between, and have XGUI adjust the inheritance like so.
Imagine Scratch programming language, but, for XGUI and group management. Snap.... click .. inherit set .. can_target default to not above.
:P

Mmm... That would be nice. Complex to implement, but very nice!
Title: Re: How do I do make my groups target other groups like this?
Post by: Megiddo on December 29, 2016, 07:02:46 PM
Why not pipe the data to webgraphviz or plantuml (http://www.plantuml.com/plantuml/) using the in-game browser? :)
Title: Re: How do I do make my groups target other groups like this?
Post by: JamminR on December 29, 2016, 09:39:55 PM
Ugh. Would the ingame browser not scream in agony trying some page that dynamic and complex?
:P
Title: Re: How do I do make my groups target other groups like this?
Post by: roastchicken on December 31, 2016, 04:10:14 AM
Those pages seem to do most, if not all, of the processing server-side. They just take some text input and return an image. If Awesomium doesn't agree displaying the webpage, it'd probably be possible to just (http://wiki.garrysmod.com/favicon.ico) http.Fetch (http://wiki.garrysmod.com/page/http/Fetch) the image.