How can I make it so the player has to sneak (in game it will say "You must duck to enter") in order to pass through a door into an interior cell and the same to get out?
How can I make it so the player has to sneak (in game it will say "You must duck to enter") in order to pass through a door into an interior cell and the same to get out?
Maybe something like this...?
Scriptname testaaa extends ObjectReferenceMessage Property YouMustSneakMes AutoEvent OnInit() Self.BlockActivation()endEventEvent OnActivate(ObjectReference akActionRef) ;wiki says it still fires despite BlockActivation() Actor kActor = akActionRef as Actor if kActor.IsSneaking() Self.Activate(akActionRef, true) ;true bypasses BlockActivation() elseIf kActor == Game.GetPlayer() YouMustSneakMes.Show() endIfendEvent
@mojo22 - I put the script on an autoload door and it doesn't work. Player walks towards door gets the message "To marker storage unit" enters door and the screen goes black. Can't see, don't know if I am moving, sounds like I am still outside and I have to quit.
Hmm, instead of Activate(), can you just do MoveTo and place an xmarker instead.
I am starting a new thread explaining what I want to do. Thanks.
Same thing happens as it did with mojo's script, black screen and no teleport.
Forget the sneak can I just block the door from player entering but NPC must be allowed to pass?
Are you sure your door is linked properly to the other side? If it is and it's some weird glitch with calling Activate on a door, use MoveTo. Also if you just want to block the player...
Scriptname testaaa extends ObjectReference;ObjectReference Property TeleportMarker AutoEvent OnInit() Self.BlockActivation()endEventEvent OnActivate(ObjectReference akActionRef) if akActionRef != Game.GetPlayer() Self.Activate(akActionRef as Actor, true) ;or akActionRef.MoveTo(TeleportMarker) endIfendEvent
Using the script
Event OnInit()
Self.BlockActivation()
endEvent
and also trying
Event OnLoad()
Self.BlockActivation()
EndEvent
this is what happens. The first part of the video is without any script on the autoload door and the second part is with the script - either of them.
http://www.youtube.com/watch?v=CNAMnsvBzEs
Works with normal doors but NPCs can't get through.
Yes. NPCs pass through without script being attached.
ScriptName YourDoorScript Extends ObjectReferenceMessage Property kYourMESG AutoEvent OnInit() BlockActivation()EndEventEvent OnActivate(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() If (akActionRef As Actor).IsSneaking() Activate(akActionRef) Else kYourMESG.Show() EndIf Else Activate(akActionRef) EndIfEndEvent- Hypno
The sneak option I discarded, I need that player cannot use the door at all but NPCs can. Thanks.
The original quest line was this. Payer is going to find a dwarf that lives in a small cave. Eventually when scripting is finished if the dwarf gets LOS he will run into his cave. I wanted to use a teleport script so that when the dwarf enters a trigger box that is at the cave entrance he just QUICKLY disappears. This I did but I need him to return and run a patrol package every night between 12-3am when he tends flowers, this would be the only time the dwarf leaves the cave and the player has the chance to "catch him" and talk to him before he disappears into his cave. In order that the player can't follow I scaled the cave entrance very small and a debug notification tells the player that he is too big to pass through so player has to wait until the following night, when dwarf runs his patrol package to have another chance to speak with him. Then I thought what if player could enter the cave but had to "duck"/sneak to enter. This was a little silly because it would require a lot of scaling of the interior cell, anyway I abandoned the idea. SO it was back to player cannot enter at all. Teleporting was working when the dwarf entered the cave but he wouldn't teleport out when the patrol package began, also teleporting required several trigger boxes, xmarkers and travel to xmarkers inside trigger boxes that had teleport scripts on them. SO a simple autoload door seemed better as the dwarf could quickly run away, thing is the player needs to be blocked from entering. Using mojo's scripts. respect mojo, on autoload doors resulted in the black screen (see link), so I used normal doors which one looks weird if the dwarf is running away has to stop to open a door and two a door to a cave...I think not. Anyway the script...
Event OnActivate(ObjectReference akActionRef)
if akActionRef != Game.GetPlayer()
Self.Activate(akActionRef as Actor, true)
endIf
endEvent
...doesn't do anything and the script...
Event OnInit()
Self.BlockActivation()
endEvent
...prevents the dwarf from using the door. So what I want effectively is that the dwarf leaves his cave at 12.00am goes to tend his flowers (patrol package), gets sight of player and runs away into his cave. Player attempts to enter the cave gets the message "This entrance is too small for you to fit through." and has to wait until the next night to catch the dwarf.