ModifyKeywordData - Location

Revision as of 15:04, 2 December 2015 by imported>Plplecuyer (→‎Syntax)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Member of: Location Script

Modifies the data attached to the specified keyword on this location by adding the passed-in data to the current value, but as a single function call so it is thread-safe.

SyntaxEdit

Function ModifyKeywordData(Keyword akKeyword, float afData)

ParametersEdit

  • akKeyword: The Keyword to query for.
  • afData: The amount to modify the current value by.

Return ValueEdit

None.

ExamplesEdit

; Add 50 to the cost keyword on this location
MyHouseProperty.ModifyKeywordData(CostKeywordProperty, 50)


; Subtract 25 from the cost keyword on this location
MyHouseProperty.ModifyKeywordData(CostKeywordProperty, -25)

NotesEdit

  • You CAN modify keyword data on locations which do not have that keyword in the master file. This may be confusing. Here is an example:
    • If a location does not have a keyword, and you modify keyword data on it (add 10 for example) then:
      • LocationHasKeyword condition will return false and
      • GetKeywordDataForLocation for that keyword will return 10 (which is 0 + 10)

See AlsoEdit