Can a trigger disable itself?

Post » Wed Jun 20, 2012 12:40 am

I have two trigger boxes overlaying the same object right now, because there are multiple steps involved with doing a particular ritual. Basically, I want the first trigger to turn the other trigger box on and turn itself off. Unfortunately, it seems like neither of those two lines is working. Can can anyone help me figre out why? Here is the script I used to run it. (Oh, and I did remember to name my trigger this time.)

Scriptname AltarActivator extends ObjectReferenceObjectReference Property Altar  Auto Quest Property TBJ01  Auto MiscObject Property Butterfly  Auto MiscObject Property Bee  Auto MiscObject Property DragonFly  Auto MiscObject Property Torchbug  Auto MiscObject Property Moth  Auto event OnActivate(ObjectReference akReference)   if (Game.Getplayer().getItemCount(Bee)==1 && Game.Getplayer().getItemCount(Butterfly)==1 && Game.Getplayer().getItemCount(Dragonfly)==1 && Game.Getplayer().getItemCount(Moth)==1 && Game.Getplayer().getItemCount(Torchbug)==1 && akReference==Game.Getplayer())	   TBJ01.SetStage(60)   ;if akReference==Game.GetPlayer()AltarButterfly.enable()AltarDragonfly.enable()AltarMoth.enable()AltarTorchbug.enable()Altarbee.enable()	   SecondBox.enable()	   Altar.disable()   endifendEventObjectReference Property AltarBee  Auto ObjectReference Property AltarMoth  Auto ObjectReference Property AltarButterfly  Auto ObjectReference Property AltarDragonfly  Auto ObjectReference Property AltarTorchbug  Auto ObjectReference Property SecondBox  Auto 
User avatar
Sakura Haruno
 
Posts: 3446
Joined: Sat Aug 26, 2006 7:23 pm

Post » Tue Jun 19, 2012 2:16 pm

Just checking - both properties are pointing at the right references in the Creation Kit?

If "Altar" is the reference to which this script is attached, then you don't need a property for it. Instead, you can simply call non-global functions on it by omitting the location:
Disable()
If you need to pass the scripted object as, say, the parameter of a function, then you can use the "Self" keyword.

If these two references will always be paired up in such a way that one is enabled and the other disabled, then you could use http://www.creationkit.com/Reference#Enable_Parent so that you only need to http://www.creationkit.com/Enable_-_ObjectReference/http://www.creationkit.com/Disable_-_ObjectReference one of them.

Cipscis
User avatar
sarah simon-rogaume
 
Posts: 3383
Joined: Thu Mar 15, 2007 4:41 am

Post » Tue Jun 19, 2012 11:31 am

Just checking - both properties are pointing at the right references in the Creation Kit?

If "Altar" is the reference to which this script is attached, then you don't need a property for it. Instead, you can simply call non-global functions on it by omitting the location:
Disable()
If you need to pass the scripted object as, say, the parameter of a function, then you can use the "Self" keyword.

If these two references will always be paired up in such a way that one is enabled and the other disabled, then you could use http://www.creationkit.com/Reference#Enable_Parent so that you only need to http://www.creationkit.com/Enable_-_ObjectReference/http://www.creationkit.com/Disable_-_ObjectReference one of them.

Cipscis

A great response, but my error was dumber than you gave me credit for. I had forgotten to change the ID when I edited base to differentiate the first one from the second one, so every time I changed it it immediately changed back. So, basically I was turning one off and another one on, it just didn't make a difference.

And I can't use parenting because there is a third and fourth step to the ritual.
User avatar
Cameron Garrod
 
Posts: 3427
Joined: Sat Jun 30, 2007 7:46 am

Post » Tue Jun 19, 2012 8:50 pm

A great response, but my error was dumber than you gave me credit for. I had forgotten to change the ID when I edited base to differentiate the first one from the second one, so every time I changed it it immediately changed back. So, basically I was turning one off and another one on, it just didn't make a difference.

And I can't use parenting because there is a third and fourth step to the ritual.

So it turns out I was wrong , that wasn't the problem. I've tried this several times and I still can't get it working. This time instead of duplicating the first box and changing properties, I made a completely new trigger from scratch and then gave it the Runes script and hooked it up to the first box. Now the first box disables itself just fine, but it won't enable the second box. This is driving me crazy.
User avatar
x_JeNnY_x
 
Posts: 3493
Joined: Wed Jul 05, 2006 3:52 pm

Post » Tue Jun 19, 2012 10:00 am

So it turns out I was wrong , that wasn't the problem. I've tried this several times and I still can't get it working. This time instead of duplicating the first box and changing properties, I made a completely new trigger from scratch and then gave it the Runes script and hooked it up to the first box. Now the first box disables itself just fine, but it won't enable the second box. This is driving me crazy.
Nvm again, when I made the new one from scratch I forgot to check Player Avtivated
User avatar
(G-yen)
 
Posts: 3385
Joined: Thu Oct 11, 2007 11:10 pm

Post » Tue Jun 19, 2012 10:25 pm

Nvm again, when I made the new one from scratch I forgot to check Player Avtivated

Nvm Yet Again. This seems to have been half of the problem, but I still can't get the second box to show up.
User avatar
LijLuva
 
Posts: 3347
Joined: Wed Sep 20, 2006 1:59 am


Return to V - Skyrim

cron