Dakilleux Posted December 13, 2009 Share Posted December 13, 2009 I'd like to know what I should change for it to work. The intent of this spell effect is to make the target spin increasingly fast for the spell's duration. scriptname GravitySpell short Spinoramashort CurrentAngleZlong SpinTime Begin ScriptEffectStartset CurrentAngleZ to target.GetAngle Zset Spinorama to 1set SpinTime to CurrentAngleZ + SpinoramaEnd Begin ScriptEffectUpdatetarget.SetAngle Z, SpinTimeset Spinorama to Spinorama + SpinoramaEnd Begin ScriptEffectFinishMessage "Spell is finished."End The finish function is for testing purposes. Link to comment Share on other sites More sharing options...
Vagrant0 Posted December 13, 2009 Share Posted December 13, 2009 http://cs.elderscrolls.com/constwiki/index.php/GetSelfhttp://cs.elderscrolls.com/constwiki/index.php/GetAnglehttp://cs.elderscrolls.com/constwiki/index.php/SetAngle And a script portion that does something similar but doesn't increase in speed. Begin scripteffectstart set target to getself set counter to 35 set heading to target.getangle z target.setrestrained 1 if target == player disableplayercontrols endif end Begin scripteffectupdate if counter >= 1 set heading to heading + 6 target.setangle z, heading set counter to counter - 1 if target == player triggerhitshader 1 endif elseif counter <= 0 if target == player enableplayercontrols endif target.setrestrained 0 endif end Begin scripteffectfinish target.setrestrained 0 if target == player enableplayercontrols player.setrestrained 0 else target.setrestrained 0 endif end An increasing effect could probably be achieved by implementing a positive counter instead of a negative one (counter variable counts up for each pass instead of down), and applying the value of that counter to the angle adjustment. Link to comment Share on other sites More sharing options...
Dakilleux Posted December 14, 2009 Author Share Posted December 14, 2009 Thanks but I still don't get what's wrong with my script :/ I've looked around the CS wiki but nothing helps Edit: Here's a revised version scriptname WhirlwindEffect short targetshort currentzshort momentumlong rotate Begin ScriptEffectStart set target to getself set momentum to 1 target.setrestrained 1End Begin ScriptEffectUpdate set currentz to target.GetAngle Z set rotate to momentum + currentz target.setangle z, rotateEnd Begin ScriptEffectFinish target.setrestrained 0End it tells me this: Script 'WhirlwindEffect', Line 17Syntax Error. Invalid Reference 'target' (only object references and reference variables are allowed in this context). Link to comment Share on other sites More sharing options...
RagnaHighArc Posted December 14, 2009 Share Posted December 14, 2009 short target should be changed to ref target Link to comment Share on other sites More sharing options...
Dakilleux Posted December 14, 2009 Author Share Posted December 14, 2009 short target should be changed to ref target alright, I tried that but the script effect still doesn't do anything :( Link to comment Share on other sites More sharing options...
RagnaHighArc Posted December 14, 2009 Share Posted December 14, 2009 I;ll just redo the code and you'll see the differences. scriptname WhirlwindEffect ref target float currentz float rotate Begin ScriptEffectStart set target to getself target.setrestrained 1 End Begin ScriptEffectUpdate set currentz to target.GetAngle Z set rotate to currentz + 1 target.setangle z, rotate End Begin ScriptEffectFinish target.setrestrained 0 End then you gotta make sure the spell last more than a few seconds otherwise the last block will run and end the spell's effect. Link to comment Share on other sites More sharing options...
Recommended Posts