Zorkaz Posted July 8, 2019 Share Posted July 8, 2019 I'm working on a fitness modification where you constantly can get small amounts of exp while doing push ups. However: While the player receives 5xp every second this effect stops after about ten rounds. Sleeping, travelling doesn't help. So here:s what I did:The base script looks like this: Scriptname FTGetExp extends ActiveMagicEffectActorValue property Experience auto Float property xpts = 200.0 auto Event OnEffectStart(Actor akTarget, Actor akCaster) Game.GetPlayer().ModValue(Experience, xpts)EndEvent I then put the script inside a magic effect, the magic effect inside a spell and used the spell inside the water drinking script. The one used for drinking from water fountains, pumps, ect.. This script is applied to the push-up matress which is a furniture. So my big question is: Does anyone know how to make a stable experience script that does loop itself if the furniture is activated? Link to comment Share on other sites More sharing options...
Zorkaz Posted July 8, 2019 Author Share Posted July 8, 2019 Here's a link to the .esp if anyone is curioushttps://www.dropbox.com/s/zj0vcfk5zsyr1ej/FitnessTraining.esp?dl=0 Link to comment Share on other sites More sharing options...
hereami Posted July 10, 2019 Share Posted July 10, 2019 (edited) Hm, that's nice idea. Drinking script has too much of excessive (or was the mod intended for ps4?). And i don't know, if there is any limitation for XP getting rate, and why it stops.Would do like that (took HC_EncumbranceEffect_CastScript as a base). Scriptname PushUpTraining extends ObjectReferenceGroup Dataspell Property SpellToCast const auto mandatory{HC_EncumbranceEffect_DamagePlayer}float Property CastTimerInterval = 5.0 const auto{how often should we cast the spell on the actor} ActorValue property Experience autoFloat property xpts = 25.0 autoSound Property LoopSound Auto Const ; should be looping SNDREndGroupactor actorRef ; var just in caseint iSoundIDEvent OnActivate(ObjectReference akActionRef)If akActionRef == Game.GetPlayer()actorRef = akActionRefstartTimer(CastTimerInterval)iSoundID = LoopSound.Play(actorRef)EndIfEndEventFunction CastSpellAndStartTimer()if IsFurnitureInUse()actorRef.ModValue(Experience, xpts) ; OR Game.RewardPlayerXP(xpts) OR SpellToCast.Cast(actorRef)startTimer(CastTimerInterval)endifEndFunctionEvent OnTimer(int aiTimerID)CastSpellAndStartTimer()EndEventEvent OnExitFurniture(ObjectReference akActionRef)CancelTimerSound.StopInstance(iSoundID)EndEventPS. Possibly, i'll steal Exp idea for ps4. For now i have temporary STR bonus awarded after a time period doing push-ups.Is ModValue(Experience) a safe method of awarding XP actually? Looks too harsh, game should register it somehow i suppose. Edited July 10, 2019 by hereami Link to comment Share on other sites More sharing options...
Evangela Posted July 11, 2019 Share Posted July 11, 2019 (edited) ModValue is thread safe as is all the other modxxx things. You run into trouble if you were to try setting the value while getting the value(the value wont change as expected), this is why it's better to use Modxxx. RewardExp might be better if the intent to always receive a specific amount and not care about things like how far you're into the current level, etc. The Experience AV allows for some extra maths. Edited July 11, 2019 by Rasikko Link to comment Share on other sites More sharing options...
hereami Posted July 11, 2019 Share Posted July 11, 2019 (edited) ModValue is thread safe as is all the other modxxx things. You run into trouble if you were to try setting the value while getting the value(the value wont change as expected), this is why it's better to use Modxxx. RewardExp might be better if the intent to always receive a specific amount and not care about things like how far you're into the current level, etc. The Experience AV allows for some extra maths.Interesting, thanks. I thought about how game reacts to direct edit, does it accumulate silently and then suddenly you get level up after getting legit 1 XP from Reward function? RewardPlayerXP has a parameter abDirect to bypass situational calculations.PS. Well, if silently, then it may be better for getting small amount frequently. Edited July 11, 2019 by hereami Link to comment Share on other sites More sharing options...
Evangela Posted July 13, 2019 Share Posted July 13, 2019 (edited) My take on that parameter is that the passed in XP can be made subject to modifiers provided by perks. If you have perk that multiplies all gained xp by 50%(x1.5), this function will allow the passed in value to be affected by that. So if true, for example, 200 xp is 200xp, and not 300. This just conjecture/head math on my part, I have not done any testing. Edited July 13, 2019 by Rasikko Link to comment Share on other sites More sharing options...
Recommended Posts