User talk:Rasikko

From the CreationKit Wiki
Jump to navigation Jump to search

Various Array Helper Functions[edit source]

Work in progress.

Change Form to whatever the types are.
Bool Function ArrayIncludes(Form akArray, Form akValueToSearchFor)
    ; Returns true of akArray contains akValueToSearchFor
    
    int = 0
    int index = akArray.length
    while i < index
        if akArray[i] == akValueToSearchFor
            return true
        endif
        i += 1
    endif
return false
EndFunction

Time Functions[edit source]

Self explanatory. They will all require GetFractionOfDay and assume that you will use the globalvariable GameDaysPassed.

Float Function GetFractionOfDay(Float daysPassed)
    ; Returns the hours passed for the day as a fraction.
    if daysPassed < 1.0
        return daysPassed
    endif
    return dayPassed - daysPassed as int
EndFunction


Float Function GetHoursPassed(Float daysPassed)
    ; Converts the days passed to the hours passed for the day.
    return GetFractionOfDay(daysPassed) * 24.0
EndFunction


Float Function GetMinutesPassed(Float daysPassed)
    ; Converts the days passed to minutes passed for the day.
    return GetFractionOfDay(daysPassed) * 24.0 * 60.0
EndFunction


Float Function GetSecondsPassed(Float daysPassed)
    ; Converts the days passed to seconds passed for the day.
    return GetFractionOfDay(daysPassed) * 24.0 * 60.0 * 3600.0
EndFunction

Enchanted Item Gold Value Mystery[edit source]

I'm trying to solve the mystery of calculating the gold value for player enchanted items. This was figured out for weapons, but that formula doesn't work for non weapons. My findings so far..:

  • The maximum skill level to effect an enchanted item's gold value is capped at 100.
  • The lower the skill level, the higher the enchanted item's gold value will be.
  • The gold value boosted from tempering is counted towards the gold value calculations.
  • Perks have no effect on the gold value.
  • Vanilla Apparel with more than 1 enchantment, only the first enchantment determines the gold value.
  • The base gold value for the base item of a vanilla enchanted item is added to the gold value.
  • For weapons(formula not documented here), duration is used instead of an EffectBase(which is also 0).


The chart below uses an unenchanted helmet, with its base gold value in the first column. The value in the third column is the value when it's enchanted. The enchantment is Fortify Alteration. The bold value is the default skill level.

Base Value Skill Level Modified Cost Reduction
220 0 1277 -
- 1 1202 75
- 10 1041 161
- 15 987 54
- 20 943 44
- 30 867 76
- 40 804 63
- 50 748 56
- 60 698 50
- 70 651 47
- 80 608 40
- 90 568 35
- 99 533
- 100 529

1277 - 529 = 748
1277 x 0.51 = 651.27
1277 at skill 0 is about 2.414 times that of 529 at skill 100.
I've found a formula from the UESP, which does work some but the portion involving the skill is still unknown to me:

BaseItemCost + (0.12 * SoulGemPower)
; Working example: 220 + (0.12 * 3000) = 580; This gets cut down to 529 with 100 skill.

Where SoulGemPower is the value of the current soul trapped in the Soul Gem.

Mystery Almost Solved[edit source]

I have discovered the next missing piece for the above formula for getting the gold value for player created enchanted items.

Gold Value = ((BaseItemGoldValue * 2) + (0.12 * SoulGemPower) - ((SkillLevel * 0.5)) - 1

;Working example: ((220 * 2) + (0.12 * 3000) - (100*0.5)) - 1 = 749.

This works well when the skill is at level 100. Testing with skill 0, and or any levels before 100, another piece of the puzzle is missing unfortunately. Level 100 is the only level that really matters for the Enchanting skill anyhow, so I think this will still be very useful to folks. More testing will be carried out before I put this on respective pages. Rasikko (talk) 2017-11-29T14:03:58 (EST)

There are quite a few problems that have sprung up now that may be beyond my knowledge to over come hmm... but at least I figured out how to get the value for level 100. Rasikko (talk) 2017-11-29T15:43:42 (EST)
Discovered another missing portion. The base cost according to my testing is calculated twice. Rasikko (talk) 2017-11-29T16:03:32 (EST)
Additional refinements have been made. The tempering level is involved in the calculation, thus the code is now:
Math.Floor((BaseItemGoldValue * TemperingLevel) + (0.12 * SoulGemPower) - (SkillLvl * 0.5))

Where the tempering level is:

  • Fine = 1.166
  • Superior = 1.333
  • Exquisite = 1.499
  • Flawless = 1.666
  • Epic = 1.833
  • Legendary = 1.999

Close but no cigar[edit source]

I believe I have reached the end of my testings and have discovered nothing more so far. The remaining issue is gold values being modified with an enchanting skill level less than 100. I have also modified the formula for vanilla enchanted gear.
To get the gold value for Player Enchanted gear(This formula works for Alteration enchantments only.):

Math.Floor((BaseItemGoldValue * TemperingLevel) + (0.12 * SoulGemPower) - (SkillLvl * 0.5))

To get the gold value for vanilla enchanted gear(apparel only):

; if the enchantment has no duration, the game will use 1:
Math.Ceiling((EffectBase * (Magnitude * Math.Pow(Duration/10, 1.1))) + BaseGoldValue)

It seems different calculations is needed for different types of enchantments. For the skill based enchantments, the calculations is certainly not the same.

Contributions, Thank You[edit source]

Thanks for your contributions to the creation kit wiki.Scrivener07 (talk) 2017-12-02T13:30:03 (EST)

No problem. --Rasikko (talk) 2017-12-02T14:09:07 (EST)