Repository navigation
Long
On this page, we will cover long fields in records.
Long fields can only store discrete (integer) values such as 1, 2, or 3. Decimal values such as 2.34 are not allowed.
If you are unsure whether a field is a Long, try entering a decimal value in FCS. If it automatically reverts to an integer, the field is a Long.
Some fields in FCS are displayed as enums or drop-down lists. Internally, however, they are still stored as Long values.
To determine the actual numeric value associated with an enum entry, KenshiUtilities is recommended.
For regular integer fields, you can use normal arithmetic operations in KenshiPatcher:
GetField("material cost") + 1For enum fields, it is recommended to determine the numeric value of the desired option in FCS or KenshiUtilities, and then use that value in KenshiPatcher.
For example, to select all belts:
GetField("slot") == 14Some drop-down lists are actually flags, where multiple options can be combined into a single integer. To determine which bit corresponds to a specific option, select only that option in FCS and inspect its value with KenshiUtilities.
KenshiPatcher provides several helper functions for working with flags:
HasFlag(a: int, b: int): boolReturns true if a contains the flag b; otherwise returns false.
RemoveFlag(a: int, b: int): intRemoves the flag b from a and returns the resulting value.
AddFlag(a: int, b: int): intAdds the flag b to a and returns the resulting value.
-
Getting Started
-
Cookbook
-
Patch Language
-
Variable Types
-
Miscellaneous
-
Support