Thread Tools Display Modes
11/09/15, 06:37 AM   #1
@AlphaLemming
 
@AlphaLemming's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 122
[implemented] Research Timer and ESO Premium Membership

I'am saving the remaining research-time for all characters with "GetSmithingResearchLineTraitTimes" in the saved variable and add the Timestamp to each.
But if i use this saved values to display them, the values are incorrect for Premium Member with the 10% Bonus.

After many trys and errors i do not found a formula or function to get the correct value.
The only way is to use "GetSmithingResearchLineTraitTimes" for the current character, but all other characters (saved values) will still be false.

Is it possible, to get a function which calculates with this 10% bonus if necessary (from any value)?

Last edited by @AlphaLemming : 11/09/15 at 06:44 AM.
 
11/09/15, 05:22 PM   #2
ZOS_ChipHilseberg
ZOS Staff!
Premium Member
Yes this person is from ZeniMax!
Join Date: Oct 2014
Posts: 551
Correct me if I'm wrong, but can you compute the full duration and the start time and then multiply by 10% if the account has ESO Plus using an API for that?
 
11/09/15, 06:21 PM   #3
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
The more I think about it, the less I am certain if it is really that simple.
There are 4 possible cases:
  1. Player did not have plus membership when the duration was saved and does not have plus membership when it is displayed
  2. Player did not have plus membership when it was saved, but does have it now
  3. Player had plus membership, but does not have it now
  4. Player had plus membership and still has it now

The GetSmithingResearchLineTraitTimes function returns duration and timeRemaining and we can detect if someone has plus membership via GetUnitBuffInfo.
So we can save the start time, the duration and if he had plus membership at the time when we saved it.

It could be as simple as multiplying or dividing the duration by 1.1, but it could also be that we need to interpolate between non-plus-duration and plus-duration.
In that case we would need to know how long he had plus membership during the research.

For example:
The user starts research without plus membership. It gives a duration of 10 days.
After 5 days he obtains plus membership which reduces the duration by 10%.
Does it reduce the overall duration, or does it reduce the remaining duration?
In the first case, the remaining time would be 4 days, in the second case it would be 4.5 days.
 
11/10/15, 01:51 AM   #4
QuadroTony
Banned
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 828
did you look at the other research addons for solutions?
 
11/10/15, 03:00 AM   #5
@AlphaLemming
 
@AlphaLemming's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 122
Originally Posted by ZOS_ChipHilseberg View Post
Correct me if I'm wrong, but can you compute the full duration and the start time and then multiply by 10% if the account has ESO Plus using an API for that?
This is the next point, there is no function to get the Premium Membership of a player without this workaround sirinsidiator speak of and checking buffs of a player seems not to be a 100% save way and certainly not the fastest.

Thats a wish, a function which checks for membership and calculates the given value with 10% and return it. There are not only the research times affected, XP got also a bonus i believe.

Lua Code:
  1. -- a simple example
  2. function GetPremiumValue(integer value)
  3.   if IsPremiumMember() then return value * 0.1 end
  4.   return 0
  5. end

With such a value i can calculate even positive or negative.

Last edited by @AlphaLemming : 11/10/15 at 06:47 AM.
 
11/10/15, 03:32 AM   #6
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Long time ago, than my crafter was young, I had a remaining research.
I finally was able to spend an additional skillpoint to shorten research.
Instead of shorting the remaining time, the research was immediately finished.

If the ESO+ membership is handled that way, too:

For a logged-in char you get:
local duration, remaining = GetSmithingResearchLineTraitTimes(...)

These values are ajusted to your current ESO+ membership

You can get and should store at EVENT_PLAYER_DEACTIVATED: (because of skillpoints, which could be spend in-between)
local duration, remaining = GetSmithingResearchLineTraitTimes(...)
local FinishTimestamp = GetTimestamp() + remaining
local StartTime = FinishTimestamp - duration
local esoPlus = GetUnitBuffInfo(...)

if you are ESO+ member at that time, duration is 90% of real duration, otherwise 100%.

For an offline char:
local duration = EndTimestamp - StartTimestamp
if lostMembership then
duration = duration / 0.9 -- 1.11111111, not 1.10
else if gotMembership then
duration = duration * 0.9
else
-- duration remains
end
local newFinishTimestamp = StartTimestamp + duration
local remaining = newFinishTimestamp - GetTimestamp()
if remaining <= 0 then
-- Finished
end

Correct me, if I am wrong. I wrote this at work and could not test.

But I guess, this is what you already did.
 
11/10/15, 04:53 AM   #7
Wandamey
Guest
Posts: n/a
as you need to be logged in to launch a research you can register the Start timestamp then use

GetSmithingResearchLineInfo(integer TradeskillType craftingSkillType, integer researchLineIndex) Returns: string name, textureName icon, integer numTraits, integer timeRequiredForNextResearchSecs

and make the operations from that duration? I think this is the unaltered duration but I can't be sure.
maybe someone with ESO+ can compare this one with the "remaining" one.

in both case, just get the time start stamp and get or calculate the base duration then when reading it re-calculate the duration with the current settings.
At least getting a new passive requires to be logged in. Should check if this changes this timeRequiredForNextResearchSecs too.


worst worst worst case scenario : you can still
1) get the starting stamp at the start of the research.
2) calculate the needed base time from the number of traits already learned
3) apply passives... readjust this on new passive learned
4) whenever the info is displayed, apply ESO memebership status to the recalculated duration when it is displayed.

If you really need to do this though, I 100% agree that improving the API wouldn't be a blank shot.

Last edited by Wandamey : 11/10/15 at 08:54 AM.
 
11/10/15, 10:38 AM   #8
ZOS_ChipHilseberg
ZOS Staff!
Premium Member
Yes this person is from ZeniMax!
Join Date: Oct 2014
Posts: 551
IsESOPlusSubscriber should be the API for checking the premium part of your function.
 
11/11/15, 01:58 AM   #9
@AlphaLemming
 
@AlphaLemming's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 122
Originally Posted by ZOS_ChipHilseberg View Post
IsESOPlusSubscriber should be the API for checking the premium part of your function.
Thanks Chip, but i'am getting an error if i try to use this function and i do not find any documentation in the current API description.
 
11/11/15, 02:15 PM   #10
ZOS_ChipHilseberg
ZOS Staff!
Premium Member
Yes this person is from ZeniMax!
Join Date: Oct 2014
Posts: 551
That would be because it isn't live yet, whoops. It will be in the next big update.
 

ESOUI » Developer Discussions » Wish List » [implemented] Research Timer and ESO Premium Membership


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off