psych0v0yager Posted November 6, 2016 Share Posted November 6, 2016 Here is My script Scriptname DwemerDestructionScaling extends activemagiceffect Event OnEffectStart (Actor akTarget, Actor akCaster) If akTarget == game.getPlayer() float Damage = 50*((game.getPlayer().getAV("Destruction"))/20)float Current = game.getplayer().ForceActorValue("DestructionPowerMod", Damage)float Goal = Current-DamageUtility.Wait(960.0)game.getplayer().ForceActorValue("DestructionPowerMod", Goal) EndIf EndEvent Here are the errors: Starting 1 compile threads for 1 files...Compiling "DwemerDestructionScaling"...D:\Games\steamapps\common\skyrim\Data\Scripts\Source\temp\DwemerDestructionScaling.psc(11,10): type mismatch while assigning to a float (cast missing or types unrelated)No output generated for DwemerDestructionScaling, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on DwemerDestructionScaling Link to comment Share on other sites More sharing options...
IsharaMeradin Posted November 6, 2016 Share Posted November 6, 2016 ForceActorValue does not return a float. Therefore you cannot assign it to a variable. If the function returned a float, then yes you could do that. You might want to try: Scriptname DwemerDestructionScaling extends activemagiceffect Event OnEffectStart (Actor akTarget, Actor akCaster) If akTarget == game.getPlayer() float Damage = 50*((akTarget.getAV("Destruction"))/20) akTarget.ForceActorValue("DestructionPowerMod", Damage) float Current = akTarget.GetActorValue("DestructionPowerMod") float Goal = Current-Damage Utility.Wait(960.0) akTarget.ForceActorValue("DestructionPowerMod", Goal) EndIf EndEvent Since you have already compared akTarget to Game.GetPlayer() there is no point in continuing to use Game.GetPlayer(). You can make it more thread safe and faster by simply using akTarget instead. You are suspending the script for 960 seconds? That is a lot of time, why not make the effect have a duration of 960 seconds instead. Then you can use the OnEffectFinish event to do the final actor value adjustment. Link to comment Share on other sites More sharing options...
psych0v0yager Posted November 6, 2016 Author Share Posted November 6, 2016 Thank you so much for replying, imma have to try it right away. Link to comment Share on other sites More sharing options...
psych0v0yager Posted November 6, 2016 Author Share Posted November 6, 2016 That is a good point, ill use OnEffectDuration, 960 seconds was supposed to be the length of the transformation. However, the script works but not perfectly, it does reduce the destruction damage, yet it reduces it too far. Link to comment Share on other sites More sharing options...
Recommended Posts