diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index 274c865bf9..5f4898b369 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -1280,3 +1280,16 @@ DEFINE_ACTION_FUNCTION(FStringStruct, ToLower) self->ToLower(); return 0; } + +DEFINE_ACTION_FUNCTION(FStringStruct, ToInt) +{ + PARAM_SELF_STRUCT_PROLOGUE(FString); + PARAM_INT_DEF(base); + ACTION_RETURN_INT(self->ToLong(base)); +} + +DEFINE_ACTION_FUNCTION(FStringStruct, ToDouble) +{ + PARAM_SELF_STRUCT_PROLOGUE(FString); + ACTION_RETURN_FLOAT(self->ToDouble()); +} diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index e3f453fca1..f74c83e929 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -664,6 +664,8 @@ struct StringStruct native native int LastIndexOf(String substr) const; native void ToUpper(); native void ToLower(); + native int ToInt(int base = 0) const; + native double ToDouble() const; } class SectorEffect : Thinker native