Difference between revisions of "Talk:ScriptEffectFinish"

Jump to navigation Jump to search
2,239 bytes added ,  19:19, 31 July 2006
no edit summary
imported>Scruggs
(so confoozing)
imported>Scruggs
Line 19: Line 19:
:: 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. [[User:Scruggs|Scruggs]] 18:30, 18 July 2006 (EDT)
:: 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. [[User:Scruggs|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. [[User:Scruggs|Scruggs]] 20:13, 31 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):
<pre>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</pre>
 
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:
<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
end
 
begin scriptEffectFinish
message "Finished."
set fat to ( fat * -1 )
modav fatigue fat
end</pre>
 
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. [[User:Scruggs|Scruggs]] 20:19, 31 July 2006 (EDT)
Anonymous user

Navigation menu