Background for Fallout 4
Member of the Location script
voidfunctionModifyKeywordData(KeywordakKeyword, floatafData)

Description

Wiki Description

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.

Documentation Comment

adds afData to the current keyword value (threadsafe)


Caveats

CK Wiki - Notes

  • 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)

Parameters

KeywordakKeyword

CK Wiki Description

The Keyword to query for.

floatafData

CK Wiki Description

The amount to modify the current value by.


Examples

; 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)

Auto-Generated Example

Keyword myKeyword__akKeyword
float myFloat__afData

myLocation__toCallFunctionOn.ModifyKeywordData(myKeyword__akKeyword, myFloat__afData)

Related Pages


Additional References

View this function’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.