I want to make an spell that when it's active, you can press several keys and do stuff. First of all i "installed" OBSE, created an spell script and added it to the imperial inner abilities, so i would have this spell always active. I tried then this:
scriptname WaispScriptBegin ScriptEffectStartEndBegin ScriptEffectUpdate if GetKeyPress 0 == 78 ; NUM+ player.ModActorValue2 Health, 1 endif if GetKeyPress 0 == 156 ; NUM Enter player.ModActorValue2 Magicka, 1 endif if GetKeyPress 0 == 82 ; NUM 0 player.ModActorValue2 Fatigue, 1 endifEndBegin ScriptEffectFinishEnd
This script perfectly works, but it works so fast and i can't put a float value for the amount. Then i tried several things like next:
scriptname WaispScriptshort actualAmount = 0short neededAmountToAdvance = 1000short advancingAmount = 100Begin ScriptEffectStartEndBegin ScriptEffectUpdate if GetKeyPress 0 == 78 ; NUM+ set actualAmount to actualAmount + advancingAmount if actualAmount > neededAmountToAdvance set actualAmount to actualAmount - neededAmountToAdvance player.ModActorValue2 Health, 1 endif endif...
This piece of code won't work, it will not heal anything. I have no idea of what am i doing wrong, i tried different aproaches than this one like using a boolean (short with 0 or 1) and i couldn't get it to work.
I don't know why the previous script won't work, but I think the problem for the first script (the one that works) is that i have a really high fps, so even if i could use a float value for the amount it wouldn't perform the same way in all the computers, so the best approach would be to use a timer, like DateTime, a Clock... But i have no idea how to use something like that or how to search for it. In Skyrim Creation Kit you specify how many times per second Update will be triggered, but i don't know how to do that on Oblivion Construction Set.
Any ideas? Any advice? I read somewhere that i should use a global for actualAmount variable. I tried that too and it wouldn't work.
I read also that the problem is the spell is an ability and that could bring problems, but didn't understand that very well and i don't remember where i read that, so i can't reproduce the text.
Thank you all in advance.