BadPrenup Posted July 16, 2009 Share Posted July 16, 2009 I am trying to make a mod that someone here requested that hides the players helmet. I figured a good old fashioned Toggle spell would work the best, and tried getting it to work but it doesn't want to fully. As far as I know every function is put in exactly how the CS Wiki says it should be. I put Works in brackets next to each part that works. scn NHSpellScript ref Helmet1 ref Helmet2 Begin ScriptEffectStart Set Helmet1 to Player.GetEquippedObject 1;sets first ref to whatever the player is wearing in his hair slot, which is what helms use (Works) Player.UnequipItem Helmet1;unequips the first ref (Works) SetEquipmentSlot 255 Helmet1;changes equip slot to "No Slot" (Works) Player.EquipItem Helmet1;Equips the helm again (Works) Player.UnequipItem Helmet2;first time spell is cast it won't do anything because it isn't yet defined (Doesn't Work) SetEquipmentSlot 1 Helmet2;first time spell is cast it won't do anything because it isn't yet defined (Doesn't Work) Set Helmet2 to Helmet1;sets second ref to what the first ref is so it will unequip it next time the player changes helmets (Doesn't Work) End I have been thinking of trying a few different things: Moving the stuff that doesn't work to ScriptEffectFinish.Putting a control If function before the stuff that doesn't work to make so it only sets Helmet2 to Helmet1 the first time, perhaps the script is ending when it tries to use an undefined ref. Link to comment Share on other sites More sharing options...
PacificMorrowind Posted July 16, 2009 Share Posted July 16, 2009 change the ref helmet2 to a ref in a quest script since the references in a spell script are reset on cast of spell (or actually probably on finish of spell but not sure which).Pacific Morrowind Link to comment Share on other sites More sharing options...
BadPrenup Posted July 17, 2009 Author Share Posted July 17, 2009 Hmm I see... I'll probably just put the whole thing in a quest script and change the spell so it runs the quest. I'll post back if it works or not. EDIT: It works great now. You helped create this:Helm Toggle Thanks PacificMorrowind. Oh, and if you don't mind my asking, why do you sign your name at the bottom of your posts? Just curious. Link to comment Share on other sites More sharing options...
PacificMorrowind Posted July 19, 2009 Share Posted July 19, 2009 great glad to hear it works now! I sign my name because I'm old fashioned and use to use emails and not forums and learned how to do snail mail letters. Although I am younger than a lot of modders I had a slightly old-school education which breeds politeness, good grammer, spelling and attention to details such as signing your name at the end of things.Pacific Morrowind Link to comment Share on other sites More sharing options...
Recommended Posts