Doooom560 Posted February 8, 2011 Share Posted February 8, 2011 (edited) While altering my mods to my personal tastes (and personal use), I've gotten a little into scripting. One of the (incredibly simple) scripts I wrote is the following ScriptName StunAttack short fatigueDmg Begin ScriptEffectUpdate ;fatigueDmg seems to be doubled on execution in-game, hence the "/ 2" set fatigueDmg to (getAv Fatigue + 20) / 2 damageAv fatigue fatigueDmg End The goal of the script is to make the target go "ragdoll" for twenty seconds. Fatigue is the variable I used for this. I know the following about fatigue:- Fatigue automatically resets to it's max when it is positive (200 for player, 50 for other actors)- As long as fatigue is negative, the actor goes ragdoll- When fatigue is negative, it regenerates at 1 per second (hence the +20 in the script)- When fatigue reaches 0 again while rising, the actor gets back up and his/her fatigue gets maxed again Why don't I just do 70 damage to make any actor go ragdoll? Because this effect is linked to a weapon that can be used BY enemies AGAINST the player, so I need to be able to do 70 against actors and 220 against the player. Now, the problem I'm having is the following (also seen as commentary in script):When executing the script it unexplicably doubles the fatigue damage done. The question is: why and how do I prevent it?From a previous script I've made, I experienced the same problem, but tripling instead of doubling. Knowing that Medicine triples some chem effects and Small Guns double damage when maxed, I believe these skills seem to influence the variables I use in my scripts (this script is for a weapon, the other script is for a chem).I'm asking this because of my presumptions, if those are true, starting a new game (with non-maxed skills) will cause the scripts to no longer work as they're supposed to (this script no longer doing enough fatigue damage). So, as long as I have my skills maxed, the scripts work, they don't otherwise. I could also presume the contrary since, in FO3Edit, no flags indicating skill influence are active or visible. Any help of any kind is much appreciated,Doooom Edited February 8, 2011 by Doooom560 Link to comment Share on other sites More sharing options...
rickerhk Posted February 8, 2011 Share Posted February 8, 2011 Use a ScriptEffectStart block instead of a ScriptEffectUpdate block. a ScriptEffectStart block runs EXACTLY once.aScriptEffectUpdate block runs once every frame and is probably running a couple of times before the effect is removed. Link to comment Share on other sites More sharing options...
Doooom560 Posted February 9, 2011 Author Share Posted February 9, 2011 Seeing now as to how simple and obvious the answer is, I feel ashamed to have asked this question :wallbash: I used the Update block because I saw it being used in a FO3-original script, which didn't seem to cause any critical (or visible) oddities. Thanks for the help and enlightment!Doooom Link to comment Share on other sites More sharing options...
Recommended Posts