TriggerZone & 3 daisy-chained statics

Post » Fri May 04, 2012 2:54 pm

TriggerZone & 3 daisy-chained statics

I'm trying to set up 3 static 'marker images' (based upon the 'blankcanvas02.nif') sitting one on top of another afixed to a wall. I've set up a cylinder triggerzone around the images, which is only triggered when the player enters the zone. I want the associated script to then enable the first image and start a timer, then disable that image and enable the next, etc. When the last image is displayed for a short period of time, it will be disabled, the first enabled, and the sequence will run again until the player leaves the zone.

I know I could make the first image a parent of the triggerzone and 'set parent to opposite state'. (Basic idea of the 'Light Switch' tutorial.) But since I want to enable the second image after a period of time has elapsed and when I do so to disable the first image but not the triggerzone, I don't believe I can use the 'set parent to opposite state' feature to further link the images, but instead have to handle the enable/disable process in my script. (Will the triggerzone be disabled if the parent is disabled?)

The logic problem I am encountering is that the Wiki on 'Disable' says:
'Does not work on objects with a parent ref. You will have to use the function on the parent ref instead. Use GetParentRef to find the parent ref. There is currently no function to determine the "Enable State to Opposite of Parent" flag.'

I believe I need the GetParentRef function to identify the next image in the sequence, as the script is tied to the triggerzone base object and I am going to need to set this up for a number of locations. I'd rather avoid setting up the same basic script tied to each specific location if I can help it.

But how can I get around this problem with the disable function? Or do I need to refigure my approach?

I am using OBSE20, and do have a Quest Init database script (no blocks) holding cross-script variables. Oh, and this is my first Oblivion mod so I have to look up everything so please don't assume I know anything beyond the very basics.

-Dubious-
User avatar
joeK
 
Posts: 3370
Joined: Tue Jul 10, 2007 10:22 am

Post » Fri May 04, 2012 7:27 pm

If you're using a script to enable or disable an item, then you just don't set a parent and the issue doesn't arise. The only time you use the enable parent is when it all happens at the same time, (e.g. activating the switch immediately notifying the light), or groups of items enabling/disabling together (like the furnishings in a house). In the latter cases, one item is the "master" and that is the one you'd need to affect to control the whole group. The use of GetParentRef is how you'd trace through the links to find the master, stopping at the one that has no parent.

Daisy-chaining via enable parents is paradoxically most used for activation - doors, lights etc. - and typically involves an animation that plays before the parent is activated, so that they operate in sequence. If you use a alpha fade animation instead of enable/disable to do the reveals, you could use that technique. That would avoid the need to make each item in the chain a permanent reference so that you can use an enable/disable on it. As long as the final state of the whole chain is the same as the initial state, then nothing needs remembering, and no part needs to be a permanent ref to track it.
User avatar
Hilm Music
 
Posts: 3357
Joined: Wed Jun 06, 2007 9:36 pm

Post » Fri May 04, 2012 7:21 pm

If you're using a script to enable or disable an item, then you just don't set a parent and the issue doesn't arise. The only time you use the enable parent is when it all happens at the same time, (e.g. activating the switch immediately notifying the light), or groups of items enabling/disabling together (like the furnishings in a house). In the latter cases, one item is the "master" and that is the one you'd need to affect to control the whole group. The use of GetParentRef is how you'd trace through the links to find the master, stopping at the one that has no parent.
Aha! Thanks for clearing that up.

Daisy-chaining via enable parents is paradoxically most used for activation - doors, lights etc. - and typically involves an animation that plays before the parent is activated, so that they operate in sequence.
Theoretical: So if a daisy-chain of animations are the children, and the trigger zone script activates the sequence with the furthest (oldest? first animation) child, what would be the parent? In this instance, the final 'marker', which would be the same as the last image of the animation?

If you use a alpha fade animation instead of enable/disable to do the reveals, you could use that technique.
Any pointers to a tutorial on animation and the alpha-fade trick? I may need to go that route in order to reduce Persistent Refs. It's amazing how fast they made the mod grow, and that suggests the save game will as well.

-Dubious-
User avatar
Kristian Perez
 
Posts: 3365
Joined: Thu Aug 23, 2007 3:03 am

Post » Fri May 04, 2012 11:32 am

Theoretical: So if a daisy-chain of animations are the children, and the trigger zone script activates the sequence with the furthest (oldest? first animation) child, what would be the parent? In this instance, the final 'marker', which would be the same as the last image of the animation?
There isn't any to call "the" parent, at each step the trigger has a parent that it activates, which has its own parent that it later activates, ...
Any pointers to a tutorial on animation and the alpha-fade trick?
There's the one on http://cs.elderscrolls.com/index.php/Basic_Animation_Tutorial which includes this kind of fades in the sample.
User avatar
Kelly James
 
Posts: 3266
Joined: Wed Oct 04, 2006 7:33 pm

Post » Fri May 04, 2012 9:39 am

There isn't any to call "the" parent, at each step the trigger has a parent that it activates, which has its own parent that it later activates, ...
I think I get it. What I have been thinking is 'the parent' is the one in the chain that doesn't have a 'parent' of it's own, so it's at the top of the chain. But the community terminology in use doesn't call that ref 'THE parent'. Rather 'parent' is simply the ref linked to the current ref. I have to use 'GetParentRef' to 'walk the chain' of returned refs until it fails to return a ref to determine that it (the current ref) is at the top of the chain, which is therefor 'the last ref that is a parent to a child'. (Which is what I have been thinking of as 'THE Parent'.) Which in turn makes it the ref I have to use to reset the entire chain (at once) back to whatever was each child's initial state. Which consequently would mean the linked activator (triggerzone in this case) gets reset, and implies any 'OnReset' block would get activated.

So, setting up a parent relationship should only be done when you want to change the enabled/disabled status on all the linked refs at once. Correct?

Edit: No, wait. I forgot you said 'each step'. Each step (separate ref in the chain) has it's own activator? I thought you just changed the state of the current ref and that automatically flipped the state of the parent?

There's the one on http://cs.elderscrolls.com/index.php/Basic_Animation_Tutorial which includes this kind of fades in the sample.
Thanks for the pointer.

-Dubious-
User avatar
Chloe Yarnall
 
Posts: 3461
Joined: Sun Oct 08, 2006 3:26 am

Post » Fri May 04, 2012 11:05 am

If you're doing enable/disable, you don't have chains. You link everything to a single parent at one level so you can do it all at once.

For your requirement, enable/disable isn't appropriate, so there will be parent.Activate requests in the scripts to pass things along the chain, and they won't all happen at once. Each item will reset itself (i.e. start playing the reverse animation to fade back out) when it triggers the next in the chain, so you won't need a final global reset, because the steps will already be reset.
User avatar
A Boy called Marilyn
 
Posts: 3391
Joined: Sat May 26, 2007 7:17 am

Post » Fri May 04, 2012 11:35 am

If you're doing enable/disable, you don't have chains. You link everything to a single parent at one level so you can do it all at once.

For your requirement, enable/disable isn't appropriate, so there will be parent.Activate requests in the scripts to pass things along the chain, and they won't all happen at once. Each item will reset itself (i.e. start playing the reverse animation to fade back out) when it triggers the next in the chain, so you won't need a final global reset, because the steps will already be reset.
Argh! I'm mixing up the two situations. But you've straightened me out. I'll wait on any further questions until I've tested some.

Oh, and thanks for your patience.

-Dubious-
User avatar
Damned_Queen
 
Posts: 3425
Joined: Fri Apr 20, 2007 5:18 pm


Return to IV - Oblivion