Thursday, May 3, 2012

Forum: Need Help with a Scripting Issue

Someone on the forums was asking for help making a dialog box. They were familiar with Oblivion but still learning Skyrim's CK, so they posted Oblivion code and asked for the Skyrim equivalent.
ScriptName SpecialSackScript

Short button

Begin OnActivate
        MessageBox "What you want to do?", "Take", "Open"
End

Begin on gamemode
        Set button to GetButtonPressed
        If ( button == 0 )
                Activate
        ElseIf ( button == 1)
                Specialsack.Activate player 1
        EndIf
End
JustinOther provided the new script:
ScriptName SpecialSackScript extends ObjectReference

Message Property YourMESG Auto

Event OnActivate(ObjectReference akActionRef)

        Int iButton = YourMESG.Show()
        If iButton == 0
                ; Take
        ElseIf iButton == 1
                ; Open
        EndIf

EndEvent
I went the extra mile and pointed out that a Message object needed to be created, as follows:

No comments:

Post a Comment