apixaez Posted July 14, 2012 Share Posted July 14, 2012 Hey ya'll, it's been a while since I've been here.. Unfortunately with my absence it seems I've forgotten how to properly script aswell (if I ever could script properly :P). I'm building a new .. player home/outpost which is basically in a mountain (enjoy the view ;)) and my plan is to have a switch that disables the forcefields/rocks when activated. From what I remember it "should" be working (or damn close to), just whenever I try to save the script it won't let me which probably means there's an error in the script somewhere.. And yes, it's based on one of the useful scripts from Beth. scn HRockSwitchTestSCRIPT ref HRockSwitchTest Begin OnActivate if HRockSwitchTest == 0 set HRockSwitchTest to GetLinkedRef endif if HRockSwitchTest.GetDisabled HRockSwitchTest.Enable else HRockSwitchTest.Disable endif Activate End If anyone could point me on what is wrong in this script, it would be greatly appreciated and I will give you an imaginary cookie. (and yes, they have persistent reference flags enabled). Thanks! Link to comment Share on other sites More sharing options...
apixaez Posted July 14, 2012 Author Share Posted July 14, 2012 To give you an idea of what I'm attempting.. The idea is that a forcefield and some rocks behind it are added in the area you're currently looking out so you kind of get a way to camouflage your hideout .. :) Link to comment Share on other sites More sharing options...
viennacalling Posted July 14, 2012 Share Posted July 14, 2012 I don't know what to tell you, I copied the script as you've posted it and pasted it into a new script in the GECK and it saved just fine. Link to comment Share on other sites More sharing options...
apixaez Posted July 14, 2012 Author Share Posted July 14, 2012 Well .. that's awkward .. :D I found it odd as I have exactly the same script (with different names obv) saved in an other mod .. so yeah .. odd Link to comment Share on other sites More sharing options...
rickerhk Posted July 14, 2012 Share Posted July 14, 2012 Do you have a Geck object named HRockSwitchTest ? If so, that would probably make the script not compile. Link to comment Share on other sites More sharing options...
apixaez Posted July 14, 2012 Author Share Posted July 14, 2012 Yes, it's the name of the switch (an activator) .. Both have persistent reference as flagged and the linked reference is set from switch to forcefield .. .. :o Link to comment Share on other sites More sharing options...
rickerhk Posted July 14, 2012 Share Posted July 14, 2012 If its the name of a reference, or the name of a base object, then use something else for the ref variable in the script, is what I meant, but didn't explain too well ;) Link to comment Share on other sites More sharing options...
apixaez Posted July 14, 2012 Author Share Posted July 14, 2012 It was the name of the base object .. I've just given it a new reference and changed it accordingly in the script, but allas, no success as of yet. Link to comment Share on other sites More sharing options...
rickerhk Posted July 14, 2012 Share Posted July 14, 2012 It was the name of the base object .. I've just given it a new reference and changed it accordingly in the script, but allas, no success as of yet. I'm reading that to mean the refname in the editor is still the same as the ref declaration in the script? They should not be the same. scn HRockSwitchTestSCRIPT ref rLinkedREF Begin OnActivate if rLinkedREF == 0 set rLinkedREF to GetLinkedRef endif if rLinkedREF.GetDisabled rLinkedREF.Enable else rLinkedREF.Disable endif Activate End Link to comment Share on other sites More sharing options...
apixaez Posted July 14, 2012 Author Share Posted July 14, 2012 I see what you mean .. I guess it's been quite a while though I must admit that scripting was never one of my strong sides when modding FONV. Kudos to you good sir and have a cookie :D Link to comment Share on other sites More sharing options...
Recommended Posts