Difference between revisions of "Talk:ScriptEffectFinish"
oh, come on now...
imported>Scruggs |
imported>Scruggs (oh, come on now...) |
||
Line 94: | Line 94: | ||
It could be an issue with modifying fatigue while in a different cell, but I don't recall ever seeing the "Finished" message while waiting or outside of the target's cell. I'm thinking it's more likely that leaving the Update block out caused the problem. Sorry for the confusion, hopefully I'll be able to post something more conclusive in a moment. [[User:Scruggs|Scruggs]] 20:19, 31 July 2006 (EDT) | It could be an issue with modifying fatigue while in a different cell, but I don't recall ever seeing the "Finished" message while waiting or outside of the target's cell. I'm thinking it's more likely that leaving the Update block out caused the problem. Sorry for the confusion, hopefully I'll be able to post something more conclusive in a moment. [[User:Scruggs|Scruggs]] 20:19, 31 July 2006 (EDT) | ||
Sorry to be filling this page up. I'm still getting conflicting results. Here's the modified script I'm testing with: | |||
<pre>scriptName taFatiguePotionSCR | |||
float fat | |||
begin scriptEffectStart | |||
message "Starting" | |||
set fat to getAV fatigue | |||
set fat to ( fat + 1 ) | |||
set fat to ( fat * -1 ) | |||
modav fatigue fat | |||
end | |||
begin scriptEffectUpdate | |||
if ( fat == 0 ) ; this should never run | |||
message "Fat == 0" | |||
endif | |||
end | |||
begin scriptEffectFinish | |||
message "Finished." | |||
set fat to ( fat * -1 ) | |||
modav fatigue fat | |||
end</pre> | |||
As long as I remain in the cell with the affected NPC, the Finish block runs and the fatigue is restored, even if I use the wait menu. But if I leave the cell, then when the duration is over I get the "Fat == 0" message, and no "Finished." The NPC remains unconscious. I'm thinking at some point the variable is getting reset? I'm not really understanding this, but I'm thinking the only workaround may be to run a timer inside the script instead of relying on the Finish block. But I'm a little worried about variables (including the timer variable) becoming reset. :sigh: Makes no sense for the first script to work, and not the second. Back to testing... [[User:Scruggs|Scruggs]] 20:51, 31 July 2006 (EDT) |