ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   AddOn Search/Requests (https://www.esoui.com/forums/forumdisplay.php?f=165)
-   -   [Request/Help with] RP AddOn Fame and Infamy points (https://www.esoui.com/forums/showthread.php?t=6954)

Sacralletius 04/08/17 03:25 PM

[Request/Help with] RP AddOn Fame and Infamy points
 
Hi there

I have an idea for an addon which would like to request/try to make myself as my first AddOn.

It's an RP AddOn which does the following:

- Keep track of 2 values: fame and infamy, which persist through logging in/out, disabling/re-enabling the AddOn, etc. In short it will save both values. (These values are purely for roleplaying and have no in game advantage.)
- You infamy points will go up, each time you steal an item, pickpocket or murder an innocent, completing certain achievements/dailies/quests.
- You fame points will go up, each time you give money to beggar NPCs, complete certain achievemnts/dailies/quests, or win a duel (or kill in Cyrodiil) with a player that has a certain achievement (Silencer, Master Thief, etc). (The dueling points increase should have a one day cooldown per player.)
- An option to link your current fame and infamy points in chat.

For longer term:

- The value of (fame points minus infamy points) will give you a certain cosmetic rank.

Examples
-1000 = Grand Criminal
-500 = Crime Professional
-100 = Popular Lawbreaker
-10 = Petty Thief
0 = Citizen
10 = Upstanding Citizen
100 = Guardian of the People
500 = Hero
1000 = Legend

Example 1: You have 10 fame points and 120 infamy points -> 10 - 120 = -110 -> Which will make you a "Popular Lawbreaker".
Example 2: You have 130 fame points and 70 infamy points -> 130 - 70 = 60 -> Which will make you an "Upstanding Citizen".

Would any of this be possible with the current API?

Thanks in advance

Kind regards

Sacralletius

Rhyono 04/08/17 03:30 PM

If by "cosmetic rank" you mean a visible title: only to others with the addon and it'd be a bit tricky.

Sacralletius 04/08/17 04:22 PM

Quote:

Originally Posted by Rhyono (Post 30520)
If by "cosmetic rank" you mean a visible title: only to others with the addon and it'd be a bit tricky.

Nah, not a visible title. I meant just for linking in chat. For instance, when you post your information in chat, it will say:

I have "x" fame points and "y" infamy points. My current rank is "z".

I'm actually more curious on which events are possible to track.

For instance, is it possible to track whether another player has a certain achievement?

Rhyono 04/08/17 04:54 PM

So you'd like to be able to verify whether they have legitimately reached that rank?

Sacralletius 04/08/17 05:09 PM

Quote:

Originally Posted by Rhyono (Post 30522)
So you'd like to be able to verify whether they have legitimately reached that rank?

Well, no, not really. Just through chat. They can post in chat: "I have "x amount of " fame points and "y amount of" infamy points. My current justice rank is "z".

What I meant by checking the "achievements", is not these ranks (from the addon) I'm referring to, but actual in game achievements.
So for instance, is possible to check through lua scripting if another player has the Silencer Dark Brotherhood achievement?

I don't know that much about actual lua scripting syntaxis, but that information could be used in this way:

Code:

Event OnDuelWon(Opponent)
    If Opponent.HasAchievement(Silencer) Then
        FamePoints = FamePoints + 20
        Victory.PlaySound()
        DisplayMessage(Another criminal has been brought to justice!)
    EndIf
End Event

I hope this makes sense. I was wondering whether there are any other events (OnStealItem, OnPickPocket, OnQuestCompleted(QuestID), etc) we could use to increase the values.

Rhyono 04/08/17 05:22 PM

You have very limited access to other player's data. I'm not on to check, but does that achievement give a title? If it did and they were using the title: yes. If it does not: no.

Sacralletius 04/08/17 05:24 PM

Quote:

Originally Posted by Rhyono (Post 30524)
You have very limited access to other player's data. I'm not on to check, but does that achievement give a title? If it did and they were using the title: yes. If it does not: no.

Yes, it does give a title.

Just interested, what kind of player data do we have access to?

Rhyono 04/08/17 05:44 PM

The title would also have to be in use. On the API page, search for "unit" and many (not all) of the functions apply to players. You have pretty vast access to your own data, though.

Ayantir 04/08/17 06:25 PM

it would be very complicated and should use some features that only a few know howw to properly use and that for a very fancy purpose... in other term, welcome to coding.

Sacralletius 04/08/17 06:33 PM

GetUnitBuffInfo -> This one is interesting. Could we use it to return whether the targeted player has the "Blade of Woe" (http://esoitem.uesp.net/viewlog.php?...kills&id=76325) and/or "Padomaic Sprint" ( http://esoitem.uesp.net/viewlog.php?...kills&id=76325) buffs?

Also, are there any events we could use for the player himself, to track whether he has done a particular quest?

Something like this:

Code:

Event OnQuestCompleted(QuestID)
    If QuestID == xxxxxx Then
        FamePoints = FamePoints + 5
    ElseIf QuestID == yyyyyy Then
        FamePoints = FamePoints + 10
    EndIf
End Event

Or when the player himself pickpockets something:

Code:

Event OnPickPocket(NPC)
    InfamyPoints = InfamyPoints + 5
End Event


Dolgubon 04/08/17 07:15 PM

If the two players in a duel are in the same group, then you could use LibGroupSocket to transfer the values of the infamy and fame. I think you can retroactively check what quests a player has completed, and there is an event you can use for quest completion, as well as pickpocketing. You could also differentiate between items stolen from say a drawer.

Letho 04/09/17 02:06 AM

Quote:

Originally Posted by Sacralletius (Post 30528)
GetUnitBuffInfo -> This one is interesting. Could we use it to return whether the targeted player has the "Blade of Woe" (http://esoitem.uesp.net/viewlog.php?...kills&id=76325) and/or "Padomaic Sprint" ( http://esoitem.uesp.net/viewlog.php?...kills&id=76325) buffs?
(...)

In Cyrodiil not possible... sadly Z decided to allow only viewing other players buffs/debuffs that have been applied by/on you.

Sacralletius 04/09/17 06:02 AM

Quote:

Originally Posted by Dolgubon (Post 30529)
If the two players in a duel are in the same group, then you could use LibGroupSocket to transfer the values of the infamy and fame. I think you can retroactively check what quests a player has completed, and there is an event you can use for quest completion, as well as pickpocketing. You could also differentiate between items stolen from say a drawer.

Interesting. Some questions, though.

I'm not really interested in having to group up with someone to share the info, but I assume that is the only way to track whether another player has completed a quest/achievement? Which functions/events could be used for that?

Sacralletius 04/09/17 06:06 AM

Quote:

Originally Posted by Letho (Post 30530)
In Cyrodiil not possible... sadly Z decided to allow only viewing other players buffs/debuffs that have been applied by/on you.

But you can view their titles or check whether or not they are a Vampire/Werewolf, in Cyrodiil?

Rhyono 04/09/17 09:08 AM

Quote:

Originally Posted by Sacralletius (Post 30531)
Which functions/events could be used for that?

There aren't any that do this directly. Ayantir was probably alluding to using map pings to send a few bytes of data at a time. You'd have to group with the person, then have them use a custom function that calls all of the builtin functions for checking that data, then use LibGroupSocket to send that data to you. In terms of first add-on, you're jumping in the deep end of the pool.

sirinsidiator 04/09/17 10:18 AM

It's a nice idea you have there. You should try to keep it simple at first and try to reduce it to the core functionality.

Try make something that just keeps track of one event for famity and one for infamity, saves the resulting points and allows you to share it via chat with a keybind. From there you can still expand it however you want.

For the infamity points you could listen to EVENT_JUSTICE_INFAMY_UPDATED and convert them to your own points. For famity maybe just listen to EVENT_QUEST_COMPLETE at first and add points based on quest type and xp gain.

If you haven't done so you should read the getting started guide and do some of the tutorials on the wiki's main page.

Sacralletius 04/09/17 11:44 AM

Quote:

Originally Posted by Rhyono (Post 30533)
There aren't any that do this directly. Ayantir was probably alluding to using map pings to send a few bytes of data at a time. You'd have to group with the person, then have them use a custom function that calls all of the builtin functions for checking that data, then use LibGroupSocket to send that data to you. In terms of first add-on, you're jumping in the deep end of the pool.

Well, I don't really want the fame and infamy points tracked and shared. I assume you meant this would require people to group up.

But even then, the other player needs to have the addon as well, which I doubt many people will have. I think only a very small percentage of all players will actually use this addon, so I'll have to find other ways to make it work. One way, as pointed out, is tracking the active buffs or titles the other player has.
Although, I understand that it isn't possible to track passive skills, quests or achievements without grouping up?

So, for instance, I want to be able to do the following: if I see another player with the Silencer title, I can challenge them to a duel, without needing to group up. If I win the duel, I will get 20 points added to my fame points. Perhaps add a fancy message that will display in my game only (not the opponent or anyone else), saying "I've brought a criminal to justice." or something like that. Maybe play a simple sound, as well. The message and sound could be done similar to the messages you get from the Alliance War: "Player X of your alliance has been crowned Emporer."

Is this possible?

So, if I understand correctly:

Outside of Cyrodiil, without grouping up, it is possible to track:

- Titles
- Active buffs

Outside of Cyrodiil, I'll need to group up (LibGroupSocket requirement), in order to track:

- Quests
- Achievements
- Passive Skills

Inside Cyrodiil, it's only possible to track titles.

Is this correct?

Sacralletius 04/09/17 11:47 AM

Quote:

Originally Posted by sirinsidiator (Post 30534)
It's a nice idea you have there. You should try to keep it simple at first and try to reduce it to the core functionality.

Try make something that just keeps track of one event for famity and one for infamity, saves the resulting points and allows you to share it via chat with a keybind. From there you can still expand it however you want.

For the infamity points you could listen to EVENT_JUSTICE_INFAMY_UPDATED and convert them to your own points. For famity maybe just listen to EVENT_QUEST_COMPLETE at first and add points based on quest type and xp gain.

If you haven't done so you should read the getting started guide and do some of the tutorials on the wiki's main page.

Thank you, I'll try that and add some more functionality as I go on. :)

sirinsidiator 04/09/17 12:11 PM

Quote:

Originally Posted by Sacralletius (Post 30535)
Well, I don't really want the fame and infamy points tracked and shared. I assume you meant this would require people to group up.

But even then, the other player needs to have the addon as well, which I doubt many people will have. I think only a very small percentage of all players will actually use this addon, so I'll have to find other ways to make it work. One way, as pointed out, is tracking the active buffs or titles the other player has.
Although, I understand that it isn't possible to track passive skills, quests or achievements without grouping up?

So, for instance, I want to be able to do the following: if I see another player with the Silencer title, I can challenge them to a duel, without needing to group up. If I win the duel, I will get 20 points added to my fame points. Perhaps add a fancy message that will display in my game only (not the opponent or anyone else), saying "I've brought a criminal to justice." or something like that. Maybe play a simple sound, as well. The message and sound could be done similar to the messages you get from the Alliance War: "Player X of your alliance has been crowned Emporer."

Is this possible?

So, if I understand correctly:

Outside of Cyrodiil, without grouping up, it is possible to track:

- Titles
- Active buffs

Outside of Cyrodiil, I'll need to group up (LibGroupSocket requirement), in order to track:

- Quests
- Achievements
- Passive Skills

Inside Cyrodiil, it's only possible to track titles.

Is this correct?

Things you can do:
* play a sound (but only from the list of existing sound effects, no custom stuff)
* show a message like the emperor one
* track all your own titles, buffs, quests, achievements passives
* read the currently selected title of another player (but only as a string)

Things you cannot do:
* track anything about the progress of another player (like titles, achievements, quests, etc.)

The thing with LibGroupSocket is, that both players need to have your addon and be in a group and then you can only send a maximum of 7 bytes at a time. It's simply not made for tracking a lot of information about someone. More to transport specific data between group members (like stamina and magicka values).

I am also not sure about tracking buffs of other players. A few things changed recently and I haven't tried yet what's still possible.

Sacralletius 04/09/17 04:38 PM

I know that you can see buffs from a targetted player by using S'rendar Buff tracker. This also allows you to view whether or not the targetted player has the vampire or werewolf buffs, which could be useful.

Other than that, I would prefer not using the LibGroupSocket and the grouping up part, for two reasons:

- I prefer to keep my addon lightweight (not sending/receiving too much data).
- Having the addon and grouping up with other players will make it much less convenient and only a very small amount of other players will meet this requirement.

I think using the selected other players title (and maybe buffs if I can figure out S'rendarr) is the best and most lightweight way to approach this.

I think I'll start with implementing the fame/infamy increase on quest completion/pickpocketing first, though.


All times are GMT -6. The time now is 08:28 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI