ABVXYzackattack Posted November 23, 2010 Share Posted November 23, 2010 Hey, I really need help making this script effect work in my game. I've made it and everything seems fine, but it doesn't work!!!! :( Here is a copy of it: scn ZSmejhxScript float Timershort Activeshort Withdrawl Begin ScriptEffectStart Set Withdrawl to 0Set Timer to 0player.removespell ZSmejhxWithdrawlSet Active to 1 End Begin ScriptEffectUpdate If Active == 1 Player.Addspell ZSmejhxHighSet Timer to (Timer + ScriptEffectElapsedSeconds) endif If Timer >= 120 Set Active to 0Set Withdrawl to 1 endif end Begin ScriptEffectUpdate If Withdrawl == 1 MessageBox "Your body begins to feel crippled as the Smejhx withdrawl takes place..."player.removespell ZSmejhxHighplayer.addspell ZSmejhxWithdrawl endif end I've made sure it's a spell effect script, and that the duration of the effect matches the timer variable, so what's wrong? Link to comment Share on other sites More sharing options...
documn Posted November 23, 2010 Share Posted November 23, 2010 (edited) My guess is that when you remove the high spell, it immediately terminates the script so that the withdrawal spell never gets added. Also, you need two scripteffectupdate blocks but I don't think that's causing the problem. Edited November 23, 2010 by documn Link to comment Share on other sites More sharing options...
ABVXYzackattack Posted November 23, 2010 Author Share Posted November 23, 2010 hmmmmm......that would make sense. but the problem is is that it never removes the high spell. it just stays there after the timer is gone. i made it an ability so that it wouldn't be affected by a resist magic or weakness to magic. i think it has something to do with the timer variable, like it can't read it or it never achieves the destined value. also, where would i put the 2 scripteffectupdate blocks at? where the withdrawl effect starts? Link to comment Share on other sites More sharing options...
documn Posted November 23, 2010 Share Posted November 23, 2010 Ooops, I meant that you DON'T need two scripteffectupdate blocks. I don't foresee any problems if you stick your code into one block. Also, it may be helpful to add a printtoconsole command after you update your timer to see if it's working as intended. Just under your "set timer to timer + scripteffectelapsedseconds" line, put this line:printc "timer = %g" timer This should show you what your timer variable is if you open your console. If the numer isn't constantly increasing, then yes, there is something wrong with your timer. Link to comment Share on other sites More sharing options...
ABVXYzackattack Posted November 24, 2010 Author Share Posted November 24, 2010 alright. i fixed the blocks so that they're only 1.but it wont accept the line: printc "timer == %g" timerDoes it require the oblivion script extender? Link to comment Share on other sites More sharing options...
ABVXYzackattack Posted November 24, 2010 Author Share Posted November 24, 2010 oh. i only meant to put in 1 = in the script you told me to put in Link to comment Share on other sites More sharing options...
documn Posted November 24, 2010 Share Posted November 24, 2010 Oh yeah, I just kinda assumed you were using OBSE. You can't use the printc function if not. Does the script work if you delete or comment out this line? Link to comment Share on other sites More sharing options...
ABVXYzackattack Posted November 25, 2010 Author Share Posted November 25, 2010 ehhh....not really. its kinda at a stalemate right now. i'm gonna download OBSE, n see if the command line u suggested shows if my timer is working or notbtw, if the timer isn't working, what do u propose is wrong with it? Link to comment Share on other sites More sharing options...
documn Posted November 25, 2010 Share Posted November 25, 2010 I don't know what's wrong with the timer. Personally I would just do set timer to timer + scripteffectelapsedsecondsbut I don't see why your parenthesis would mess with it. Alternatively, you could just set your high spell to be 120 seconds long and add the withdrawal spell in a scripteffectfinish block. Another option is to add a scripted token in the scripteffectstart block, and let the token run the timer, and when the timer's up you can remove the high, add the withdrawal, and then remove the token. Link to comment Share on other sites More sharing options...
ABVXYzackattack Posted November 27, 2010 Author Share Posted November 27, 2010 Alright. I feel ya on ur first idea. But how would the scripteffectfinish block fit in there without a timer variable? Could I do like two script effects on the same potion? Like have one that serves only as a timer with no effects, and thus the second one would have the high and withdrawl? Like automatically start off with the high, and the second the timer script effect spell wears off, the withdrawl kicks in? Does this make any sense? Link to comment Share on other sites More sharing options...
Recommended Posts