Triggerzone for Player and NPC's + DweRepository01 & Imp

Post » Tue Nov 20, 2012 9:16 am

I'm using DweRepository01 as a Player-Only vault. I've set it up so that room the Vault resides in restricts access to the player and the player only.

This is done with one trigger plane (defaultBlankTrigger, Collision Layer: L_ACTORZONE) in the doorway to the room and a trigger volume encasing the vault and the room. I haven't made the trigger volume yet but this is the script on the trigger plane:
Spoiler

Scriptname MDHVaultKeepOutScript01 extends ObjectReference{Trigger plane in doorway. Pushes actors away. Resets vault}ObjectReference Property Vault AutoObjectReference Property MDHPushMarker AutoActor Property PlayerRef AutoActor Property Intruder AutoEvent OnTriggerEnter(ObjectReference akActionRef)If akActionRef == PlayerRef  Vault.Reset()else	akActionRef = Intruder  MDHPushMarker.PushActorAway(Intruder, 10.0)endifEndEvent

I'm not sure what is and isn't working with my script.

Since DweRepository01 doesn't have any closing animations I need to use reset so it will close (DweRepository01 is impossible to see if you are triggering my plane). When testing I run through where I know my trigger to be a couple of times to be sure and then check on my vault, it's still wide open.

Secondly the idea is to prevent any followers/summoned creatures from being able to enter through the doorway with PushActorAway, I have no navmesh in the cell yet but I'm still able to get Lydia to walk through the door, nothing happens.

Lastly, this is the script on the activator that actually opens the vault:
Spoiler

Scriptname MDHVaultDoorOpenScript extends ObjectReference{Opens dwemer lock box}ObjectReference Property Vault AutoSound Property QSTAstrolabeButtonPressX AutoEvent OnCellAttach() ; this event runs when cell is loaded containing this scripted object  PlayAnimation("Open")EndEventEvent OnActivate(ObjectReference akActionRef);Actual ButtonPlayAnimationAndWait("Trigger01", "done") ; sound and animationQSTAstrolabeButtonPressX.Play(Self);Vault  Vault.PlayAnimationAndWait("trigger01", "Done")EndEvent

The model for my activator is ImpButton01, and whilst it does a fantastic job of opening my vault it does not actually animate itself (no button press). I've had a look at this mesh in NifSkope and I can plainly see the button pumping up and down like no tomorrow. How can I get it to play?

*EDIT: spoiler tags
User avatar
leigh stewart
 
Posts: 3415
Joined: Mon Oct 23, 2006 8:59 am

Post » Tue Nov 20, 2012 4:50 am

Just want to bump this multifaceted question.

I would be grateful for answers to any part of it.
User avatar
RaeAnne
 
Posts: 3427
Joined: Sat Jun 24, 2006 6:40 pm

Post » Tue Nov 20, 2012 6:20 am

A 'plane' may not be wide enough to trigger when the player enters it. Use a trigger box instead and make it at least two bodies wide.
Reset will NOT reset objects while your in the cell (usually). What exactly 'is' the objectReference 'vault'?

A note on pushactoraway, its very tricky. It took me several months of testing and messing around to get it to work in a triggerzone against anyone that was not in one of the player factions. You could look at that script to see what I did to get it to work. Its the triggerzone surrounding the exterior tower in the Helgen exterior cells.

Getting an animation to play on something can be tricky too, you need to know the hidden animation table names of things in the animation, and there is no information on that. What I suggest is, if the object to animate is used in the game, see how they animated it in code. If not, then good luck finding a way to get it to work.
User avatar
Mari martnez Martinez
 
Posts: 3500
Joined: Sat Aug 11, 2007 9:39 am

Post » Mon Nov 19, 2012 11:32 pm

A 'plane' may not be wide enough to trigger when the player enters it. Use a trigger box instead and make it at least two bodies wide.
Reset will NOT reset objects while your in the cell (usually). What exactly 'is' the objectReference 'vault'?

Thanks for the tip, it would not have occurred to me that a plane might not be wide enough (Odd because I remember using two in one of my oblivion mods that worked perfectly).
ObjectReference 'vault' is the DweRepository01 object. The same 'puzzle door' in the hermaeus mora quest. I read on another forum that you could get the door to close again by resetting it (as a workaround for its lack of closing animations).


Getting an animation to play on something can be tricky too, you need to know the hidden animation table names of things in the animation, and there is no information on that. What I suggest is, if the object to animate is used in the game, see how they animated it in code. If not, then good luck finding a way to get it to work.
This is disappointing news and exactly my problem. In every other script that I've been able to find this line of code:
PlayAnimationAndWait("Trigger01", "done")
has been sufficient to animate their respective objects. I don't think this has been included in the default scripts for ImpButton01, but nevertheless when applied it fails to animate. I don't know why Bethesda would deviate from their convention here with this object.
How hidden is hidden? It's easy to open the model up in NifSkope and see the animation playing, surely some clues could be extracted here somewhere???

I'll reiterate my pushactoraway question: In OnTriggerEnter, if I have an actor property, how do I get akActionRef to fill that property? So if == Player ; do one thing. if != Player ; do something else entirely.
User avatar
Tanya Parra
 
Posts: 3435
Joined: Fri Jul 28, 2006 5:15 am

Post » Tue Nov 20, 2012 1:37 am

With the reset of the door, you might try a 'disable' command first, wait a 10th of a second, then reset it, wait a 10th of a second, then enable it. That might reset it.

Hidden as in good luck finding it, even with nifskope. At least I have not been able to find the table entry names for an unused magic doorway that I wanted to use. Since its unused, there are no scripts to look at in-game to find out how to make it animate.

I'll reiterate my pushactoraway answer, its in my levelers tower mod how I got it to work. Links are in my signature. I don't have it open in the CK now.
User avatar
Quick Draw
 
Posts: 3423
Joined: Sun Sep 30, 2007 4:56 am

Post » Tue Nov 20, 2012 3:03 am

I have resolved the DweRepository01 problem (getting it to close).

In NifSkope its easy to see that no closing animation exists for this model. Therefore, workarounds must be used to get it "closed" again.

I read in another forum that calling "Reset" on the object would force it back to its original state, it has been my experience that this is false.

My solution:
  • Two DweRepository01 Objects with the same Cartesian coordinates
  • One of the objects is for interacting with. Calling [PlayAnimationAndWait("trigger01", "Done")] on this object will open it successfully. This object is initially disabled
  • Enable and "open" the first object
  • Disable the second object
To close
  • Once the player can no longer see the objects it is safe to "close" them
  • Disable the open object
  • Enable the closed one
Basically posting this for the benefit of anyone who finds they want to use the DweRepository01 object. Whenever the "open" one gets re-enabled it will automatically play through its opening animation again. I have not been able to find a way to get it back into its original pre-opened state.
User avatar
Tiffany Castillo
 
Posts: 3429
Joined: Mon Oct 22, 2007 7:09 am


Return to V - Skyrim