Talk:ScriptEffectFinish
Is the description really accurate?
It's the same as for ScriptEffectStart. Now, I changed ScriptEffectStart here to ScriptEffectFinish, but nothing else. --Stardaemon 05:35, 1 April 2006 (EST)
No, I have changed it to what I am 99% sure is the right description. It runs once the scripted spell effect has expired/ended (example a buff of 20seconds would mean that the block would run 20seconds after the start script).
TaggeD 12:17, 1 April 2006 (EST)
Yeah, your new description looks more accurate:) Not that I've played with magic scripts, but it makes a lot of sense.
--Stardaemon 05:04, 2 April 2006 (EDT)
I'm having issues with the ScriptEffectFinish block not running. While an actor is affected by a scripted spell, leaving the cell or using the wait menu seems to prevent the block from running, which leaves the actors permanently affected by the spell. I'm not sure there's a way to fix this, just wondered if anyone else has noticed this. Scruggs 18:18, 18 July 2006 (EDT)
- Dragoon Wraith TALK 18:24, 18 July 2006 (EDT): Well, a work-around could hit actors in a cell with a new spell after Waiting (or entering the cell) that would check IsSpellTarget and if not, whether the effects were still on, and if so, then remove them like you would with ScriptEffectFinish.
- Sure. The workaround I'm using is placing a scripted item in the inventory, which applies the effects and removes itself after a set duration. Seems to work. I still think it's worth mentioning the issue, despite any workarounds. Scruggs 18:30, 18 July 2006 (EDT)
Grr...I've been playing with this again, and I'm having no issues with the scriptEffectFinish block. I need to do some more testing, but for now I'll remove the notes I made. Might as well post the test script I'm using. This one works fine (the menuMode stuff also runs, which is nice):
scn testMagicSCR ; testing to see how magic effect scripts handle menu mode ; include a menu mode block ; in the update portion, include a check on menuMode ; if menuMode detected, print a message and add a token to player's inventory ; also make sure scriptEffectFinish is running while out of the cell/during menuMode ; add a different token on scriptEffectFinish short started short menuOn begin scriptEffectStart if ( started == 0 ) message "Script Effect Started!" set started to 1 else message "Started == 1, start block running..." endif end ; leave the cell, come back, see if script restarts begin menuMode if ( menuOn == 0 ) message "Menu Mode is Running!!!!" player.addItem testMenuToken 1 set menuOn to 1 endif end begin scriptEffectUpdate if ( menumode ) if ( menuOn == 0 ) message "Update block says menu mode is on." player.addItem testMenuToken 1 set menuOn to 1 endif elseif ( menuOn == 1 ) message "Update block says menu mode now off..." set menuOn to 0 endif end begin scriptEffectFinish message "Finish block running!" player.addItem testFinishToken 1 end
In that script, the start block never restarts after leaving the cell. The menuMode block and the menuMode check inside the Update block both run, but only after traveling or waiting, not in the inventory screen. The Finish block always runs regardless of where the player is or whether menus are open or not.
This is the one I had issues with before. Going back to test it and see what's wrong:
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 end begin scriptEffectFinish message "Finished." set fat to ( fat * -1 ) modav fatigue fat end
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. Sorry for the confusion, hopefully I'll be able to post something more conclusive in a moment. Scruggs 20:19, 31 July 2006 (EDT)