Message Box Help

Post » Thu Jan 24, 2013 12:35 pm

I'm trying to create a script that makes a message box appear when you enter a cell, and I've done so by using a trigger volume on the Door Marker and putting this script on the trigger volume:

ScriptName FGEnterMessageBox extends ObjectReferenceActor Property PlayerREF AutoEvent OnTriggerEnter(ObjectReference akActionRef)		If akActionRef == Game.GetPlayer()				Debug.MessageBox("You push through to the other side of the wardrobe, and, much to your surprise, arrive in a dark and humid cave..")						EndIf			EndEvent

I've tested it, and this works correctly.

However, if you keep walking on that trigger, it'll just keep opening up. Obviously I only want it to appear when you first enter the cell, and only appear again when you enter the cell again and land on the trigger. Is there any way that I can get it to only trigger once and then reset when the player leaves the cell?
User avatar
Matthew Aaron Evans
 
Posts: 3361
Joined: Wed Jul 25, 2007 2:59 am

Post » Thu Jan 24, 2013 9:08 am

You declared the Player as an actor property > don't use Game.GetPlayer().

Try this instead:

ScriptName FGEnterMessageBox extends ObjectReferenceActor Property PlayerREF Autoint DoOnceEvent OnCellAttach()  DoOnce = 0EndEventEvent OnTriggerEnter(ObjectReference akActionRef)                If akActionRef == PlayerREF && DoOnce == 0                                Debug.MessageBox("You push through to the other side of the wardrobe, and, much to your surprise, arrive in a dark and humid cave..")                        DoOnce = 1                        EndIf                        EndEvent
User avatar
Pumpkin
 
Posts: 3440
Joined: Sun Jun 25, 2006 10:23 am


Return to V - Skyrim