Datatype Conversions
These functions will convert one type of data to another.
boolean to_boolean( any )
class to_class( string )
effect to_effect( any )
familiar to_familiar( any )
float to_float( any )
int to_int( any )
item to_item( any )
location to_location( any )
monster to_monster( string )
skill to_skill( any )
slot to_slot( any )
string to_string( any )
string to_plural( item )
Historical note
ASH did not originally support polymorphic functions, so it was not possible to have (for example) a single to_string(any) function that worked on any datatype. Instead, there were separate int_to_string(int), item_to_string(item), etc. functions. You may see these used in older scripts, and in fact they still work. The rule is that if a function name is not otherwise defined anywhere, and it ends with one of the modern type conversion function names shown above, it is treated as a call to the modern function. No check is made to verify that the chopped-off portion of the old function name actually matches the type of its parameter.