Difference between revisions of "Talk:ScriptEffectFinish"
Jump to navigation
Jump to search
no edit summary
imported>Scruggs (oh, come on now...) |
imported>Scruggs |
||
Line 95: | Line 95: | ||
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: | Sorry to be filling this page up. I'm still getting conflicting results. Here's the modified script I'm testing with: | ||
Line 122: | Line 123: | ||
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) | 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) | ||
____ | |||
I'm posting my latest results and then I think I've had enough of trying to figure this out. Input is welcome. Here's a test script that does nothing but report the number of seconds elapsed at the point when the variable becomes uninitialized: | |||
<pre>scriptName taFatiguePotionSCR | |||
float fat | |||
float timer | |||
begin scriptEffectStart | |||
message "Starting" | |||
set fat to 1 | |||
end | |||
begin scriptEffectUpdate | |||
set timer to ( timer + scriptEffectElapsedSeconds ) | |||
if ( fat == 0 ) ; this should never run | |||
message "Fat == 0 at %.2f seconds" timer | |||
endif | |||
end | |||
begin scriptEffectFinish | |||
message "Finished." | |||
end</pre> | |||
This spell has a 20-second duration. To test, I cast the spell on an NPC, leave the cell, and wait for the spell to wear off. In all cases, I get the message "Fat == 0 at xx seconds", with the timer being around 15.2 to 17.84. In about half of the tests, the first message is followed by "Fat == 0 at 0.00 seconds", which suggests that both variables are becoming uninitialized at some point before the script stops running. On a few occassions, both messages were followed by the "Finished" message, but generally not. | |||
I would like to think that giving the spell a long duration and using a timer inside the script to terminate the spell will provide a reliable workaround. But I'm more than a little confused as to why this doesn't seem to be an issue with other spell scripts. [[User:Scruggs|Scruggs]] 22:54, 31 July 2006 (EDT) |