Jump to content

Disable doesn't work


kampeao

Recommended Posts

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

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

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 by Pelgar
Link to comment
Share on other sites

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 by kampeao
Link to comment
Share on other sites

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

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

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...else

I 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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...