player.getav Max "actor value" ?

Post » Fri Jul 18, 2014 1:38 am

i'm attempting to set the cost of a ward spell to be a percentage of max magicka per second, instead of a flat rate.

this way, i can make the ward quite powerful, without having to worry about it becoming overpowered lategame, or barely useable early game.

the idea would be to use an inactive variable such as "favorsperday" and set it to the player's maximum mana.

then i could mod the cost of the spell by value = http://forums.bethsoft.com/topic/1504277-playergetav-max-actor-value/1 +"favorsperday" x .01.

this would give the spell a percentage cost that would scale perfectly with max mana.

however, the variable would have to be updated periodically to account for increases to mana.

the problem comes when the variable is updated while the mana bar isn't full and gets set to the low current mana value, which then drastically drops the cost of the ward, and allows it to be casted much cheaper.

is there a way to get the max value of an actorvalue instead of just the current value?

User avatar
Lilit Ager
 
Posts: 3444
Joined: Thu Nov 23, 2006 9:06 pm

Post » Thu Jul 17, 2014 11:18 pm

Couple of things I'm thinking...

1) You could use the innate maximum Magicka, so only check after Levelling up-- that way Fortify Magicka effects could be like a 'bonus'; that would greatly simplify the issue for you, and potentially make Fortify Magicka worth-while with your Ward.

2) You might be able to use GetActorValuePercentage and reverse-calculate it. I'm not sure exactly how you'd go about it, but something like... If you know 55 is 25%, then you can multiply it by 4 and get their max Magicka; might not be perfect depending on accuracy, but...

3) The most messy way-- record current Magicka, then restore it by a huge amount; take your reading, and then damage it back down to its old value.

4) I'm vaguely sure there's a GetMaxAV, but I can't remember if it works properly... The CK Wiki says there is not, but I'm sure I've used it before... But maybe it's console only, or something... Ah, there we go-- it's GetBaseAV, which 'returns the possible max value of a stat before buffs'

User avatar
Taylrea Teodor
 
Posts: 3378
Joined: Sat Nov 18, 2006 12:20 am

Post » Thu Jul 17, 2014 3:59 pm

reverse calculating method is genius... i never would have thought of that :smile:

also it fixes people taking advantage of the system, by not raising mana, but using a ton of fortify mana etc.

ty so much

Ok bit of an issue... GetActorValuePercent is a function for comparison... but compiler doesn't recognise it inside script.

i tired declaring as

Function property GetActorValuePercent Auto

compiler said "GetActorValuePercent" is not a function or does not exist.

however it's used for some spells, like equilibrium where its used to check if mana is less than 100 percent before its allowed to be cast

*FIXED* function is GetActorValuePercentage age was cut off from view when i was viewing the spell

User avatar
Ash
 
Posts: 3392
Joined: Tue Jun 13, 2006 8:59 am


Return to V - Skyrim