STEAM GROUP
Skyrim Creation Kit (Public) CKPublic
STEAM GROUP
Skyrim Creation Kit (Public) CKPublic
117
IN-GAME
1,144
ONLINE
Founded
February 7, 2012
CSJC Apr 16, 2023 @ 12:01pm
Show Message Help?
I want to display a custom message if the player activates a particular door without having the key for it.

Something like:
if player.hasKey != True:
showMessage()

I attached this script to the door instance:

Scriptname AA_RequireKeyMessage extends ObjectReference

Message Property AA_LookForCluesMSG Auto

Event OnActivate(ObjectReference akActionRef)

AA_LookForCluesMSG.Show()

EndEvent

The message refuses to show, however, and I get the default "door locked" message.
< >
Showing 1-5 of 5 comments
Altbert Apr 16, 2023 @ 1:19pm 
Try this:
Scriptname AA_RequireKeyMessage extends ObjectReference Message Property AA_LookForCluesMSG Auto Player Property acPlayer Auto Key Propery keyRequirdeKey Auto Event OnActivate(ObjectReference akActionRef) If (!acPlayer.HasKey(keyRequiredKey) AA_LookForCluesMSG.Show() EndIf EndEvent

You may probably have placed the condition outside of the event and that won't work.
CSJC Apr 16, 2023 @ 7:01pm 
Originally posted by Altbert:
Try this:
Scriptname AA_RequireKeyMessage extends ObjectReference Message Property AA_LookForCluesMSG Auto Player Property acPlayer Auto Key Propery keyRequirdeKey Auto Event OnActivate(ObjectReference akActionRef) If (!acPlayer.HasKey(keyRequiredKey) AA_LookForCluesMSG.Show() EndIf EndEvent

You may probably have placed the condition outside of the event and that won't work.

Hm, still nothing. I played around with your code for a while, and ended up with this:

Scriptname AA_RequireKeyMessage extends ObjectReference

Message Property AA_LookForCluesMSG Auto
ObjectReference Property acPlayer Auto
ObjectReference Property AA_BlackreachCampKey Auto

Event OnActivate(ObjectReference akActionRef)
If (acPlayer.GetItemCount(AA_BlackreachCampKey) == 0)
AA_LookForCluesMSG.Show()
EndIf
EndEvent

Again, it compiles, but it just won't actually take effect in game.
Altbert Apr 17, 2023 @ 7:23am 
I presume you have attached the script to that specific door in the Render window and set all properties. Sorry for the mistake I made in my script, the player property should be: Actor Property acPlayer Auto (not ObjectReference). Change that in my script and use that again, but be sure to revert to an earlier save, as script properties tend to remain in save files.
CSJC Apr 17, 2023 @ 9:59am 
Still nothing. I think I'll leave the message out for now and find a workaround. Thanks for your help.
Altbert Apr 17, 2023 @ 10:03am 
OK. If you need any further help, just ask.
< >
Showing 1-5 of 5 comments
Per page: 1530 50