(int "1") returns 1
This might sound silly, but it's really useful.
For example, if you subset a string to extract a number, subset will return a string and you have to convert that.
(subset "answer is 7" 10 1) returns "7"
(int (subset "answer is 7" 10 1)) returns 7
also, in the past you needed to use int if you get/set numbers, as the stored number used to be a string.
this is an example of George's commonwealthfleet.xml
Code: Select all
(and (geq (int (objGetData gPlayerShip "commonCrimeSeverity")) 2)
(objSetData gPlayership "testData" 1) returns True
(typeof (objGetData gPlayership "testData") returns int32
int can also truncate your real number to integers
(int 12.1231124) returns 12
int converts hex numbers to dec
(int 0xFF) returns 255