Jump to content

[LE] Location Keyword Check


Recommended Posts

Greetings - I'm having trouble checking the players current location for keywords - I thought it would be straight forward enough using LocationHasKeyword, however it fails to complie with error "no viable alternative at input 'LocationHasKeyword'". Event code is below - LocTypeCity is a filled Keyword property, as is PlayerRef.

 

I'm trying to check the player's location periodically to avoid spawning hostile NPCs in civilized areas - I could probably find a work around with another quest using an alias to check but it seemed like I should be able to do it with the script below...

 

Event OnUpdateGameTime()
;LocationRef Location = PlayerRef.GetLocation()
If PlayerRef.LocationHasKeyword LocTypeCity == 1; || PlayerRef.LocationHasKeyword LocTypeTown == 1 || PlayerRef.LocationHasKeyword LocTypeHabitation == 1
RegisterForSingleUpdateGameTime(1)
Else
SpawnPoint=Game.FindRandomReferenceOfAnyTypeInListFromRef(CotARefsToSpawnNear, PlayerRef, 10000)
CotAInvisibleActor.Enable()
CotAInvisibleActor.MoveTo(SpawnPoint)
RegisterForSingleLoSLost(CotAInvisibleActor, PlayerRef)
endIf
endEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

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