HasKeyword - Form: Difference between revisions

Jump to navigation Jump to search
→‎Examples: fixed syntax for the example "CurrentLocationHasKeyword". With additional check to return false if the location is none.
imported>Terra Nova2
(→‎Examples: just another example)
imported>Lisselli
(→‎Examples: fixed syntax for the example "CurrentLocationHasKeyword". With additional check to return false if the location is none.)
Line 32: Line 32:
Keyword property LocTypeHouse auto
Keyword property LocTypeHouse auto


Bool Function CurrentLocationHasKeyword()
Bool Function CurrentLocationHasKeyword(ObjectReference akRef, Keyword akKeyword)
         if Game.GetPlayer().GetCurrentLocation().HasKeyword(LocTypeHouse)
         Location kCurrentLoc = akRef.GetCurrentLocation()
        if (kCurrentLoc == none)
                return false
        endif
 
        if kCurrentLoc.HasKeyword(akKeyword)
                 return true
                 return true
         else
         else
Line 40: Line 45:
EndFunction
EndFunction


debug.trace("Is this location a house?: " +CurrentLocationHasKeyword(LocTypeHouse))
</source>
</source>


== See Also ==
== See Also ==
*[[Form Script]]
*[[Form Script]]
Anonymous user

Navigation menu