Jump to content

Condition to check for Words


Recommended Posts

I am aiming to make crafting recipes that only appear if the player knows all three words of a specific shout, but as far as I can tell, HasShout is binary so using it would make it appear even if they only know the first word, and there's no way to use a condition to check for individual words. I think I have an idea of what I have to do (use a script to check for Words and record it to global variables), just thought I'd ask first if anyone knows an easier/simpler way, before I dive into learning to script properly.

Link to comment
Share on other sites

Approach:

a) Use a Xmarker placed in a cell you want to show the receipe.

b) Or a triggerbox to handle players entry.

c) Or place the receipe disabled" to the cell, OnCellLoad() event should work for to trigger if player share the same cell with the receipe.

 

sample script for a) pwShowReceipeOnMarkerScript

 

Scriptname pwShowReceipeOnMarkerScript extends ObjectReference
; https://forums.nexusmods.com/index.php?/topic/9915733-condition-to-check-for-words/

; Pengawain wrote: "I am aiming to make crafting recipes that only appear if the player knows all three words of a specific shout"

  WordOfPower PROPERTY wop1 auto    ; fill these properties with the words you like to check
  WordOfPower PROPERTY wop2 auto
  WordOfPower PROPERTY wop3 auto

  Book PROPERTY myBook auto         ; the receipe to give, I hope book is the right type here!
  Bool bDone                        ; [default=False]


; -- EVENTs -- 3

EVENT OnInit()
    Debug.Trace(" OnInit() - has been called.. " +self)            ; for debugging only
ENDEVENT


EVENT OnCellAttach()
    myF_PlaceItem()
ENDEVENT


EVENT OnCellDetach()
IF ( bDone )                ; receipe already placed (and taken)
    self.DisableNoWait()
    self.Delete()
ENDIF
ENDEVENT


; -- FUNCTION --

;-----------------------
FUNCTION myF_PlaceItem()
;-----------------------
IF ( bDone )
    RETURN    ; - STOP -
ENDIF
;---------------------
; https://www.creationkit.com/index.php?title=IsWordUnlocked_-_Game

    IF Game.IsWordUnlocked(wop1) && Game.IsWordUnlocked(wop2) && Game.IsWordUnlocked(wop3)
        bDone = TRUE
        objectReference oRef = self.PlaceAtMe(myBook, 1, False, False)        ; create a new bookRef near the marker
    ENDIF
ENDFUNCTION

 

 

Edited by ReDragon2013
Link to comment
Share on other sites

  • Recently Browsing   0 members

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