Jump to content

Papyrus - Check if Player is Thane


Saerileth

Recommended Posts

Ok I'm at a loss :tongue: maybe you can point out what I'm missing. I've got this script with the INT defined on each banner display and it appears to do nothing. What am I missing?

Scriptname DBM_bannerscript extends ObjectReference



Int Property Hold Auto

{1 = Reach

2 = Rift

3 = Haafingar

4 = Whiterun

5 = Eastmarch

6 = Hjaalmarch

7 = Pale

8 = Winterhold

9 = Falkreath}



FavorJarlsMakeFriendsScript Property ThaneScript Auto Hidden



Function Notify()

    RegisterForSingleUpdate(0.1)

EndFunction



Event OnInit()

    ThaneScript = Game.GetForm(0X087E24) As FavorJarlsMakeFriendsScript

EndEvent



Event OnUpdate()

    If(Hold == 1)

        If(thaneScript.ReachImpGetOutofJail > 0 || thaneScript.ReachSonsGetOutofJail > 0)

            Enable(true)

        EndIf

    ElseIf(Hold == 2)

        If(thaneScript.RiftImpGetOutofJail > 0 || thaneScript.RiftSonsGetOutofJail > 0)

            Enable(true)

        EndIf

    ElseIf(Hold == 3)

        If(thaneScript.HaafingarImpGetOutofJail > 0 || thaneScript.HaafingarSonsGetOutofJail > 0)

            Enable(true)

        EndIf

    ElseIf(Hold == 4)

        If(thaneScript.WhiterunImpGetOutofJail > 0 || thaneScript.WhiterunSonsGetOutofJail > 0)

            Enable(true)

        EndIf

    ElseIf(Hold == 5)

        If(thaneScript.EastmarchImpGetOutofJail > 0 || thaneScript.EastmarchSonsGetOutofJail > 0)

            Enable(true)

        EndIf

    ElseIf(Hold == 6)

        If(thaneScript.HjaalmarchImpGetOutofJail > 0 || thaneScript.HjaalmarchSonsGetOutofJail > 0)

            Enable(true)

        EndIf

    ElseIf(Hold == 7)

        If(thaneScript.PaleImpGetOutofJail > 0 || thaneScript.PaleSonsGetOutofJail > 0)

            Enable(true)

        EndIf

    ElseIf(Hold == 8)

        If(thaneScript.WinterholdImpGetOutofJail > 0 || thaneScript.WinterholdSonsGetOutofJail > 0)

            Enable(true)

        EndIf

    ElseIf(Hold == 9)

        If(thaneScript.FalkreathImpGetOutofJail > 0 || thaneScript.FalkreathSonsGetOutofJail > 0)

            Enable(true)

        EndIf

    EndIf    

EndEvent



Link to comment
Share on other sites

Well... is anyone calling Notify() on them? Is there like another script, a controller or something? If not, it's not surprising they don't do anything... OnUpdate() is never triggered if the object doesn't register for updates. And Notify() is a custom function I wrote, it's not something the game calls on its own.

 

Try this:

Scriptname DBM_bannerscript extends ObjectReference



Int Property Hold Auto

{1 = Reach

2 = Rift

3 = Haafingar

4 = Whiterun

5 = Eastmarch

6 = Hjaalmarch

7 = Pale

8 = Winterhold

9 = Falkreath}



FavorJarlsMakeFriendsScript Property ThaneScript Auto Hidden



Event OnInit()

    ThaneScript = Game.GetForm(0X087E24) As FavorJarlsMakeFriendsScript

EndEvent



Event OnCellAttach()

    If(Hold == 1)

        If(thaneScript.ReachImpGetOutofJail > 0 || thaneScript.ReachSonsGetOutofJail > 0)

            Enable(true)

        EndIf

    ElseIf(Hold == 2)

        If(thaneScript.RiftImpGetOutofJail > 0 || thaneScript.RiftSonsGetOutofJail > 0)

            Enable(true)

        EndIf

    ElseIf(Hold == 3)

        If(thaneScript.HaafingarImpGetOutofJail > 0 || thaneScript.HaafingarSonsGetOutofJail > 0)

            Enable(true)

        EndIf

    ElseIf(Hold == 4)

        If(thaneScript.WhiterunImpGetOutofJail > 0 || thaneScript.WhiterunSonsGetOutofJail > 0)

            Enable(true)

        EndIf

    ElseIf(Hold == 5)

        If(thaneScript.EastmarchImpGetOutofJail > 0 || thaneScript.EastmarchSonsGetOutofJail > 0)

            Enable(true)

        EndIf

    ElseIf(Hold == 6)

        If(thaneScript.HjaalmarchImpGetOutofJail > 0 || thaneScript.HjaalmarchSonsGetOutofJail > 0)

            Enable(true)

        EndIf

    ElseIf(Hold == 7)

        If(thaneScript.PaleImpGetOutofJail > 0 || thaneScript.PaleSonsGetOutofJail > 0)

            Enable(true)

        EndIf

    ElseIf(Hold == 8)

        If(thaneScript.WinterholdImpGetOutofJail > 0 || thaneScript.WinterholdSonsGetOutofJail > 0)

            Enable(true)

        EndIf

    ElseIf(Hold == 9)

        If(thaneScript.FalkreathImpGetOutofJail > 0 || thaneScript.FalkreathSonsGetOutofJail > 0)

            Enable(true)

        EndIf

    EndIf    

EndEvent
Link to comment
Share on other sites

Really? That's strange... it works for me (my version), and I see no reason why it would stop working with this different trigger mechanism. Are you sure your test character is thane in any of the holds? Cheating it in with the setstage command will NOT work, you need to actually have the conversation with the jarls for the jail freecards to be set. Also, could you check if you are having any errors in the papyrus log related to this script?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...