kampeao Posted April 26, 2012 Share Posted April 26, 2012 So, I have a script that makes item 1 enable (inittialy disabled of course) and another one disable.The problem is that it enables the first item, but doesn't disable the second one.Does anyone know why?It's not the only script where this happens.Thanks. Link to comment Share on other sites More sharing options...
pintocat Posted April 26, 2012 Share Posted April 26, 2012 Each reference needs to have a name (not just disabling the base form's ID), and they also need to be persistent. Link to comment Share on other sites More sharing options...
kampeao Posted April 26, 2012 Author Share Posted April 26, 2012 yes, they are both persistent and item 1 is named wall1ref and the second is named wall2ref =/thanks for the help anyway :) Link to comment Share on other sites More sharing options...
pintocat Posted April 26, 2012 Share Posted April 26, 2012 with generic names like that are you sure there's not some other ref with that name that you're disabling? Link to comment Share on other sites More sharing options...
kampeao Posted April 26, 2012 Author Share Posted April 26, 2012 The problem isn't on the references names... I've changed them and it's the same problem... I have another script that is the same thing: disable item 1 and enable item 2, and the same problem: it only disables item 1, item 2 remain unnafected. Both item are persistent references...does anyone have a solution? I really can't understand why it doesn't work.Thanks for answering again :) Link to comment Share on other sites More sharing options...
Pelgar Posted April 27, 2012 Share Posted April 27, 2012 (edited) I don't think I've ever used enable/disable item so this is really a shot in the dark. It could possibly be a timing thing, maybe wait a few frames before issuing the second enable/disable command. Edit: I just took a look at Enable It has a Fade In option which defaults to (True) if you don't set it. This strengthens my initial thought that this could be a timing problem. Edited April 27, 2012 by Pelgar Link to comment Share on other sites More sharing options...
kampeao Posted April 27, 2012 Author Share Posted April 27, 2012 (edited) I don't think that's the problem might I'll try... any idea on how to wait a few frames between commands? Edit: nevermind, I quit... I even made an activator attached to a script with the onActivate block to make the item 2 disable, and it doesn't do anything...I quit, thanks anyway. Edited April 27, 2012 by kampeao Link to comment Share on other sites More sharing options...
Pelgar Posted April 27, 2012 Share Posted April 27, 2012 Kampeao, sorry for taking so long to reply, my internet has been down all morning. I realize you have given this up but if you ever get back to it or want a timer for something else here's a link. Timer Tutor It used to be a tutor for FO3 but now is for Skyrim but simply using GECK where it says CS should do the trick. The tutor says to set the Quest to Start Game Enable, for a simple trigger you wouldn't want that, just start the quest via the trigger. You'd probably want to end the Quest once your timer has elapsed and your code has ran. Link to comment Share on other sites More sharing options...
Quetzlsacatanango Posted April 27, 2012 Share Posted April 27, 2012 Are you enabling the reference directly, or does it have an enable parent that you are enabling?Use an enable parent, and set both items to the same parent. On item 2, tick the box that says something like 'set state to opposite of enable parent. Then whenever the parent is disabled, it will automatically enable item 2 and vice versa. Link to comment Share on other sites More sharing options...
kampeao Posted April 27, 2012 Author Share Posted April 27, 2012 Quetzlsacatanango, that's a pretty good idea, I'll try that the next time I need something like that.I don't know how, but I messed around with the script, changed the order of the commands (instead of disabling item 1 first, do it in second, etc) and changed from if...elseif to if...elseI really don't know what the problem was, but it's fixed.Here's the script anyway. Thanks for the help everyone :) scn Pmyscript2 ; secret passage at Home(z2) short open begin onActivate if open == 0 pmywallupstairs2ref.disable pmywallupstairs1ref.enable PDoorRef1.setopenstate 1 PBook3ref.disable PBook2ref.enable set open to 1 else pmywallupstairs2ref.enable pmywallupstairs1ref.disable PDoorRef1.setopenstate 0 PBook3ref.enable PBook2ref.disable set open to 0 endif end Link to comment Share on other sites More sharing options...
Recommended Posts