[Scummvm-git-logs] scummvm master -> 9e7a459d387b6735832bd5d92656dd811185a08e

dreammaster dreammaster at scummvm.org
Sat Jul 17 02:49:42 UTC 2021


This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
83bf163365 AGS: Move script exports for DrawingSurface to a new plugins/core/ folder
9742dfb163 AGS: Shifting multiple classes to plugins/core/
c89b21b901 AGS: Shifting more classes to plugins/core/
9e7a459d38 AGS: In-progress shifting GlobalAPI to plugins/core/


Commit: 83bf16336575ce2d3aac9877e97df0552c3a2e90
    https://github.com/scummvm/scummvm/commit/83bf16336575ce2d3aac9877e97df0552c3a2e90
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-07-16T19:48:13-07:00

Commit Message:
AGS: Move script exports for DrawingSurface to a new plugins/core/ folder

Changed paths:
  A engines/ags/plugins/core/core.cpp
  A engines/ags/plugins/core/core.h
  A engines/ags/plugins/core/drawing_surface.cpp
  A engines/ags/plugins/core/drawing_surface.h
    engines/ags/engine/ac/drawing_surface.cpp
    engines/ags/engine/ac/drawing_surface.h
    engines/ags/engine/script/script_runtime.cpp
    engines/ags/globals.cpp
    engines/ags/globals.h
    engines/ags/module.mk
    engines/ags/plugins/ags_pal_render/pal_render.h
    engines/ags/plugins/ags_plugin.cpp
    engines/ags/plugins/ags_plugin.h
    engines/ags/plugins/plugin_base.cpp
    engines/ags/plugins/plugin_base.h


diff --git a/engines/ags/engine/ac/drawing_surface.cpp b/engines/ags/engine/ac/drawing_surface.cpp
index f8b74bdc59..731faffd66 100644
--- a/engines/ags/engine/ac/drawing_surface.cpp
+++ b/engines/ags/engine/ac/drawing_surface.cpp
@@ -500,12 +500,6 @@ RuntimeScriptValue Sc_DrawingSurface_GetWidth(void *self, const RuntimeScriptVal
 //
 //=============================================================================
 
-// void (ScriptDrawingSurface *sds, int xx, int yy, int font, const char* texx, ...)
-void ScPl_DrawingSurface_DrawString(ScriptDrawingSurface *sds, int xx, int yy, int font, const char *texx, ...) {
-	API_PLUGIN_SCRIPT_SPRINTF(texx);
-	DrawingSurface_DrawString(sds, xx, yy, font, scsf_buffer);
-}
-
 void RegisterDrawingSurfaceAPI(ScriptAPIVersion base_api, ScriptAPIVersion compat_api) {
 	ccAddExternalObjectFunction("DrawingSurface::Clear^1", Sc_DrawingSurface_Clear);
 	ccAddExternalObjectFunction("DrawingSurface::CreateCopy^0", Sc_DrawingSurface_CreateCopy);
@@ -530,32 +524,6 @@ void RegisterDrawingSurfaceAPI(ScriptAPIVersion base_api, ScriptAPIVersion compa
 	ccAddExternalObjectFunction("DrawingSurface::get_UseHighResCoordinates", Sc_DrawingSurface_GetUseHighResCoordinates);
 	ccAddExternalObjectFunction("DrawingSurface::set_UseHighResCoordinates", Sc_DrawingSurface_SetUseHighResCoordinates);
 	ccAddExternalObjectFunction("DrawingSurface::get_Width", Sc_DrawingSurface_GetWidth);
-
-	/* ----------------------- Registering unsafe exports for plugins -----------------------*/
-
-	ccAddExternalFunctionForPlugin("DrawingSurface::Clear^1", (void *)DrawingSurface_Clear);
-	ccAddExternalFunctionForPlugin("DrawingSurface::CreateCopy^0", (void *)DrawingSurface_CreateCopy);
-	ccAddExternalFunctionForPlugin("DrawingSurface::DrawCircle^3", (void *)DrawingSurface_DrawCircle);
-	ccAddExternalFunctionForPlugin("DrawingSurface::DrawImage^6", (void *)DrawingSurface_DrawImage);
-	ccAddExternalFunctionForPlugin("DrawingSurface::DrawLine^5", (void *)DrawingSurface_DrawLine);
-	ccAddExternalFunctionForPlugin("DrawingSurface::DrawMessageWrapped^5", (void *)DrawingSurface_DrawMessageWrapped);
-	ccAddExternalFunctionForPlugin("DrawingSurface::DrawPixel^2", (void *)DrawingSurface_DrawPixel);
-	ccAddExternalFunctionForPlugin("DrawingSurface::DrawRectangle^4", (void *)DrawingSurface_DrawRectangle);
-	ccAddExternalFunctionForPlugin("DrawingSurface::DrawString^104", (void *)ScPl_DrawingSurface_DrawString);
-	if (base_api < kScriptAPI_v350)
-		ccAddExternalFunctionForPlugin("DrawingSurface::DrawStringWrapped^6", (void *)DrawingSurface_DrawStringWrapped_Old);
-	else
-		ccAddExternalFunctionForPlugin("DrawingSurface::DrawStringWrapped^6", (void *)DrawingSurface_DrawStringWrapped);
-	ccAddExternalFunctionForPlugin("DrawingSurface::DrawSurface^2", (void *)DrawingSurface_DrawSurface);
-	ccAddExternalFunctionForPlugin("DrawingSurface::DrawTriangle^6", (void *)DrawingSurface_DrawTriangle);
-	ccAddExternalFunctionForPlugin("DrawingSurface::GetPixel^2", (void *)DrawingSurface_GetPixel);
-	ccAddExternalFunctionForPlugin("DrawingSurface::Release^0", (void *)DrawingSurface_Release);
-	ccAddExternalFunctionForPlugin("DrawingSurface::get_DrawingColor", (void *)DrawingSurface_GetDrawingColor);
-	ccAddExternalFunctionForPlugin("DrawingSurface::set_DrawingColor", (void *)DrawingSurface_SetDrawingColor);
-	ccAddExternalFunctionForPlugin("DrawingSurface::get_Height", (void *)DrawingSurface_GetHeight);
-	ccAddExternalFunctionForPlugin("DrawingSurface::get_UseHighResCoordinates", (void *)DrawingSurface_GetUseHighResCoordinates);
-	ccAddExternalFunctionForPlugin("DrawingSurface::set_UseHighResCoordinates", (void *)DrawingSurface_SetUseHighResCoordinates);
-	ccAddExternalFunctionForPlugin("DrawingSurface::get_Width", (void *)DrawingSurface_GetWidth);
 }
 
 } // namespace AGS3
diff --git a/engines/ags/engine/ac/drawing_surface.h b/engines/ags/engine/ac/drawing_surface.h
index 29343f7bec..efe1e1c07d 100644
--- a/engines/ags/engine/ac/drawing_surface.h
+++ b/engines/ags/engine/ac/drawing_surface.h
@@ -44,6 +44,7 @@ void    DrawingSurface_DrawRectangle(ScriptDrawingSurface *sds, int x1, int y1,
 void    DrawingSurface_DrawTriangle(ScriptDrawingSurface *sds, int x1, int y1, int x2, int y2, int x3, int y3);
 void    DrawingSurface_DrawString(ScriptDrawingSurface *sds, int xx, int yy, int font, const char *text);
 void    DrawingSurface_DrawStringWrapped(ScriptDrawingSurface *sds, int xx, int yy, int wid, int font, int alignment, const char *msg);
+void    DrawingSurface_DrawStringWrapped_Old(ScriptDrawingSurface *sds, int xx, int yy, int wid, int font, int alignment, const char *msg);
 void    DrawingSurface_DrawMessageWrapped(ScriptDrawingSurface *sds, int xx, int yy, int wid, int font, int msgm);
 void    DrawingSurface_DrawLine(ScriptDrawingSurface *sds, int fromx, int fromy, int tox, int toy, int thickness);
 void    DrawingSurface_DrawPixel(ScriptDrawingSurface *sds, int x, int y);
diff --git a/engines/ags/engine/script/script_runtime.cpp b/engines/ags/engine/script/script_runtime.cpp
index 38cdf39031..fe9ead95c7 100644
--- a/engines/ags/engine/script/script_runtime.cpp
+++ b/engines/ags/engine/script/script_runtime.cpp
@@ -173,7 +173,7 @@ int call_function(intptr_t addr, const RuntimeScriptValue *object, int numparm,
 		return -1;
 	} else {
 		// Build the parameters
-		ScriptMethodParams params;
+		Plugins::ScriptMethodParams params;
 		for (int i = 0; i < numparm; ++i)
 			params.push_back(parm_value[i]);
 
diff --git a/engines/ags/globals.cpp b/engines/ags/globals.cpp
index aa2fddc7a0..88b316276e 100644
--- a/engines/ags/globals.cpp
+++ b/engines/ags/globals.cpp
@@ -94,6 +94,7 @@
 #include "ags/engine/script/system_imports.h"
 #include "ags/lib/std/limits.h"
 #include "ags/plugins/plugin_object_reader.h"
+#include "ags/plugins/core/core.h"
 #include "common/file.h"
 
 namespace AGS3 {
@@ -206,6 +207,7 @@ Globals::Globals() {
 	_myScriptStringImpl = new ScriptString();
 	_guis = new std::vector<AGS::Shared::GUIMain>();
 	_play = new GameState();
+	_engineExports = new Plugins::Core::EngineExports();
 	_game = new GameSetupStruct();
 	_spriteset = new SpriteCache(_game->SpriteInfos);
 	_thisroom = new AGS::Shared::RoomStruct();
diff --git a/engines/ags/globals.h b/engines/ags/globals.h
index 71a94dffe4..2fca1230eb 100644
--- a/engines/ags/globals.h
+++ b/engines/ags/globals.h
@@ -89,6 +89,12 @@ class MessageBuffer;
 } // namespace Engine
 } // namespace AGS
 
+namespace Plugins {
+namespace Core {
+class EngineExports;
+} // namespace Core
+} // namespace Plugins
+
 class Navigation;
 class SplitLines;
 class SpriteCache;
@@ -693,6 +699,7 @@ public:
 	 * @{
 	 */
 
+	Plugins::Core::EngineExports *_engineExports;
 	GameSetupStruct *_game;
 	GameState *_play;
 	SpriteCache *_spriteset;
diff --git a/engines/ags/module.mk b/engines/ags/module.mk
index 3fd90119bc..d2707fdf1c 100644
--- a/engines/ags/module.mk
+++ b/engines/ags/module.mk
@@ -286,6 +286,8 @@ MODULE_OBJS = \
 	plugins/ags_plugin.o \
 	plugins/plugin_base.o \
 	plugins/plugin_object_reader.o \
+	plugins/core/core.o \
+	plugins/core/drawing_surface.o \
 	plugins/ags_agi/ags_agi.o \
 	plugins/ags_blend/ags_blend.o \
 	plugins/ags_clipboard/ags_clipboard.o \
diff --git a/engines/ags/plugins/ags_pal_render/pal_render.h b/engines/ags/plugins/ags_pal_render/pal_render.h
index 6664de0b99..fdf0e9317f 100644
--- a/engines/ags/plugins/ags_pal_render/pal_render.h
+++ b/engines/ags/plugins/ags_pal_render/pal_render.h
@@ -25,6 +25,7 @@
 
 #include "ags/lib/allegro.h"
 #include "ags/plugins/ags_plugin.h"
+#include "ags/plugins/plugin_base.h"
 #include "common/algorithm.h"
 
 namespace AGS3 {
diff --git a/engines/ags/plugins/ags_plugin.cpp b/engines/ags/plugins/ags_plugin.cpp
index 818a4308b9..e200518ea9 100644
--- a/engines/ags/plugins/ags_plugin.cpp
+++ b/engines/ags/plugins/ags_plugin.cpp
@@ -24,6 +24,7 @@
 #include "ags/lib/std/vector.h"
 #include "ags/shared/core/platform.h"
 #include "ags/plugins/ags_plugin.h"
+#include "ags/plugins/core/core.h"
 #include "ags/shared/ac/common.h"
 #include "ags/shared/ac/view.h"
 #include "ags/engine/ac/character_cache.h"
@@ -804,6 +805,9 @@ void pl_stop_plugins() {
 void pl_startup_plugins() {
 	int i;
 	for (i = 0; i < numPlugins; i++) {
+		if (i == 0)
+			_GP(engineExports).AGS_EngineStartup(&plugins[0].eiface);
+
 		if (plugins[i].available)
 			plugins[i].engineStartup(&plugins[i].eiface);
 	}
diff --git a/engines/ags/plugins/ags_plugin.h b/engines/ags/plugins/ags_plugin.h
index 7b32498912..7a7592315e 100644
--- a/engines/ags/plugins/ags_plugin.h
+++ b/engines/ags/plugins/ags_plugin.h
@@ -37,11 +37,6 @@
 
 namespace AGS3 {
 
-class ScriptMethodParams : public Common::Array<intptr_t> {
-public:
-	NumberPtr _result;
-};
-
 // If the plugin isn't using DDraw, don't require the headers
 #ifndef DIRECTDRAW_VERSION
 typedef void *LPDIRECTDRAW2;
diff --git a/engines/ags/plugins/core/core.cpp b/engines/ags/plugins/core/core.cpp
new file mode 100644
index 0000000000..6f5d26cdf4
--- /dev/null
+++ b/engines/ags/plugins/core/core.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ags/plugins/core/core.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+void EngineExports::AGS_EngineStartup(IAGSEngine *engine) {
+	_drawingSurface.AGS_EngineStartup(engine);
+}
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/core/core.h b/engines/ags/plugins/core/core.h
new file mode 100644
index 0000000000..72fc9661d8
--- /dev/null
+++ b/engines/ags/plugins/core/core.h
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef AGS_PLUGINS_CORE_CORE_H
+#define AGS_PLUGINS_CORE_CORE_H
+
+#include "ags/plugins/core/drawing_surface.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+class EngineExports {
+private:
+	DrawingSurface _drawingSurface;
+
+public:
+	void AGS_EngineStartup(IAGSEngine *engine);
+};
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
+
+#endif
diff --git a/engines/ags/plugins/core/drawing_surface.cpp b/engines/ags/plugins/core/drawing_surface.cpp
new file mode 100644
index 0000000000..d6a204322d
--- /dev/null
+++ b/engines/ags/plugins/core/drawing_surface.cpp
@@ -0,0 +1,168 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ags/plugins/core/drawing_surface.h"
+#include "ags/shared/ac/game_struct_defines.h"
+#include "ags/engine/ac/drawing_surface.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+void DrawingSurface::AGS_EngineStartup(IAGSEngine *engine) {
+	SCRIPT_METHOD_EXT(DrawingSurface::Clear^1, DrawingSurface_Clear);
+	SCRIPT_METHOD_EXT(DrawingSurface::CreateCopy^0, DrawingSurface_CreateCopy);
+	SCRIPT_METHOD_EXT(DrawingSurface::DrawCircle^3, DrawingSurface_DrawCircle);
+	SCRIPT_METHOD_EXT(DrawingSurface::DrawImage^6, DrawingSurface_DrawImage);
+	SCRIPT_METHOD_EXT(DrawingSurface::DrawLine^5, DrawingSurface_DrawLine);
+	SCRIPT_METHOD_EXT(DrawingSurface::DrawMessageWrapped^5, DrawingSurface_DrawMessageWrapped);
+	SCRIPT_METHOD_EXT(DrawingSurface::DrawPixel^2, DrawingSurface_DrawPixel);
+	SCRIPT_METHOD_EXT(DrawingSurface::DrawRectangle^4, DrawingSurface_DrawRectangle);
+	SCRIPT_METHOD_EXT(DrawingSurface::DrawString^104, ScPl_DrawingSurface_DrawString);
+
+	if (engine->version < kScriptAPI_v350)
+		SCRIPT_METHOD_EXT(DrawingSurface::DrawStringWrapped^6, DrawingSurface_DrawStringWrapped_Old);
+	else
+		SCRIPT_METHOD_EXT(DrawingSurface::DrawStringWrapped^6, DrawingSurface_DrawStringWrapped);
+
+	SCRIPT_METHOD_EXT(DrawingSurface::DrawSurface^2, DrawingSurface_DrawSurface);
+	SCRIPT_METHOD_EXT(DrawingSurface::DrawTriangle^6, DrawingSurface_DrawTriangle);
+	SCRIPT_METHOD_EXT(DrawingSurface::GetPixel^2, DrawingSurface_GetPixel);
+	SCRIPT_METHOD_EXT(DrawingSurface::Release^0, DrawingSurface_Release);
+	SCRIPT_METHOD_EXT(DrawingSurface::get_DrawingColor, DrawingSurface_GetDrawingColor);
+	SCRIPT_METHOD_EXT(DrawingSurface::set_DrawingColor, DrawingSurface_SetDrawingColor);
+	SCRIPT_METHOD_EXT(DrawingSurface::get_Height, DrawingSurface_GetHeight);
+	SCRIPT_METHOD_EXT(DrawingSurface::get_UseHighResCoordinates, DrawingSurface_GetUseHighResCoordinates);
+	SCRIPT_METHOD_EXT(DrawingSurface::set_UseHighResCoordinates, DrawingSurface_SetUseHighResCoordinates);
+	SCRIPT_METHOD_EXT(DrawingSurface::get_Width, DrawingSurface_GetWidth);
+}
+
+void DrawingSurface::DrawingSurface_Clear(ScriptMethodParams &params) {
+	PARAMS2(ScriptDrawingSurface *, sds, int, colour);
+	AGS3::DrawingSurface_Clear(sds, colour);
+}
+
+void DrawingSurface::DrawingSurface_CreateCopy(ScriptMethodParams &params) {
+	PARAMS1(ScriptDrawingSurface *, sds);
+	params._result = AGS3::DrawingSurface_CreateCopy(sds);
+}
+
+void DrawingSurface::DrawingSurface_DrawCircle(ScriptMethodParams &params) {
+	PARAMS4(ScriptDrawingSurface *, sds, int, x, int, y, int, radius);
+	AGS3::DrawingSurface_DrawCircle(sds, x, y, radius);
+}
+
+void DrawingSurface::DrawingSurface_DrawImage(ScriptMethodParams &params) {
+	PARAMS7(ScriptDrawingSurface *, sds, int, xx, int, yy, int, slot, int, trans, int, width, int, height);
+	AGS3::DrawingSurface_DrawImage(sds, xx, yy, slot, trans, width, height);
+}
+
+void DrawingSurface::DrawingSurface_DrawLine(ScriptMethodParams &params) {
+	PARAMS6(ScriptDrawingSurface *, sds, int, fromx, int, fromy, int, tox, int, toy, int, thickness);
+	AGS3::DrawingSurface_DrawLine(sds, fromx, fromy, tox, toy, thickness);
+}
+
+void DrawingSurface::DrawingSurface_DrawMessageWrapped(ScriptMethodParams &params) {
+	PARAMS6(ScriptDrawingSurface *, sds, int, xx, int, yy, int, wid, int, font, int, msgm);
+	AGS3::DrawingSurface_DrawMessageWrapped(sds, xx, yy, wid, font, msgm);
+}
+
+void DrawingSurface::DrawingSurface_DrawPixel(ScriptMethodParams &params) {
+	PARAMS3(ScriptDrawingSurface *, sds, int, x, int, y);
+	AGS3::DrawingSurface_DrawPixel(sds, x, y);
+}
+
+void DrawingSurface::DrawingSurface_DrawRectangle(ScriptMethodParams &params) {
+	PARAMS5(ScriptDrawingSurface *, sds, int, x1, int, y1, int, x2, int, y2);
+	AGS3::DrawingSurface_DrawRectangle(sds, x1, y1, x2, y2);
+}
+
+void DrawingSurface::ScPl_DrawingSurface_DrawString(ScriptMethodParams &params) {
+	PARAMS4(ScriptDrawingSurface *, sds, int, xx, int, yy, int, font);
+	Common::String buf = params.format(4);
+
+	AGS3::DrawingSurface_DrawString(sds, xx, yy, font, buf.c_str());
+}
+
+void DrawingSurface::DrawingSurface_DrawStringWrapped_Old(ScriptMethodParams &params) {
+	PARAMS7(ScriptDrawingSurface *, sds, int, xx, int, yy, int, wid, int, font, int, alignment, const char *, msg);
+	AGS3::DrawingSurface_DrawStringWrapped_Old(sds, xx, yy, wid, font, alignment, msg);
+}
+
+void DrawingSurface::DrawingSurface_DrawStringWrapped(ScriptMethodParams &params) {
+	PARAMS7(ScriptDrawingSurface *, sds, int, xx, int, yy, int, wid, int, font, int, alignment, const char *, msg);
+	AGS3::DrawingSurface_DrawStringWrapped(sds, xx, yy, wid, font, alignment, msg);
+}
+
+void DrawingSurface::DrawingSurface_DrawSurface(ScriptMethodParams &params) {
+	PARAMS3(ScriptDrawingSurface *, target, ScriptDrawingSurface *, source, int, translev);
+	AGS3::DrawingSurface_DrawSurface(target, source, translev);
+}
+
+void DrawingSurface::DrawingSurface_DrawTriangle(ScriptMethodParams &params) {
+	PARAMS7(ScriptDrawingSurface *, sds, int, x1, int, y1, int, x2, int, y2, int, x3, int, y3);
+	AGS3::DrawingSurface_DrawTriangle(sds, x1, y1, x2, y2, x3, y3);
+}
+
+void DrawingSurface::DrawingSurface_GetPixel(ScriptMethodParams &params) {
+	PARAMS3(ScriptDrawingSurface *, sds, int, x, int, y);
+	params._result = AGS3::DrawingSurface_GetPixel(sds, x, y);
+}
+
+void DrawingSurface::DrawingSurface_Release(ScriptMethodParams &params) {
+	PARAMS1(ScriptDrawingSurface *, sds);
+	AGS3::DrawingSurface_Release(sds);
+}
+
+void DrawingSurface::DrawingSurface_GetDrawingColor(ScriptMethodParams &params) {
+	PARAMS1(ScriptDrawingSurface *, sds);
+	params._result = AGS3::DrawingSurface_GetDrawingColor(sds);
+}
+
+void DrawingSurface::DrawingSurface_SetDrawingColor(ScriptMethodParams &params) {
+	PARAMS2(ScriptDrawingSurface *, sds, int, newColour);
+	AGS3::DrawingSurface_SetDrawingColor(sds, newColour);
+}
+
+void DrawingSurface::DrawingSurface_GetHeight(ScriptMethodParams &params) {
+	PARAMS1(ScriptDrawingSurface *, sds);
+	params._result = AGS3::DrawingSurface_GetHeight(sds);
+}
+
+void DrawingSurface::DrawingSurface_GetUseHighResCoordinates(ScriptMethodParams &params) {
+	PARAMS1(ScriptDrawingSurface *, sds);
+	params._result = AGS3::DrawingSurface_GetUseHighResCoordinates(sds);
+}
+
+void DrawingSurface::DrawingSurface_SetUseHighResCoordinates(ScriptMethodParams &params) {
+	PARAMS2(ScriptDrawingSurface *, sds, int, highRes);
+	AGS3::DrawingSurface_SetUseHighResCoordinates(sds, highRes);
+}
+
+void DrawingSurface::DrawingSurface_GetWidth(ScriptMethodParams &params) {
+	PARAMS1(ScriptDrawingSurface *, sds);
+	params._result = AGS3::DrawingSurface_GetWidth(sds);
+}
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/core/drawing_surface.h b/engines/ags/plugins/core/drawing_surface.h
new file mode 100644
index 0000000000..d1569b8cc4
--- /dev/null
+++ b/engines/ags/plugins/core/drawing_surface.h
@@ -0,0 +1,63 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef AGS_PLUGINS_CORE_DRAWING_SURFACE_H
+#define AGS_PLUGINS_CORE_DRAWING_SURFACE_H
+
+#include "ags/plugins/plugin_base.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+class DrawingSurface : public ScriptContainer {
+public:
+	void AGS_EngineStartup(IAGSEngine *engine);
+
+	static void DrawingSurface_Clear(ScriptMethodParams &params);
+	static void DrawingSurface_CreateCopy(ScriptMethodParams &params);
+	static void DrawingSurface_DrawCircle(ScriptMethodParams &params);
+	static void DrawingSurface_DrawImage(ScriptMethodParams &params);
+	static void DrawingSurface_DrawLine(ScriptMethodParams &params);
+	static void DrawingSurface_DrawMessageWrapped(ScriptMethodParams &params);
+	static void DrawingSurface_DrawPixel(ScriptMethodParams &params);
+	static void DrawingSurface_DrawRectangle(ScriptMethodParams &params);
+	static void ScPl_DrawingSurface_DrawString(ScriptMethodParams &params);
+	static void DrawingSurface_DrawStringWrapped_Old(ScriptMethodParams &params);
+	static void DrawingSurface_DrawStringWrapped(ScriptMethodParams &params);
+	static void DrawingSurface_DrawSurface(ScriptMethodParams &params);
+	static void DrawingSurface_DrawTriangle(ScriptMethodParams &params);
+	static void DrawingSurface_GetPixel(ScriptMethodParams &params);
+	static void DrawingSurface_Release(ScriptMethodParams &params);
+	static void DrawingSurface_GetDrawingColor(ScriptMethodParams &params);
+	static void DrawingSurface_SetDrawingColor(ScriptMethodParams &params);
+	static void DrawingSurface_GetHeight(ScriptMethodParams &params);
+	static void DrawingSurface_GetUseHighResCoordinates(ScriptMethodParams &params);
+	static void DrawingSurface_SetUseHighResCoordinates(ScriptMethodParams &params);
+	static void DrawingSurface_GetWidth(ScriptMethodParams &params);	
+};
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
+
+#endif
diff --git a/engines/ags/plugins/plugin_base.cpp b/engines/ags/plugins/plugin_base.cpp
index febf293a97..9367e08086 100644
--- a/engines/ags/plugins/plugin_base.cpp
+++ b/engines/ags/plugins/plugin_base.cpp
@@ -152,6 +152,12 @@ const char *pluginError() {
 
 /*------------------------------------------------------------------*/
 
+Common::String ScriptMethodParams::format(int formatIndex) {
+	error("TODO: Implement ScriptMethodParams::format");
+}
+
+/*------------------------------------------------------------------*/
+
 PluginBase::PluginBase() {
 	DLL_METHOD(AGS_PluginV2);
 	DLL_METHOD(AGS_EditorStartup);
diff --git a/engines/ags/plugins/plugin_base.h b/engines/ags/plugins/plugin_base.h
index 78cc272f55..58687aef04 100644
--- a/engines/ags/plugins/plugin_base.h
+++ b/engines/ags/plugins/plugin_base.h
@@ -102,42 +102,61 @@ inline int32 PARAM_FROM_FLOAT(float x) {
 	T8 N8 = (T8)params[7]; \
 	T9 N9 = (T9)params[8]
 
+class ScriptMethodParams;
 
 using string = const char *;
 typedef uint32 HWND;
 
 typedef void (*PluginMethod)(ScriptMethodParams &params);
 
+class ScriptMethodParams : public Common::Array<intptr_t> {
+public:
+	NumberPtr _result;
+
+	/**
+	 * Form of Common::String::format for the parameters array.
+	 * @param formatIndex	Param index of the format specifier string
+	 */
+	Common::String format(int formatIndex);
+};
+
 /**
- * Base class for the implementation of AGS plugins
+ * Shared base class for plugins and classes exposed to plugins
  */
-class PluginBase {
+class ScriptContainer {
 protected:
-Common::HashMap<Common::String, void *, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _methods;
+	static inline void registerFunction(IAGSEngine *engine, const char *name, PluginMethod fn) {
+		engine->RegisterScriptFunction(name, (void *)fn);
+	}
+};
 
-static int    AGS_PluginV2() {
-	return 1;
-}
-static int    AGS_EditorStartup(IAGSEditor *);
-static void   AGS_EditorShutdown();
-static void   AGS_EditorProperties(HWND);
-static int    AGS_EditorSaveGame(char *, int);
-static void   AGS_EditorLoadGame(char *, int);
-static void   AGS_EngineStartup(IAGSEngine *);
-static void   AGS_EngineShutdown();
-static int64 AGS_EngineOnEvent(int, NumberPtr);
-static int    AGS_EngineDebugHook(const char *, int, int);
-static void   AGS_EngineInitGfx(const char *driverID, void *data);
-
-static inline void registerFunction(IAGSEngine *engine, const char *name, PluginMethod fn) {
-	engine->RegisterScriptFunction(name, (void *)fn);
-}
+
+/**
+ * Base class for the implementation of AGS plugins
+ */
+class PluginBase: public ScriptContainer {
+protected:
+	Common::HashMap<Common::String, void *, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _methods;
+
+	static int    AGS_PluginV2() {
+		return 1;
+	}
+	static int    AGS_EditorStartup(IAGSEditor *);
+	static void   AGS_EditorShutdown();
+	static void   AGS_EditorProperties(HWND);
+	static int    AGS_EditorSaveGame(char *, int);
+	static void   AGS_EditorLoadGame(char *, int);
+	static void   AGS_EngineStartup(IAGSEngine *);
+	static void   AGS_EngineShutdown();
+	static int64 AGS_EngineOnEvent(int, NumberPtr);
+	static int    AGS_EngineDebugHook(const char *, int, int);
+	static void   AGS_EngineInitGfx(const char *driverID, void *data);
 public:
-PluginBase();
+	PluginBase();
 
-void *operator[](const Common::String &methodName) const {
-	return _methods[methodName];
-}
+	void *operator[](const Common::String &methodName) const {
+		return _methods[methodName];
+	}
 };
 
 extern void *pluginOpen(const char *filename);


Commit: 9742dfb16392c9c013eeda0d0ae8b710034c50b2
    https://github.com/scummvm/scummvm/commit/9742dfb16392c9c013eeda0d0ae8b710034c50b2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-07-16T19:48:14-07:00

Commit Message:
AGS: Shifting multiple classes to plugins/core/

Changed paths:
  A engines/ags/plugins/core/audio_channel.cpp
  A engines/ags/plugins/core/audio_channel.h
  A engines/ags/plugins/core/audio_clip.cpp
  A engines/ags/plugins/core/audio_clip.h
  A engines/ags/plugins/core/button.cpp
  A engines/ags/plugins/core/button.h
  A engines/ags/plugins/core/character.cpp
  A engines/ags/plugins/core/character.h
  A engines/ags/plugins/core/date_time.cpp
  A engines/ags/plugins/core/date_time.h
  A engines/ags/plugins/core/dialog.cpp
  A engines/ags/plugins/core/dialog.h
  A engines/ags/plugins/core/dialog_options_rendering_info.cpp
  A engines/ags/plugins/core/dialog_options_rendering_info.h
  A engines/ags/plugins/core/dynamic_sprite.cpp
  A engines/ags/plugins/core/dynamic_sprite.h
    engines/ags/engine/ac/audio_channel.cpp
    engines/ags/engine/ac/audio_clip.cpp
    engines/ags/engine/ac/button.cpp
    engines/ags/engine/ac/character.cpp
    engines/ags/engine/ac/character.h
    engines/ags/engine/ac/date_time.cpp
    engines/ags/engine/ac/dialog.cpp
    engines/ags/engine/ac/dialog_options_rendering.cpp
    engines/ags/engine/ac/dynamic_sprite.cpp
    engines/ags/module.mk
    engines/ags/plugins/core/core.cpp
    engines/ags/plugins/core/core.h
    engines/ags/plugins/core/drawing_surface.cpp
    engines/ags/plugins/core/drawing_surface.h


diff --git a/engines/ags/engine/ac/audio_channel.cpp b/engines/ags/engine/ac/audio_channel.cpp
index d580fc72d5..9852bbf9d1 100644
--- a/engines/ags/engine/ac/audio_channel.cpp
+++ b/engines/ags/engine/ac/audio_channel.cpp
@@ -294,22 +294,6 @@ void RegisterAudioChannelAPI() {
 	ccAddExternalObjectFunction("AudioChannel::set_Speed", Sc_AudioChannel_SetSpeed);
 	// For compatibility with  Ahmet Kamil's (aka Gord10) custom engine
 	ccAddExternalObjectFunction("AudioChannel::SetSpeed^1", Sc_AudioChannel_SetSpeed);
-
-	/* ----------------------- Registering unsafe exports for plugins -----------------------*/
-
-	ccAddExternalFunctionForPlugin("AudioChannel::Seek^1", (void *)AudioChannel_Seek);
-	ccAddExternalFunctionForPlugin("AudioChannel::SetRoomLocation^2", (void *)AudioChannel_SetRoomLocation);
-	ccAddExternalFunctionForPlugin("AudioChannel::Stop^0", (void *)AudioChannel_Stop);
-	ccAddExternalFunctionForPlugin("AudioChannel::get_ID", (void *)AudioChannel_GetID);
-	ccAddExternalFunctionForPlugin("AudioChannel::get_IsPlaying", (void *)AudioChannel_GetIsPlaying);
-	ccAddExternalFunctionForPlugin("AudioChannel::get_LengthMs", (void *)AudioChannel_GetLengthMs);
-	ccAddExternalFunctionForPlugin("AudioChannel::get_Panning", (void *)AudioChannel_GetPanning);
-	ccAddExternalFunctionForPlugin("AudioChannel::set_Panning", (void *)AudioChannel_SetPanning);
-	ccAddExternalFunctionForPlugin("AudioChannel::get_PlayingClip", (void *)AudioChannel_GetPlayingClip);
-	ccAddExternalFunctionForPlugin("AudioChannel::get_Position", (void *)AudioChannel_GetPosition);
-	ccAddExternalFunctionForPlugin("AudioChannel::get_PositionMs", (void *)AudioChannel_GetPositionMs);
-	ccAddExternalFunctionForPlugin("AudioChannel::get_Volume", (void *)AudioChannel_GetVolume);
-	ccAddExternalFunctionForPlugin("AudioChannel::set_Volume", (void *)AudioChannel_SetVolume);
 }
 
 } // namespace AGS3
diff --git a/engines/ags/engine/ac/audio_clip.cpp b/engines/ags/engine/ac/audio_clip.cpp
index ad2dd8526c..f6cc8e6a22 100644
--- a/engines/ags/engine/ac/audio_clip.cpp
+++ b/engines/ags/engine/ac/audio_clip.cpp
@@ -129,16 +129,6 @@ void RegisterAudioClipAPI() {
 	ccAddExternalObjectFunction("AudioClip::get_FileType", Sc_AudioClip_GetFileType);
 	ccAddExternalObjectFunction("AudioClip::get_IsAvailable", Sc_AudioClip_GetIsAvailable);
 	ccAddExternalObjectFunction("AudioClip::get_Type", Sc_AudioClip_GetType);
-
-	/* ----------------------- Registering unsafe exports for plugins -----------------------*/
-
-	ccAddExternalFunctionForPlugin("AudioClip::Play^2", (void *)AudioClip_Play);
-	ccAddExternalFunctionForPlugin("AudioClip::PlayFrom^3", (void *)AudioClip_PlayFrom);
-	ccAddExternalFunctionForPlugin("AudioClip::PlayQueued^2", (void *)AudioClip_PlayQueued);
-	ccAddExternalFunctionForPlugin("AudioClip::Stop^0", (void *)AudioClip_Stop);
-	ccAddExternalFunctionForPlugin("AudioClip::get_FileType", (void *)AudioClip_GetFileType);
-	ccAddExternalFunctionForPlugin("AudioClip::get_IsAvailable", (void *)AudioClip_GetIsAvailable);
-	ccAddExternalFunctionForPlugin("AudioClip::get_Type", (void *)AudioClip_GetType);
 }
 
 } // namespace AGS3
diff --git a/engines/ags/engine/ac/button.cpp b/engines/ags/engine/ac/button.cpp
index c398618a39..e52caa3aba 100644
--- a/engines/ags/engine/ac/button.cpp
+++ b/engines/ags/engine/ac/button.cpp
@@ -439,27 +439,6 @@ void RegisterButtonAPI() {
 	ccAddExternalObjectFunction("Button::get_TextColor", Sc_Button_GetTextColor);
 	ccAddExternalObjectFunction("Button::set_TextColor", Sc_Button_SetTextColor);
 	ccAddExternalObjectFunction("Button::get_View", Sc_Button_GetView);
-
-	/* ----------------------- Registering unsafe exports for plugins -----------------------*/
-
-	ccAddExternalFunctionForPlugin("Button::Animate^4", (void *)Button_Animate);
-	ccAddExternalFunctionForPlugin("Button::GetText^1", (void *)Button_GetText);
-	ccAddExternalFunctionForPlugin("Button::SetText^1", (void *)Button_SetText);
-	ccAddExternalFunctionForPlugin("Button::get_ClipImage", (void *)Button_GetClipImage);
-	ccAddExternalFunctionForPlugin("Button::set_ClipImage", (void *)Button_SetClipImage);
-	ccAddExternalFunctionForPlugin("Button::get_Font", (void *)Button_GetFont);
-	ccAddExternalFunctionForPlugin("Button::set_Font", (void *)Button_SetFont);
-	ccAddExternalFunctionForPlugin("Button::get_Graphic", (void *)Button_GetGraphic);
-	ccAddExternalFunctionForPlugin("Button::get_MouseOverGraphic", (void *)Button_GetMouseOverGraphic);
-	ccAddExternalFunctionForPlugin("Button::set_MouseOverGraphic", (void *)Button_SetMouseOverGraphic);
-	ccAddExternalFunctionForPlugin("Button::get_NormalGraphic", (void *)Button_GetNormalGraphic);
-	ccAddExternalFunctionForPlugin("Button::set_NormalGraphic", (void *)Button_SetNormalGraphic);
-	ccAddExternalFunctionForPlugin("Button::get_PushedGraphic", (void *)Button_GetPushedGraphic);
-	ccAddExternalFunctionForPlugin("Button::set_PushedGraphic", (void *)Button_SetPushedGraphic);
-	ccAddExternalFunctionForPlugin("Button::get_Text", (void *)Button_GetText_New);
-	ccAddExternalFunctionForPlugin("Button::set_Text", (void *)Button_SetText);
-	ccAddExternalFunctionForPlugin("Button::get_TextColor", (void *)Button_GetTextColor);
-	ccAddExternalFunctionForPlugin("Button::set_TextColor", (void *)Button_SetTextColor);
 }
 
 } // namespace AGS3
diff --git a/engines/ags/engine/ac/character.cpp b/engines/ags/engine/ac/character.cpp
index a0df9a72dd..e896818f0c 100644
--- a/engines/ags/engine/ac/character.cpp
+++ b/engines/ags/engine/ac/character.cpp
@@ -3682,148 +3682,6 @@ void RegisterCharacterAPI(ScriptAPIVersion base_api, ScriptAPIVersion compat_api
 	ccAddExternalObjectFunction("Character::get_TintRed",               Sc_Character_GetTintRed);
 	ccAddExternalObjectFunction("Character::get_TintSaturation",        Sc_Character_GetTintSaturation);
 	ccAddExternalObjectFunction("Character::get_TintLuminance",         Sc_Character_GetTintLuminance);
-
-	/* ----------------------- Registering unsafe exports for plugins -----------------------*/
-
-	ccAddExternalFunctionForPlugin("Character::AddInventory^2", (void *)Character_AddInventory);
-	ccAddExternalFunctionForPlugin("Character::AddWaypoint^2", (void *)Character_AddWaypoint);
-	ccAddExternalFunctionForPlugin("Character::Animate^5", (void *)Character_Animate);
-	ccAddExternalFunctionForPlugin("Character::ChangeRoom^3", (void *)Character_ChangeRoom);
-	ccAddExternalFunctionForPlugin("Character::ChangeRoomAutoPosition^2", (void *)Character_ChangeRoomAutoPosition);
-	ccAddExternalFunctionForPlugin("Character::ChangeView^1", (void *)Character_ChangeView);
-	ccAddExternalFunctionForPlugin("Character::FaceCharacter^2", (void *)Character_FaceCharacter);
-	ccAddExternalFunctionForPlugin("Character::FaceDirection^2", (void *)Character_FaceDirection);
-	ccAddExternalFunctionForPlugin("Character::FaceLocation^3", (void *)Character_FaceLocation);
-	ccAddExternalFunctionForPlugin("Character::FaceObject^2", (void *)Character_FaceObject);
-	ccAddExternalFunctionForPlugin("Character::FollowCharacter^3", (void *)Character_FollowCharacter);
-	ccAddExternalFunctionForPlugin("Character::GetProperty^1", (void *)Character_GetProperty);
-	ccAddExternalFunctionForPlugin("Character::GetPropertyText^2", (void *)Character_GetPropertyText);
-	ccAddExternalFunctionForPlugin("Character::GetTextProperty^1", (void *)Character_GetTextProperty);
-	ccAddExternalFunctionForPlugin("Character::HasInventory^1", (void *)Character_HasInventory);
-	ccAddExternalFunctionForPlugin("Character::IsCollidingWithChar^1", (void *)Character_IsCollidingWithChar);
-	ccAddExternalFunctionForPlugin("Character::IsCollidingWithObject^1", (void *)Character_IsCollidingWithObject);
-	ccAddExternalFunctionForPlugin("Character::LockView^1", (void *)Character_LockView);
-	ccAddExternalFunctionForPlugin("Character::LockView^2", (void *)Character_LockViewEx);
-	if (base_api < kScriptAPI_v341) {
-		ccAddExternalFunctionForPlugin("Character::LockViewAligned^3", (void *)Character_LockViewAligned_Old);
-		ccAddExternalFunctionForPlugin("Character::LockViewAligned^4", (void *)Character_LockViewAlignedEx_Old);
-	} else {
-		ccAddExternalFunctionForPlugin("Character::LockViewAligned^3", (void *)Character_LockViewAligned);
-		ccAddExternalFunctionForPlugin("Character::LockViewAligned^4", (void *)Character_LockViewAlignedEx);
-	}
-	ccAddExternalFunctionForPlugin("Character::LockViewFrame^3", (void *)Character_LockViewFrame);
-	ccAddExternalFunctionForPlugin("Character::LockViewFrame^4", (void *)Character_LockViewFrameEx);
-	ccAddExternalFunctionForPlugin("Character::LockViewOffset^3", (void *)Character_LockViewOffset);
-	ccAddExternalFunctionForPlugin("Character::LockViewOffset^4", (void *)Character_LockViewOffset);
-	ccAddExternalFunctionForPlugin("Character::LoseInventory^1", (void *)Character_LoseInventory);
-	ccAddExternalFunctionForPlugin("Character::Move^4", (void *)Character_Move);
-	ccAddExternalFunctionForPlugin("Character::PlaceOnWalkableArea^0", (void *)Character_PlaceOnWalkableArea);
-	ccAddExternalFunctionForPlugin("Character::RemoveTint^0", (void *)Character_RemoveTint);
-	ccAddExternalFunctionForPlugin("Character::RunInteraction^1", (void *)Character_RunInteraction);
-	ccAddExternalFunctionForPlugin("Character::Say^101", (void *)ScPl_Character_Say);
-	ccAddExternalFunctionForPlugin("Character::SayAt^4", (void *)Character_SayAt);
-	ccAddExternalFunctionForPlugin("Character::SayBackground^1", (void *)Character_SayBackground);
-	ccAddExternalFunctionForPlugin("Character::SetAsPlayer^0", (void *)Character_SetAsPlayer);
-	ccAddExternalFunctionForPlugin("Character::SetIdleView^2", (void *)Character_SetIdleView);
-	//ccAddExternalFunctionForPlugin("Character::SetOption^2",             (void*)Character_SetOption);
-	ccAddExternalFunctionForPlugin("Character::SetWalkSpeed^2", (void *)Character_SetSpeed);
-	ccAddExternalFunctionForPlugin("Character::StopMoving^0", (void *)Character_StopMoving);
-	ccAddExternalFunctionForPlugin("Character::Think^101", (void *)ScPl_Character_Think);
-	ccAddExternalFunctionForPlugin("Character::Tint^5", (void *)Character_Tint);
-	ccAddExternalFunctionForPlugin("Character::UnlockView^0", (void *)Character_UnlockView);
-	ccAddExternalFunctionForPlugin("Character::UnlockView^1", (void *)Character_UnlockViewEx);
-	ccAddExternalFunctionForPlugin("Character::Walk^4", (void *)Character_Walk);
-	ccAddExternalFunctionForPlugin("Character::WalkStraight^3", (void *)Character_WalkStraight);
-	ccAddExternalFunctionForPlugin("Character::GetAtRoomXY^2", (void *)GetCharacterAtRoom);
-	ccAddExternalFunctionForPlugin("Character::GetAtScreenXY^2", (void *)GetCharacterAtScreen);
-	ccAddExternalFunctionForPlugin("Character::get_ActiveInventory", (void *)Character_GetActiveInventory);
-	ccAddExternalFunctionForPlugin("Character::set_ActiveInventory", (void *)Character_SetActiveInventory);
-	ccAddExternalFunctionForPlugin("Character::get_Animating", (void *)Character_GetAnimating);
-	ccAddExternalFunctionForPlugin("Character::get_AnimationSpeed", (void *)Character_GetAnimationSpeed);
-	ccAddExternalFunctionForPlugin("Character::set_AnimationSpeed", (void *)Character_SetAnimationSpeed);
-	ccAddExternalFunctionForPlugin("Character::get_Baseline", (void *)Character_GetBaseline);
-	ccAddExternalFunctionForPlugin("Character::set_Baseline", (void *)Character_SetBaseline);
-	ccAddExternalFunctionForPlugin("Character::get_BlinkInterval", (void *)Character_GetBlinkInterval);
-	ccAddExternalFunctionForPlugin("Character::set_BlinkInterval", (void *)Character_SetBlinkInterval);
-	ccAddExternalFunctionForPlugin("Character::get_BlinkView", (void *)Character_GetBlinkView);
-	ccAddExternalFunctionForPlugin("Character::set_BlinkView", (void *)Character_SetBlinkView);
-	ccAddExternalFunctionForPlugin("Character::get_BlinkWhileThinking", (void *)Character_GetBlinkWhileThinking);
-	ccAddExternalFunctionForPlugin("Character::set_BlinkWhileThinking", (void *)Character_SetBlinkWhileThinking);
-	ccAddExternalFunctionForPlugin("Character::get_BlockingHeight", (void *)Character_GetBlockingHeight);
-	ccAddExternalFunctionForPlugin("Character::set_BlockingHeight", (void *)Character_SetBlockingHeight);
-	ccAddExternalFunctionForPlugin("Character::get_BlockingWidth", (void *)Character_GetBlockingWidth);
-	ccAddExternalFunctionForPlugin("Character::set_BlockingWidth", (void *)Character_SetBlockingWidth);
-	ccAddExternalFunctionForPlugin("Character::get_Clickable", (void *)Character_GetClickable);
-	ccAddExternalFunctionForPlugin("Character::set_Clickable", (void *)Character_SetClickable);
-	ccAddExternalFunctionForPlugin("Character::get_DestinationX", (void *)Character_GetDestinationX);
-	ccAddExternalFunctionForPlugin("Character::get_DestinationY", (void *)Character_GetDestinationY);
-	ccAddExternalFunctionForPlugin("Character::get_DiagonalLoops", (void *)Character_GetDiagonalWalking);
-	ccAddExternalFunctionForPlugin("Character::set_DiagonalLoops", (void *)Character_SetDiagonalWalking);
-	ccAddExternalFunctionForPlugin("Character::get_Frame", (void *)Character_GetFrame);
-	ccAddExternalFunctionForPlugin("Character::set_Frame", (void *)Character_SetFrame);
-	if (base_api < kScriptAPI_v341)
-		ccAddExternalFunctionForPlugin("Character::get_HasExplicitTint", (void *)Character_GetHasExplicitTint_Old);
-	else
-		ccAddExternalFunctionForPlugin("Character::get_HasExplicitTint", (void *)Character_GetHasExplicitTint);
-	ccAddExternalFunctionForPlugin("Character::get_ID", (void *)Character_GetID);
-	ccAddExternalFunctionForPlugin("Character::get_IdleView", (void *)Character_GetIdleView);
-	ccAddExternalFunctionForPlugin("Character::geti_InventoryQuantity", (void *)Character_GetIInventoryQuantity);
-	ccAddExternalFunctionForPlugin("Character::seti_InventoryQuantity", (void *)Character_SetIInventoryQuantity);
-	ccAddExternalFunctionForPlugin("Character::get_IgnoreLighting", (void *)Character_GetIgnoreLighting);
-	ccAddExternalFunctionForPlugin("Character::set_IgnoreLighting", (void *)Character_SetIgnoreLighting);
-	ccAddExternalFunctionForPlugin("Character::get_IgnoreScaling", (void *)Character_GetIgnoreScaling);
-	ccAddExternalFunctionForPlugin("Character::set_IgnoreScaling", (void *)Character_SetIgnoreScaling);
-	ccAddExternalFunctionForPlugin("Character::get_IgnoreWalkbehinds", (void *)Character_GetIgnoreWalkbehinds);
-	ccAddExternalFunctionForPlugin("Character::set_IgnoreWalkbehinds", (void *)Character_SetIgnoreWalkbehinds);
-	ccAddExternalFunctionForPlugin("Character::get_Loop", (void *)Character_GetLoop);
-	ccAddExternalFunctionForPlugin("Character::set_Loop", (void *)Character_SetLoop);
-	ccAddExternalFunctionForPlugin("Character::get_ManualScaling", (void *)Character_GetIgnoreScaling);
-	ccAddExternalFunctionForPlugin("Character::set_ManualScaling", (void *)Character_SetManualScaling);
-	ccAddExternalFunctionForPlugin("Character::get_MovementLinkedToAnimation", (void *)Character_GetMovementLinkedToAnimation);
-	ccAddExternalFunctionForPlugin("Character::set_MovementLinkedToAnimation", (void *)Character_SetMovementLinkedToAnimation);
-	ccAddExternalFunctionForPlugin("Character::get_Moving", (void *)Character_GetMoving);
-	ccAddExternalFunctionForPlugin("Character::get_Name", (void *)Character_GetName);
-	ccAddExternalFunctionForPlugin("Character::set_Name", (void *)Character_SetName);
-	ccAddExternalFunctionForPlugin("Character::get_NormalView", (void *)Character_GetNormalView);
-	ccAddExternalFunctionForPlugin("Character::get_PreviousRoom", (void *)Character_GetPreviousRoom);
-	ccAddExternalFunctionForPlugin("Character::get_Room", (void *)Character_GetRoom);
-	ccAddExternalFunctionForPlugin("Character::get_ScaleMoveSpeed", (void *)Character_GetScaleMoveSpeed);
-	ccAddExternalFunctionForPlugin("Character::set_ScaleMoveSpeed", (void *)Character_SetScaleMoveSpeed);
-	ccAddExternalFunctionForPlugin("Character::get_ScaleVolume", (void *)Character_GetScaleVolume);
-	ccAddExternalFunctionForPlugin("Character::set_ScaleVolume", (void *)Character_SetScaleVolume);
-	ccAddExternalFunctionForPlugin("Character::get_Scaling", (void *)Character_GetScaling);
-	ccAddExternalFunctionForPlugin("Character::set_Scaling", (void *)Character_SetScaling);
-	ccAddExternalFunctionForPlugin("Character::get_Solid", (void *)Character_GetSolid);
-	ccAddExternalFunctionForPlugin("Character::set_Solid", (void *)Character_SetSolid);
-	ccAddExternalFunctionForPlugin("Character::get_Speaking", (void *)Character_GetSpeaking);
-	ccAddExternalFunctionForPlugin("Character::get_SpeakingFrame", (void *)Character_GetSpeakingFrame);
-	ccAddExternalFunctionForPlugin("Character::get_SpeechAnimationDelay", (void *)GetCharacterSpeechAnimationDelay);
-	ccAddExternalFunctionForPlugin("Character::set_SpeechAnimationDelay", (void *)Character_SetSpeechAnimationDelay);
-	ccAddExternalFunctionForPlugin("Character::get_SpeechColor", (void *)Character_GetSpeechColor);
-	ccAddExternalFunctionForPlugin("Character::set_SpeechColor", (void *)Character_SetSpeechColor);
-	ccAddExternalFunctionForPlugin("Character::get_SpeechView", (void *)Character_GetSpeechView);
-	ccAddExternalFunctionForPlugin("Character::set_SpeechView", (void *)Character_SetSpeechView);
-	ccAddExternalFunctionForPlugin("Character::get_ThinkView", (void *)Character_GetThinkView);
-	ccAddExternalFunctionForPlugin("Character::set_ThinkView", (void *)Character_SetThinkView);
-	ccAddExternalFunctionForPlugin("Character::get_Transparency", (void *)Character_GetTransparency);
-	ccAddExternalFunctionForPlugin("Character::set_Transparency", (void *)Character_SetTransparency);
-	ccAddExternalFunctionForPlugin("Character::get_TurnBeforeWalking", (void *)Character_GetTurnBeforeWalking);
-	ccAddExternalFunctionForPlugin("Character::set_TurnBeforeWalking", (void *)Character_SetTurnBeforeWalking);
-	ccAddExternalFunctionForPlugin("Character::get_View", (void *)Character_GetView);
-	ccAddExternalFunctionForPlugin("Character::get_WalkSpeedX", (void *)Character_GetWalkSpeedX);
-	ccAddExternalFunctionForPlugin("Character::get_WalkSpeedY", (void *)Character_GetWalkSpeedY);
-	ccAddExternalFunctionForPlugin("Character::get_X", (void *)Character_GetX);
-	ccAddExternalFunctionForPlugin("Character::set_X", (void *)Character_SetX);
-	ccAddExternalFunctionForPlugin("Character::get_x", (void *)Character_GetX);
-	ccAddExternalFunctionForPlugin("Character::set_x", (void *)Character_SetX);
-	ccAddExternalFunctionForPlugin("Character::get_Y", (void *)Character_GetY);
-	ccAddExternalFunctionForPlugin("Character::set_Y", (void *)Character_SetY);
-	ccAddExternalFunctionForPlugin("Character::get_y", (void *)Character_GetY);
-	ccAddExternalFunctionForPlugin("Character::set_y", (void *)Character_SetY);
-	ccAddExternalFunctionForPlugin("Character::get_Z", (void *)Character_GetZ);
-	ccAddExternalFunctionForPlugin("Character::set_Z", (void *)Character_SetZ);
-	ccAddExternalFunctionForPlugin("Character::get_z", (void *)Character_GetZ);
-	ccAddExternalFunctionForPlugin("Character::set_z", (void *)Character_SetZ);
 }
 
 } // namespace AGS3
diff --git a/engines/ags/engine/ac/character.h b/engines/ags/engine/ac/character.h
index 7619cfc1e7..a33401373f 100644
--- a/engines/ags/engine/ac/character.h
+++ b/engines/ags/engine/ac/character.h
@@ -53,7 +53,9 @@ bool    Character_IsInteractionAvailable(CharacterInfo *cchar, int mood);
 void    Character_LockView(CharacterInfo *chap, int vii);
 void    Character_LockViewEx(CharacterInfo *chap, int vii, int stopMoving);
 void    Character_LockViewAligned(CharacterInfo *chap, int vii, int loop, int align);
+void    Character_LockViewAligned_Old(CharacterInfo *chap, int vii, int loop, int align);
 void    Character_LockViewAlignedEx(CharacterInfo *chap, int vii, int loop, int align, int stopMoving);
+void    Character_LockViewAlignedEx_Old(CharacterInfo *chap, int vii, int loop, int align, int stopMoving);
 void    Character_LockViewFrame(CharacterInfo *chaa, int view, int loop, int frame);
 void    Character_LockViewFrameEx(CharacterInfo *chaa, int view, int loop, int frame, int stopMoving);
 void    Character_LockViewOffset(CharacterInfo *chap, int vii, int xoffs, int yoffs);
@@ -62,6 +64,7 @@ void    Character_LoseInventory(CharacterInfo *chap, ScriptInvItem *invi);
 void    Character_PlaceOnWalkableArea(CharacterInfo *chap);
 void    Character_RemoveTint(CharacterInfo *chaa);
 int     Character_GetHasExplicitTint(CharacterInfo *chaa);
+int     Character_GetHasExplicitTint_Old(CharacterInfo *ch);
 void    Character_Say(CharacterInfo *chaa, const char *text);
 void    Character_SayAt(CharacterInfo *chaa, int x, int y, int width, const char *texx);
 ScriptOverlay *Character_SayBackground(CharacterInfo *chaa, const char *texx);
@@ -107,6 +110,8 @@ int     Character_GetDiagonalWalking(CharacterInfo *chaa);
 void    Character_SetDiagonalWalking(CharacterInfo *chaa, int yesorno);
 int     Character_GetClickable(CharacterInfo *chaa);
 void    Character_SetClickable(CharacterInfo *chaa, int clik);
+int     Character_GetDestinationX(CharacterInfo *chaa);
+int     Character_GetDestinationY(CharacterInfo *chaa);
 int     Character_GetID(CharacterInfo *chaa);
 int     Character_GetFrame(CharacterInfo *chaa);
 void    Character_SetFrame(CharacterInfo *chaa, int newval);
@@ -195,6 +200,7 @@ void setup_player_character(int charid);
 void CheckViewFrameForCharacter(CharacterInfo *chi);
 Shared::Bitmap *GetCharacterImage(int charid, int *isFlipped);
 CharacterInfo *GetCharacterAtScreen(int xx, int yy);
+CharacterInfo *GetCharacterAtRoom(int x, int y);
 // Get character ID at the given room coordinates
 int is_pos_on_character(int xx, int yy);
 void get_char_blocking_rect(int charid, int *x1, int *y1, int *width, int *y2);
diff --git a/engines/ags/engine/ac/date_time.cpp b/engines/ags/engine/ac/date_time.cpp
index b608fe1eb5..ea70acf547 100644
--- a/engines/ags/engine/ac/date_time.cpp
+++ b/engines/ags/engine/ac/date_time.cpp
@@ -127,17 +127,6 @@ void RegisterDateTimeAPI() {
 	ccAddExternalObjectFunction("DateTime::get_RawTime", Sc_DateTime_GetRawTime);
 	ccAddExternalObjectFunction("DateTime::get_Second", Sc_DateTime_GetSecond);
 	ccAddExternalObjectFunction("DateTime::get_Year", Sc_DateTime_GetYear);
-
-	/* ----------------------- Registering unsafe exports for plugins -----------------------*/
-
-	ccAddExternalFunctionForPlugin("DateTime::get_Now", (void *)DateTime_Now);
-	ccAddExternalFunctionForPlugin("DateTime::get_DayOfMonth", (void *)DateTime_GetDayOfMonth);
-	ccAddExternalFunctionForPlugin("DateTime::get_Hour", (void *)DateTime_GetHour);
-	ccAddExternalFunctionForPlugin("DateTime::get_Minute", (void *)DateTime_GetMinute);
-	ccAddExternalFunctionForPlugin("DateTime::get_Month", (void *)DateTime_GetMonth);
-	ccAddExternalFunctionForPlugin("DateTime::get_RawTime", (void *)DateTime_GetRawTime);
-	ccAddExternalFunctionForPlugin("DateTime::get_Second", (void *)DateTime_GetSecond);
-	ccAddExternalFunctionForPlugin("DateTime::get_Year", (void *)DateTime_GetYear);
 }
 
 } // namespace AGS3
diff --git a/engines/ags/engine/ac/dialog.cpp b/engines/ags/engine/ac/dialog.cpp
index b53b709bdd..4fec9a412b 100644
--- a/engines/ags/engine/ac/dialog.cpp
+++ b/engines/ags/engine/ac/dialog.cpp
@@ -1206,18 +1206,6 @@ void RegisterDialogAPI() {
 	ccAddExternalObjectFunction("Dialog::SetHasOptionBeenChosen^2", Sc_Dialog_SetHasOptionBeenChosen);
 	ccAddExternalObjectFunction("Dialog::SetOptionState^2",     Sc_Dialog_SetOptionState);
 	ccAddExternalObjectFunction("Dialog::Start^0",              Sc_Dialog_Start);
-
-	/* ----------------------- Registering unsafe exports for plugins -----------------------*/
-
-	ccAddExternalFunctionForPlugin("Dialog::get_ID", (void *)Dialog_GetID);
-	ccAddExternalFunctionForPlugin("Dialog::get_OptionCount", (void *)Dialog_GetOptionCount);
-	ccAddExternalFunctionForPlugin("Dialog::get_ShowTextParser", (void *)Dialog_GetShowTextParser);
-	ccAddExternalFunctionForPlugin("Dialog::DisplayOptions^1", (void *)Dialog_DisplayOptions);
-	ccAddExternalFunctionForPlugin("Dialog::GetOptionState^1", (void *)Dialog_GetOptionState);
-	ccAddExternalFunctionForPlugin("Dialog::GetOptionText^1", (void *)Dialog_GetOptionText);
-	ccAddExternalFunctionForPlugin("Dialog::HasOptionBeenChosen^1", (void *)Dialog_HasOptionBeenChosen);
-	ccAddExternalFunctionForPlugin("Dialog::SetOptionState^2", (void *)Dialog_SetOptionState);
-	ccAddExternalFunctionForPlugin("Dialog::Start^0", (void *)Dialog_Start);
 }
 
 } // namespace AGS3
diff --git a/engines/ags/engine/ac/dialog_options_rendering.cpp b/engines/ags/engine/ac/dialog_options_rendering.cpp
index d49e5e7d28..99c52fbef4 100644
--- a/engines/ags/engine/ac/dialog_options_rendering.cpp
+++ b/engines/ags/engine/ac/dialog_options_rendering.cpp
@@ -269,27 +269,6 @@ void RegisterDialogOptionsRenderingAPI() {
 	ccAddExternalObjectFunction("DialogOptionsRenderingInfo::set_Y", Sc_DialogOptionsRendering_SetY);
 	ccAddExternalObjectFunction("DialogOptionsRenderingInfo::get_HasAlphaChannel", Sc_DialogOptionsRendering_GetHasAlphaChannel);
 	ccAddExternalObjectFunction("DialogOptionsRenderingInfo::set_HasAlphaChannel", Sc_DialogOptionsRendering_SetHasAlphaChannel);
-
-	/* ----------------------- Registering unsafe exports for plugins -----------------------*/
-
-	ccAddExternalFunctionForPlugin("DialogOptionsRenderingInfo::get_ActiveOptionID", (void *)DialogOptionsRendering_GetActiveOptionID);
-	ccAddExternalFunctionForPlugin("DialogOptionsRenderingInfo::set_ActiveOptionID", (void *)DialogOptionsRendering_SetActiveOptionID);
-	ccAddExternalFunctionForPlugin("DialogOptionsRenderingInfo::get_DialogToRender", (void *)DialogOptionsRendering_GetDialogToRender);
-	ccAddExternalFunctionForPlugin("DialogOptionsRenderingInfo::get_Height", (void *)DialogOptionsRendering_GetHeight);
-	ccAddExternalFunctionForPlugin("DialogOptionsRenderingInfo::set_Height", (void *)DialogOptionsRendering_SetHeight);
-	ccAddExternalFunctionForPlugin("DialogOptionsRenderingInfo::get_ParserTextBoxX", (void *)DialogOptionsRendering_GetParserTextboxX);
-	ccAddExternalFunctionForPlugin("DialogOptionsRenderingInfo::set_ParserTextBoxX", (void *)DialogOptionsRendering_SetParserTextboxX);
-	ccAddExternalFunctionForPlugin("DialogOptionsRenderingInfo::get_ParserTextBoxY", (void *)DialogOptionsRendering_GetParserTextboxY);
-	ccAddExternalFunctionForPlugin("DialogOptionsRenderingInfo::set_ParserTextBoxY", (void *)DialogOptionsRendering_SetParserTextboxY);
-	ccAddExternalFunctionForPlugin("DialogOptionsRenderingInfo::get_ParserTextBoxWidth", (void *)DialogOptionsRendering_GetParserTextboxWidth);
-	ccAddExternalFunctionForPlugin("DialogOptionsRenderingInfo::set_ParserTextBoxWidth", (void *)DialogOptionsRendering_SetParserTextboxWidth);
-	ccAddExternalFunctionForPlugin("DialogOptionsRenderingInfo::get_Surface", (void *)DialogOptionsRendering_GetSurface);
-	ccAddExternalFunctionForPlugin("DialogOptionsRenderingInfo::get_Width", (void *)DialogOptionsRendering_GetWidth);
-	ccAddExternalFunctionForPlugin("DialogOptionsRenderingInfo::set_Width", (void *)DialogOptionsRendering_SetWidth);
-	ccAddExternalFunctionForPlugin("DialogOptionsRenderingInfo::get_X", (void *)DialogOptionsRendering_GetX);
-	ccAddExternalFunctionForPlugin("DialogOptionsRenderingInfo::set_X", (void *)DialogOptionsRendering_SetX);
-	ccAddExternalFunctionForPlugin("DialogOptionsRenderingInfo::get_Y", (void *)DialogOptionsRendering_GetY);
-	ccAddExternalFunctionForPlugin("DialogOptionsRenderingInfo::set_Y", (void *)DialogOptionsRendering_SetY);
 }
 
 } // namespace AGS3
diff --git a/engines/ags/engine/ac/dynamic_sprite.cpp b/engines/ags/engine/ac/dynamic_sprite.cpp
index 2ec1358fee..277c8102b1 100644
--- a/engines/ags/engine/ac/dynamic_sprite.cpp
+++ b/engines/ags/engine/ac/dynamic_sprite.cpp
@@ -614,31 +614,6 @@ void RegisterDynamicSpriteAPI() {
 	ccAddExternalStaticFunction("DynamicSprite::CreateFromFile", Sc_DynamicSprite_CreateFromFile);
 	ccAddExternalStaticFunction("DynamicSprite::CreateFromSaveGame", Sc_DynamicSprite_CreateFromSaveGame);
 	ccAddExternalStaticFunction("DynamicSprite::CreateFromScreenShot", Sc_DynamicSprite_CreateFromScreenShot);
-
-	/* ----------------------- Registering unsafe exports for plugins -----------------------*/
-
-	ccAddExternalFunctionForPlugin("DynamicSprite::ChangeCanvasSize^4", (void *)DynamicSprite_ChangeCanvasSize);
-	ccAddExternalFunctionForPlugin("DynamicSprite::CopyTransparencyMask^1", (void *)DynamicSprite_CopyTransparencyMask);
-	ccAddExternalFunctionForPlugin("DynamicSprite::Crop^4", (void *)DynamicSprite_Crop);
-	ccAddExternalFunctionForPlugin("DynamicSprite::Delete", (void *)DynamicSprite_Delete);
-	ccAddExternalFunctionForPlugin("DynamicSprite::Flip^1", (void *)DynamicSprite_Flip);
-	ccAddExternalFunctionForPlugin("DynamicSprite::GetDrawingSurface^0", (void *)DynamicSprite_GetDrawingSurface);
-	ccAddExternalFunctionForPlugin("DynamicSprite::Resize^2", (void *)DynamicSprite_Resize);
-	ccAddExternalFunctionForPlugin("DynamicSprite::Rotate^3", (void *)DynamicSprite_Rotate);
-	ccAddExternalFunctionForPlugin("DynamicSprite::SaveToFile^1", (void *)DynamicSprite_SaveToFile);
-	ccAddExternalFunctionForPlugin("DynamicSprite::Tint^5", (void *)DynamicSprite_Tint);
-	ccAddExternalFunctionForPlugin("DynamicSprite::get_ColorDepth", (void *)DynamicSprite_GetColorDepth);
-	ccAddExternalFunctionForPlugin("DynamicSprite::get_Graphic", (void *)DynamicSprite_GetGraphic);
-	ccAddExternalFunctionForPlugin("DynamicSprite::get_Height", (void *)DynamicSprite_GetHeight);
-	ccAddExternalFunctionForPlugin("DynamicSprite::get_Width", (void *)DynamicSprite_GetWidth);
-	ccAddExternalFunctionForPlugin("DynamicSprite::Create^3", (void *)DynamicSprite_Create);
-	ccAddExternalFunctionForPlugin("DynamicSprite::CreateFromBackground", (void *)DynamicSprite_CreateFromBackground);
-	ccAddExternalFunctionForPlugin("DynamicSprite::CreateFromDrawingSurface^5", (void *)DynamicSprite_CreateFromDrawingSurface);
-	ccAddExternalFunctionForPlugin("DynamicSprite::CreateFromExistingSprite^1", (void *)DynamicSprite_CreateFromExistingSprite_Old);
-	ccAddExternalFunctionForPlugin("DynamicSprite::CreateFromExistingSprite^2", (void *)DynamicSprite_CreateFromExistingSprite);
-	ccAddExternalFunctionForPlugin("DynamicSprite::CreateFromFile", (void *)DynamicSprite_CreateFromFile);
-	ccAddExternalFunctionForPlugin("DynamicSprite::CreateFromSaveGame", (void *)DynamicSprite_CreateFromSaveGame);
-	ccAddExternalFunctionForPlugin("DynamicSprite::CreateFromScreenShot", (void *)DynamicSprite_CreateFromScreenShot);
 }
 
 } // namespace AGS3
diff --git a/engines/ags/module.mk b/engines/ags/module.mk
index d2707fdf1c..b57661e52c 100644
--- a/engines/ags/module.mk
+++ b/engines/ags/module.mk
@@ -287,7 +287,15 @@ MODULE_OBJS = \
 	plugins/plugin_base.o \
 	plugins/plugin_object_reader.o \
 	plugins/core/core.o \
+	plugins/core/audio_channel.o \
+	plugins/core/audio_clip.o \
+	plugins/core/button.o \
+	plugins/core/character.o \
+	plugins/core/date_time.o \
+	plugins/core/dialog.o \
+	plugins/core/dialog_options_rendering_info.o \
 	plugins/core/drawing_surface.o \
+	plugins/core/dynamic_sprite.o \
 	plugins/ags_agi/ags_agi.o \
 	plugins/ags_blend/ags_blend.o \
 	plugins/ags_clipboard/ags_clipboard.o \
diff --git a/engines/ags/plugins/core/audio_channel.cpp b/engines/ags/plugins/core/audio_channel.cpp
new file mode 100644
index 0000000000..c3ea408ac3
--- /dev/null
+++ b/engines/ags/plugins/core/audio_channel.cpp
@@ -0,0 +1,113 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ags/plugins/core/audio_channel.h"
+#include "ags/engine/ac/audio_channel.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+void AudioChannel::AGS_EngineStartup(IAGSEngine *engine) {
+	SCRIPT_METHOD_EXT(AudioChannel::Seek^1, Seek);
+	SCRIPT_METHOD_EXT(AudioChannel::SetRoomLocation^2, SetRoomLocation);
+	SCRIPT_METHOD_EXT(AudioChannel::Stop^0, Stop);
+	SCRIPT_METHOD_EXT(AudioChannel::get_ID, GetID);
+	SCRIPT_METHOD_EXT(AudioChannel::get_IsPlaying, GetIsPlaying);
+	SCRIPT_METHOD_EXT(AudioChannel::get_LengthMs, GetLengthMs);
+	SCRIPT_METHOD_EXT(AudioChannel::get_Panning, GetPanning);
+	SCRIPT_METHOD_EXT(AudioChannel::set_Panning, SetPanning);
+	SCRIPT_METHOD_EXT(AudioChannel::get_PlayingClip, GetPlayingClip);
+	SCRIPT_METHOD_EXT(AudioChannel::get_Position, GetPosition);
+	SCRIPT_METHOD_EXT(AudioChannel::get_PositionMs, GetPositionMs);
+	SCRIPT_METHOD_EXT(AudioChannel::get_Volume, GetVolume);
+	SCRIPT_METHOD_EXT(AudioChannel::set_Volume, SetVolume);
+}
+
+void AudioChannel::Seek(ScriptMethodParams &params) {
+	PARAMS2(ScriptAudioChannel *, channel, int, newPosition);
+	AGS3::AudioChannel_Seek(channel, newPosition);
+}
+
+void AudioChannel::SetRoomLocation(ScriptMethodParams &params) {
+	PARAMS3(ScriptAudioChannel *, channel, int, xPos, int, yPos);
+	AGS3::AudioChannel_SetRoomLocation(channel, xPos, yPos);
+}
+
+void AudioChannel::Stop(ScriptMethodParams &params) {
+	PARAMS1(ScriptAudioChannel *, channel);
+	AGS3::AudioChannel_Stop(channel);
+}
+
+void AudioChannel::GetID(ScriptMethodParams &params) {
+	PARAMS1(ScriptAudioChannel *, channel);
+	params._result = AGS3::AudioChannel_GetID(channel);
+}
+
+void AudioChannel::GetIsPlaying(ScriptMethodParams &params) {
+	PARAMS1(ScriptAudioChannel *, channel);
+	params._result = AGS3::AudioChannel_GetIsPlaying(channel);
+}
+
+void AudioChannel::GetLengthMs(ScriptMethodParams &params) {
+	PARAMS1(ScriptAudioChannel *, channel);
+	params._result = AGS3::AudioChannel_GetLengthMs(channel);
+}
+
+void AudioChannel::GetPanning(ScriptMethodParams &params) {
+	PARAMS1(ScriptAudioChannel *, channel);
+	params._result = AGS3::AudioChannel_GetPanning(channel);
+}
+
+void AudioChannel::SetPanning(ScriptMethodParams &params) {
+	PARAMS2(ScriptAudioChannel *, channel, int, newPanning);
+	AGS3::AudioChannel_SetPanning(channel, newPanning);
+}
+
+void AudioChannel::GetPlayingClip(ScriptMethodParams &params) {
+	PARAMS1(ScriptAudioChannel *, channel);
+	params._result = AGS3::AudioChannel_GetPlayingClip(channel);
+}
+
+void AudioChannel::GetPosition(ScriptMethodParams &params) {
+	PARAMS1(ScriptAudioChannel *, channel);
+	params._result = AGS3::AudioChannel_GetPosition(channel);
+}
+
+void AudioChannel::GetPositionMs(ScriptMethodParams &params) {
+	PARAMS1(ScriptAudioChannel *, channel);
+	params._result = AGS3::AudioChannel_GetPositionMs(channel);
+}
+
+void AudioChannel::GetVolume(ScriptMethodParams &params) {
+	PARAMS1(ScriptAudioChannel *, channel);
+	params._result = AGS3::AudioChannel_GetVolume(channel);
+}
+
+void AudioChannel::SetVolume(ScriptMethodParams &params) {
+	PARAMS2(ScriptAudioChannel *, channel, int, newVolume);
+	params._result = AGS3::AudioChannel_SetVolume(channel, newVolume);
+}
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/core/audio_channel.h b/engines/ags/plugins/core/audio_channel.h
new file mode 100644
index 0000000000..175989eadd
--- /dev/null
+++ b/engines/ags/plugins/core/audio_channel.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef AGS_PLUGINS_CORE_AUDIO_CHANNEL_H
+#define AGS_PLUGINS_CORE_AUDIO_CHANNEL_H
+
+#include "ags/plugins/plugin_base.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+class AudioChannel : public ScriptContainer {
+public:
+	static void AGS_EngineStartup(IAGSEngine *engine);
+
+	static void Seek(ScriptMethodParams &params);
+	static void SetRoomLocation(ScriptMethodParams &params);
+	static void Stop(ScriptMethodParams &params);
+	static void GetID(ScriptMethodParams &params);
+	static void GetIsPlaying(ScriptMethodParams &params);
+	static void GetLengthMs(ScriptMethodParams &params);
+	static void GetPanning(ScriptMethodParams &params);
+	static void SetPanning(ScriptMethodParams &params);
+	static void GetPlayingClip(ScriptMethodParams &params);
+	static void GetPosition(ScriptMethodParams &params);
+	static void GetPositionMs(ScriptMethodParams &params);
+	static void GetVolume(ScriptMethodParams &params);
+	static void SetVolume(ScriptMethodParams &params);
+};
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
+
+#endif
diff --git a/engines/ags/plugins/core/audio_clip.cpp b/engines/ags/plugins/core/audio_clip.cpp
new file mode 100644
index 0000000000..a522119a1b
--- /dev/null
+++ b/engines/ags/plugins/core/audio_clip.cpp
@@ -0,0 +1,77 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ags/plugins/core/audio_clip.h"
+#include "ags/engine/ac/audio_clip.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+void AudioClip::AGS_EngineStartup(IAGSEngine *engine) {
+	SCRIPT_METHOD_EXT(AudioClip::Play^2, Play);
+	SCRIPT_METHOD_EXT(AudioClip::PlayFrom^3, PlayFrom);
+	SCRIPT_METHOD_EXT(AudioClip::PlayQueued^2, PlayQueued);
+	SCRIPT_METHOD_EXT(AudioClip::Stop^0, Stop);
+	SCRIPT_METHOD_EXT(AudioClip::get_FileType, GetFileType);
+	SCRIPT_METHOD_EXT(AudioClip::get_IsAvailable, GetIsAvailable);
+	SCRIPT_METHOD_EXT(AudioClip::get_Type, GetType);
+}
+
+void AudioClip::Play(ScriptMethodParams &params) {
+	PARAMS3(ScriptAudioClip *, clip, int, priority, int, repeat);
+	params._result = AGS3::AudioClip_Play(clip, priority, repeat);
+}
+
+void AudioClip::PlayFrom(ScriptMethodParams &params) {
+	PARAMS4(ScriptAudioClip *, clip, int, position, int, priority, int, repeat);
+	params._result = AGS3::AudioClip_PlayFrom(clip, position, priority, repeat);
+}
+
+void AudioClip::PlayQueued(ScriptMethodParams &params) {
+	PARAMS3(ScriptAudioClip *, clip, int, priority, int, repeat);
+	params._result = AGS3::AudioClip_PlayQueued(clip, priority, repeat);
+}
+
+void AudioClip::Stop(ScriptMethodParams &params) {
+	PARAMS1(ScriptAudioClip *, clip);
+	AGS3::AudioClip_Stop(clip);
+}
+
+void AudioClip::GetFileType(ScriptMethodParams &params) {
+	PARAMS1(ScriptAudioClip *, clip);
+	params._result = AGS3::AudioClip_GetFileType(clip);
+}
+
+void AudioClip::GetIsAvailable(ScriptMethodParams &params) {
+	PARAMS1(ScriptAudioClip *, clip);
+	params._result = AGS3::AudioClip_GetIsAvailable(clip);
+}
+
+void AudioClip::GetType(ScriptMethodParams &params) {
+	PARAMS1(ScriptAudioClip *, clip);
+	params._result = AGS3::AudioClip_GetType(clip);
+}
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/core/audio_clip.h b/engines/ags/plugins/core/audio_clip.h
new file mode 100644
index 0000000000..133b748ec8
--- /dev/null
+++ b/engines/ags/plugins/core/audio_clip.h
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef AGS_PLUGINS_CORE_AUDIO_CLIP_H
+#define AGS_PLUGINS_CORE_AUDIO_CLIP_H
+
+#include "ags/plugins/plugin_base.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+class AudioClip : public ScriptContainer {
+public:
+	void AGS_EngineStartup(IAGSEngine *engine);
+
+	static void Play(ScriptMethodParams &params);
+	static void PlayFrom(ScriptMethodParams &params);
+	static void PlayQueued(ScriptMethodParams &params);
+	static void Stop(ScriptMethodParams &params);
+	static void GetFileType(ScriptMethodParams &params);
+	static void GetIsAvailable(ScriptMethodParams &params);
+	static void GetType(ScriptMethodParams &params);
+};
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
+
+#endif
diff --git a/engines/ags/plugins/core/button.cpp b/engines/ags/plugins/core/button.cpp
new file mode 100644
index 0000000000..6ed9f00b42
--- /dev/null
+++ b/engines/ags/plugins/core/button.cpp
@@ -0,0 +1,138 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ags/plugins/core/button.h"
+#include "ags/engine/ac/button.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+void Button::AGS_EngineStartup(IAGSEngine *engine) {
+	SCRIPT_METHOD_EXT(Button::Animate^4, Animate);
+	SCRIPT_METHOD_EXT(Button::GetText^1, GetText);
+	SCRIPT_METHOD_EXT(Button::SetText^1, SetText);
+	SCRIPT_METHOD_EXT(Button::get_ClipImage, GetClipImage);
+	SCRIPT_METHOD_EXT(Button::set_ClipImage, SetClipImage);
+	SCRIPT_METHOD_EXT(Button::get_Font, GetFont);
+	SCRIPT_METHOD_EXT(Button::set_Font, SetFont);
+	SCRIPT_METHOD_EXT(Button::get_Graphic, GetGraphic);
+	SCRIPT_METHOD_EXT(Button::get_MouseOverGraphic, GetMouseOverGraphic);
+	SCRIPT_METHOD_EXT(Button::set_MouseOverGraphic, SetMouseOverGraphic);
+	SCRIPT_METHOD_EXT(Button::get_NormalGraphic, GetNormalGraphic);
+	SCRIPT_METHOD_EXT(Button::set_NormalGraphic, SetNormalGraphic);
+	SCRIPT_METHOD_EXT(Button::get_PushedGraphic, GetPushedGraphic);
+	SCRIPT_METHOD_EXT(Button::set_PushedGraphic, SetPushedGraphic);
+	SCRIPT_METHOD_EXT(Button::get_Text, GetText_New);
+	SCRIPT_METHOD_EXT(Button::set_Text, SetText);
+	SCRIPT_METHOD_EXT(Button::get_TextColor, GetTextColor);
+	SCRIPT_METHOD_EXT(Button::set_TextColor, SetTextColor);
+}
+
+void Button::Animate(ScriptMethodParams &params) {
+	PARAMS5(GUIButton *, butt, int, view, int, loop, int, speed, int, repeat);
+	AGS3::Button_Animate(butt, view, loop, speed, repeat);
+}
+
+void Button::GetText(ScriptMethodParams &params) {
+	PARAMS2(GUIButton *, butt, char *, buffer);
+	AGS3::Button_GetText(butt, buffer);
+}
+
+void Button::SetText(ScriptMethodParams &params) {
+	PARAMS2(GUIButton *, butt, const char *, newtx);
+	AGS3::Button_SetText(butt, newtx);
+}
+
+void Button::GetClipImage(ScriptMethodParams &params) {
+	PARAMS1(GUIButton *, butt);
+	params._result = AGS3::Button_GetClipImage(butt);
+}
+
+void Button::SetClipImage(ScriptMethodParams &params) {
+	PARAMS2(GUIButton *, butt, int, newval);
+	AGS3::Button_SetClipImage(butt, newval);
+}
+
+void Button::GetFont(ScriptMethodParams &params) {
+	PARAMS1(GUIButton *, butt);
+	params._result = AGS3::Button_GetFont(butt);
+}
+
+void Button::SetFont(ScriptMethodParams &params) {
+	PARAMS2(GUIButton *, butt, int, newFont);
+	AGS3::Button_SetFont(butt, newFont);
+}
+
+void Button::GetGraphic(ScriptMethodParams &params) {
+	PARAMS1(GUIButton *, butt);
+	params._result = AGS3::Button_GetGraphic(butt);
+}
+
+void Button::GetMouseOverGraphic(ScriptMethodParams &params) {
+	PARAMS1(GUIButton *, butt);
+	params._result = AGS3::Button_GetMouseOverGraphic(butt);
+}
+
+void Button::SetMouseOverGraphic(ScriptMethodParams &params) {
+	PARAMS2(GUIButton *, guil, int, slotn);
+	AGS3::Button_SetMouseOverGraphic(guil, slotn);
+}
+
+void Button::GetNormalGraphic(ScriptMethodParams &params) {
+	PARAMS1(GUIButton *, butt);
+	params._result = AGS3::Button_GetNormalGraphic(butt);
+}
+
+void Button::SetNormalGraphic(ScriptMethodParams &params) {
+	PARAMS2(GUIButton *, guil, int, slotn);
+	AGS3::Button_SetNormalGraphic(guil, slotn);
+}
+
+void Button::GetPushedGraphic(ScriptMethodParams &params) {
+	PARAMS1(GUIButton *, butt);
+	params._result = AGS3::Button_GetPushedGraphic(butt);
+}
+
+void Button::SetPushedGraphic(ScriptMethodParams &params) {
+	PARAMS2(GUIButton *, guil, int, slotn);
+	AGS3::Button_SetPushedGraphic(guil, slotn);
+}
+
+void Button::GetText_New(ScriptMethodParams &params) {
+	PARAMS1(GUIButton *, butt);
+	params._result = AGS3::Button_GetText_New(butt);
+}
+
+void Button::GetTextColor(ScriptMethodParams &params) {
+	PARAMS1(GUIButton *, butt);
+	params._result = AGS3::Button_GetTextColor(butt);
+}
+
+void Button::SetTextColor(ScriptMethodParams &params) {
+	PARAMS2(GUIButton *, butt, int, newcol);
+	AGS3::Button_SetTextColor(butt, newcol);
+}
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/core/button.h b/engines/ags/plugins/core/button.h
new file mode 100644
index 0000000000..d8661ed17d
--- /dev/null
+++ b/engines/ags/plugins/core/button.h
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef AGS_PLUGINS_CORE_BUTTON_H
+#define AGS_PLUGINS_CORE_BUTTON_H
+
+#include "ags/plugins/plugin_base.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+class Button : public ScriptContainer {
+public:
+	void AGS_EngineStartup(IAGSEngine *engine);
+
+	static void Animate(ScriptMethodParams &params);
+	static void GetText(ScriptMethodParams &params);
+	static void SetText(ScriptMethodParams &params);
+	static void GetClipImage(ScriptMethodParams &params);
+	static void SetClipImage(ScriptMethodParams &params);
+	static void GetFont(ScriptMethodParams &params);
+	static void SetFont(ScriptMethodParams &params);
+	static void GetGraphic(ScriptMethodParams &params);
+	static void GetMouseOverGraphic(ScriptMethodParams &params);
+	static void SetMouseOverGraphic(ScriptMethodParams &params);
+	static void GetNormalGraphic(ScriptMethodParams &params);
+	static void SetNormalGraphic(ScriptMethodParams &params);
+	static void GetPushedGraphic(ScriptMethodParams &params);
+	static void SetPushedGraphic(ScriptMethodParams &params);
+	static void GetText_New(ScriptMethodParams &params);
+	static void GetTextColor(ScriptMethodParams &params);
+	static void SetTextColor(ScriptMethodParams &params);
+};
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
+
+#endif
diff --git a/engines/ags/plugins/core/character.cpp b/engines/ags/plugins/core/character.cpp
new file mode 100644
index 0000000000..3de93a6e90
--- /dev/null
+++ b/engines/ags/plugins/core/character.cpp
@@ -0,0 +1,801 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ags/plugins/core/character.h"
+#include "ags/engine/ac/character.h"
+#include "ags/engine/ac/global_character.h"
+#include "ags/shared/ac/game_struct_defines.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+void Character::AGS_EngineStartup(IAGSEngine *engine) {
+	SCRIPT_METHOD_EXT(Character::AddInventory^2, AddInventory);
+	SCRIPT_METHOD_EXT(Character::AddWaypoint^2, AddWaypoint);
+	SCRIPT_METHOD_EXT(Character::Animate^5, Animate);
+	SCRIPT_METHOD_EXT(Character::ChangeRoom^3, ChangeRoom);
+	SCRIPT_METHOD_EXT(Character::ChangeRoomAutoPosition^2, ChangeRoomAutoPosition);
+	SCRIPT_METHOD_EXT(Character::ChangeView^1, ChangeView);
+	SCRIPT_METHOD_EXT(Character::FaceCharacter^2, FaceCharacter);
+	SCRIPT_METHOD_EXT(Character::FaceDirection^2, FaceDirection);
+	SCRIPT_METHOD_EXT(Character::FaceLocation^3, FaceLocation);
+	SCRIPT_METHOD_EXT(Character::FaceObject^2, FaceObject);
+	SCRIPT_METHOD_EXT(Character::FollowCharacter^3, FollowCharacter);
+	SCRIPT_METHOD_EXT(Character::GetProperty^1, GetProperty);
+	SCRIPT_METHOD_EXT(Character::GetPropertyText^2, GetPropertyText);
+	SCRIPT_METHOD_EXT(Character::GetTextProperty^1, GetTextProperty);
+	SCRIPT_METHOD_EXT(Character::HasInventory^1, HasInventory);
+	SCRIPT_METHOD_EXT(Character::IsCollidingWithChar^1, IsCollidingWithChar);
+	SCRIPT_METHOD_EXT(Character::IsCollidingWithObject^1, IsCollidingWithObject);
+	SCRIPT_METHOD_EXT(Character::LockView^1, LockView);
+	SCRIPT_METHOD_EXT(Character::LockView^2, LockViewEx);
+	if (engine->version < kScriptAPI_v341) {
+		SCRIPT_METHOD_EXT(Character::LockViewAligned^3, LockViewAligned_Old);
+		SCRIPT_METHOD_EXT(Character::LockViewAligned^4, LockViewAlignedEx_Old);
+	} else {
+		SCRIPT_METHOD_EXT(Character::LockViewAligned^3, LockViewAligned);
+		SCRIPT_METHOD_EXT(Character::LockViewAligned^4, LockViewAlignedEx);
+	}
+	SCRIPT_METHOD_EXT(Character::LockViewFrame^3, LockViewFrame);
+	SCRIPT_METHOD_EXT(Character::LockViewFrame^4, LockViewFrameEx);
+	SCRIPT_METHOD_EXT(Character::LockViewOffset^3, LockViewOffset);
+	SCRIPT_METHOD_EXT(Character::LockViewOffset^4, LockViewOffset);
+	SCRIPT_METHOD_EXT(Character::LoseInventory^1, LoseInventory);
+	SCRIPT_METHOD_EXT(Character::Move^4, Move);
+	SCRIPT_METHOD_EXT(Character::PlaceOnWalkableArea^0, PlaceOnWalkableArea);
+	SCRIPT_METHOD_EXT(Character::RemoveTint^0, RemoveTint);
+	SCRIPT_METHOD_EXT(Character::RunInteraction^1, RunInteraction);
+	SCRIPT_METHOD_EXT(Character::Say^101, ScPl_Say);
+	SCRIPT_METHOD_EXT(Character::SayAt^4, SayAt);
+	SCRIPT_METHOD_EXT(Character::SayBackground^1, SayBackground);
+	SCRIPT_METHOD_EXT(Character::SetAsPlayer^0, SetAsPlayer);
+	SCRIPT_METHOD_EXT(Character::SetIdleView^2, SetIdleView);
+	//SCRIPT_METHOD_EXT(Character::SetOption^2",             (void*)SetOption);
+	SCRIPT_METHOD_EXT(Character::SetWalkSpeed^2, SetSpeed);
+	SCRIPT_METHOD_EXT(Character::StopMoving^0, StopMoving);
+	SCRIPT_METHOD_EXT(Character::Think^101, ScPl_Think);
+	SCRIPT_METHOD_EXT(Character::Tint^5, Tint);
+	SCRIPT_METHOD_EXT(Character::UnlockView^0, UnlockView);
+	SCRIPT_METHOD_EXT(Character::UnlockView^1, UnlockViewEx);
+	SCRIPT_METHOD_EXT(Character::Walk^4, Walk);
+	SCRIPT_METHOD_EXT(Character::WalkStraight^3, WalkStraight);
+	SCRIPT_METHOD_EXT(Character::GetAtRoomXY^2, GetCharacterAtRoom);
+	SCRIPT_METHOD_EXT(Character::GetAtScreenXY^2, GetCharacterAtScreen);
+	SCRIPT_METHOD_EXT(Character::get_ActiveInventory, GetActiveInventory);
+	SCRIPT_METHOD_EXT(Character::set_ActiveInventory, SetActiveInventory);
+	SCRIPT_METHOD_EXT(Character::get_Animating, GetAnimating);
+	SCRIPT_METHOD_EXT(Character::get_AnimationSpeed, GetAnimationSpeed);
+	SCRIPT_METHOD_EXT(Character::set_AnimationSpeed, SetAnimationSpeed);
+	SCRIPT_METHOD_EXT(Character::get_Baseline, GetBaseline);
+	SCRIPT_METHOD_EXT(Character::set_Baseline, SetBaseline);
+	SCRIPT_METHOD_EXT(Character::get_BlinkInterval, GetBlinkInterval);
+	SCRIPT_METHOD_EXT(Character::set_BlinkInterval, SetBlinkInterval);
+	SCRIPT_METHOD_EXT(Character::get_BlinkView, GetBlinkView);
+	SCRIPT_METHOD_EXT(Character::set_BlinkView, SetBlinkView);
+	SCRIPT_METHOD_EXT(Character::get_BlinkWhileThinking, GetBlinkWhileThinking);
+	SCRIPT_METHOD_EXT(Character::set_BlinkWhileThinking, SetBlinkWhileThinking);
+	SCRIPT_METHOD_EXT(Character::get_BlockingHeight, GetBlockingHeight);
+	SCRIPT_METHOD_EXT(Character::set_BlockingHeight, SetBlockingHeight);
+	SCRIPT_METHOD_EXT(Character::get_BlockingWidth, GetBlockingWidth);
+	SCRIPT_METHOD_EXT(Character::set_BlockingWidth, SetBlockingWidth);
+	SCRIPT_METHOD_EXT(Character::get_Clickable, GetClickable);
+	SCRIPT_METHOD_EXT(Character::set_Clickable, SetClickable);
+	SCRIPT_METHOD_EXT(Character::get_DestinationX, GetDestinationX);
+	SCRIPT_METHOD_EXT(Character::get_DestinationY, GetDestinationY);
+	SCRIPT_METHOD_EXT(Character::get_DiagonalLoops, GetDiagonalWalking);
+	SCRIPT_METHOD_EXT(Character::set_DiagonalLoops, SetDiagonalWalking);
+	SCRIPT_METHOD_EXT(Character::get_Frame, GetFrame);
+	SCRIPT_METHOD_EXT(Character::set_Frame, SetFrame);
+	if (engine->version < kScriptAPI_v341)
+		SCRIPT_METHOD_EXT(Character::get_HasExplicitTint, GetHasExplicitTint_Old);
+	else
+		SCRIPT_METHOD_EXT(Character::get_HasExplicitTint, GetHasExplicitTint);
+	SCRIPT_METHOD_EXT(Character::get_ID, GetID);
+	SCRIPT_METHOD_EXT(Character::get_IdleView, GetIdleView);
+	SCRIPT_METHOD_EXT(Character::geti_InventoryQuantity, GetIInventoryQuantity);
+	SCRIPT_METHOD_EXT(Character::seti_InventoryQuantity, SetIInventoryQuantity);
+	SCRIPT_METHOD_EXT(Character::get_IgnoreLighting, GetIgnoreLighting);
+	SCRIPT_METHOD_EXT(Character::set_IgnoreLighting, SetIgnoreLighting);
+	SCRIPT_METHOD_EXT(Character::get_IgnoreScaling, GetIgnoreScaling);
+	SCRIPT_METHOD_EXT(Character::set_IgnoreScaling, SetIgnoreScaling);
+	SCRIPT_METHOD_EXT(Character::get_IgnoreWalkbehinds, GetIgnoreWalkbehinds);
+	SCRIPT_METHOD_EXT(Character::set_IgnoreWalkbehinds, SetIgnoreWalkbehinds);
+	SCRIPT_METHOD_EXT(Character::get_Loop, GetLoop);
+	SCRIPT_METHOD_EXT(Character::set_Loop, SetLoop);
+	SCRIPT_METHOD_EXT(Character::get_ManualScaling, GetIgnoreScaling);
+	SCRIPT_METHOD_EXT(Character::set_ManualScaling, SetManualScaling);
+	SCRIPT_METHOD_EXT(Character::get_MovementLinkedToAnimation, GetMovementLinkedToAnimation);
+	SCRIPT_METHOD_EXT(Character::set_MovementLinkedToAnimation, SetMovementLinkedToAnimation);
+	SCRIPT_METHOD_EXT(Character::get_Moving, GetMoving);
+	SCRIPT_METHOD_EXT(Character::get_Name, GetName);
+	SCRIPT_METHOD_EXT(Character::set_Name, SetName);
+	SCRIPT_METHOD_EXT(Character::get_NormalView, GetNormalView);
+	SCRIPT_METHOD_EXT(Character::get_PreviousRoom, GetPreviousRoom);
+	SCRIPT_METHOD_EXT(Character::get_Room, GetRoom);
+	SCRIPT_METHOD_EXT(Character::get_ScaleMoveSpeed, GetScaleMoveSpeed);
+	SCRIPT_METHOD_EXT(Character::set_ScaleMoveSpeed, SetScaleMoveSpeed);
+	SCRIPT_METHOD_EXT(Character::get_ScaleVolume, GetScaleVolume);
+	SCRIPT_METHOD_EXT(Character::set_ScaleVolume, SetScaleVolume);
+	SCRIPT_METHOD_EXT(Character::get_Scaling, GetScaling);
+	SCRIPT_METHOD_EXT(Character::set_Scaling, SetScaling);
+	SCRIPT_METHOD_EXT(Character::get_Solid, GetSolid);
+	SCRIPT_METHOD_EXT(Character::set_Solid, SetSolid);
+	SCRIPT_METHOD_EXT(Character::get_Speaking, GetSpeaking);
+	SCRIPT_METHOD_EXT(Character::get_SpeakingFrame, GetSpeakingFrame);
+	SCRIPT_METHOD_EXT(Character::get_SpeechAnimationDelay, GetCharacterSpeechAnimationDelay);
+	SCRIPT_METHOD_EXT(Character::set_SpeechAnimationDelay, SetSpeechAnimationDelay);
+	SCRIPT_METHOD_EXT(Character::get_SpeechColor, GetSpeechColor);
+	SCRIPT_METHOD_EXT(Character::set_SpeechColor, SetSpeechColor);
+	SCRIPT_METHOD_EXT(Character::get_SpeechView, GetSpeechView);
+	SCRIPT_METHOD_EXT(Character::set_SpeechView, SetSpeechView);
+	SCRIPT_METHOD_EXT(Character::get_ThinkView, GetThinkView);
+	SCRIPT_METHOD_EXT(Character::set_ThinkView, SetThinkView);
+	SCRIPT_METHOD_EXT(Character::get_Transparency, GetTransparency);
+	SCRIPT_METHOD_EXT(Character::set_Transparency, SetTransparency);
+	SCRIPT_METHOD_EXT(Character::get_TurnBeforeWalking, GetTurnBeforeWalking);
+	SCRIPT_METHOD_EXT(Character::set_TurnBeforeWalking, SetTurnBeforeWalking);
+	SCRIPT_METHOD_EXT(Character::get_View, GetView);
+	SCRIPT_METHOD_EXT(Character::get_WalkSpeedX, GetWalkSpeedX);
+	SCRIPT_METHOD_EXT(Character::get_WalkSpeedY, GetWalkSpeedY);
+	SCRIPT_METHOD_EXT(Character::get_X, GetX);
+	SCRIPT_METHOD_EXT(Character::set_X, SetX);
+	SCRIPT_METHOD_EXT(Character::get_x, GetX);
+	SCRIPT_METHOD_EXT(Character::set_x, SetX);
+	SCRIPT_METHOD_EXT(Character::get_Y, GetY);
+	SCRIPT_METHOD_EXT(Character::set_Y, SetY);
+	SCRIPT_METHOD_EXT(Character::get_y, GetY);
+	SCRIPT_METHOD_EXT(Character::set_y, SetY);
+	SCRIPT_METHOD_EXT(Character::get_Z, GetZ);
+	SCRIPT_METHOD_EXT(Character::set_Z, SetZ);
+	SCRIPT_METHOD_EXT(Character::get_z, GetZ);
+	SCRIPT_METHOD_EXT(Character::set_z, SetZ);
+}
+
+void Character::AddInventory(ScriptMethodParams &params) {
+	PARAMS3(CharacterInfo *, chaa, ScriptInvItem *, invi, int, addIndex);
+	AGS3::Character_AddInventory(chaa, invi, addIndex);
+}
+
+void Character::AddWaypoint(ScriptMethodParams &params) {
+	PARAMS3(CharacterInfo *, chaa, int, x, int, y);
+	AGS3::Character_AddWaypoint(chaa, x, y);
+}
+
+void Character::Animate(ScriptMethodParams &params) {
+	PARAMS6(CharacterInfo *, chaa, int, loop, int, delay, int, repeat, int, blocking, int, direction);
+	AGS3::Character_Animate(chaa, loop, delay, repeat, blocking, direction);
+}
+
+void Character::ChangeRoom(ScriptMethodParams &params) {
+	PARAMS4(CharacterInfo *, chaa, int, room, int, x, int, y);
+	AGS3::Character_ChangeRoom(chaa, room, x, y);
+}
+
+void Character::ChangeRoomAutoPosition(ScriptMethodParams &params) {
+	PARAMS3(CharacterInfo *, chaa, int, room, int, newPos);
+	AGS3::Character_ChangeRoomAutoPosition(chaa, room, newPos);
+}
+
+void Character::ChangeView(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chap, int, vii);
+	AGS3::Character_ChangeView(chap, vii);
+}
+
+void Character::FaceCharacter(ScriptMethodParams &params) {
+	PARAMS3(CharacterInfo *, char1, CharacterInfo *, char2, int, blockingStyle);
+	AGS3::Character_FaceCharacter(char1, char2, blockingStyle);
+}
+
+void Character::FaceDirection(ScriptMethodParams &params) {
+	PARAMS3(CharacterInfo *, char1, int, direction, int, blockingStyle);
+	AGS3::Character_FaceDirection(char1, direction, blockingStyle);
+}
+
+void Character::FaceLocation(ScriptMethodParams &params) {
+	PARAMS4(CharacterInfo *, char1, int, xx, int, yy, int, blockingStyle);
+	AGS3::Character_FaceLocation(char1, xx, yy, blockingStyle);
+}
+
+void Character::FaceObject(ScriptMethodParams &params) {
+	PARAMS3(CharacterInfo *, char1, ScriptObject *, obj, int, blockingStyle);
+	AGS3::Character_FaceObject(char1, obj, blockingStyle);
+}
+
+void Character::FollowCharacter(ScriptMethodParams &params) {
+	PARAMS4(CharacterInfo *, chaa, CharacterInfo *, tofollow, int, distaway, int, eagerness);
+	AGS3::Character_FollowCharacter(chaa, tofollow, distaway, eagerness);
+}
+
+void Character::GetProperty(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, const char *, property);
+	params._result = AGS3::Character_GetProperty(chaa, property);
+}
+
+void Character::GetPropertyText(ScriptMethodParams &params) {
+	PARAMS3(CharacterInfo *, chaa, const char *, property, char *, buffer);
+	AGS3::Character_GetPropertyText(chaa, property, buffer);
+}
+
+void Character::GetTextProperty(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, const char *, property);
+	params._result = AGS3::Character_GetTextProperty(chaa, property);
+}
+
+void Character::HasInventory(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, ScriptInvItem *, invi);
+	params._result = AGS3::Character_HasInventory(chaa, invi);
+}
+
+void Character::IsCollidingWithChar(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, char1, CharacterInfo *, char2);
+	params._result = AGS3::Character_IsCollidingWithChar(char1, char2);
+}
+
+void Character::IsCollidingWithObject(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chin, ScriptObject *, objid);
+	params._result = AGS3::Character_IsCollidingWithObject(chin, objid);
+}
+
+void Character::LockView(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chap, int, vii);
+	AGS3::Character_LockView(chap, vii);
+}
+
+void Character::LockViewEx(ScriptMethodParams &params) {
+	PARAMS3(CharacterInfo *, chap, int, vii, int, stopMoving);
+	AGS3::Character_LockViewEx(chap, vii, stopMoving);
+}
+
+void Character::LockViewAligned_Old(ScriptMethodParams &params) {
+	PARAMS4(CharacterInfo *, chap, int, vii, int, loop, int, align);
+	AGS3::Character_LockViewAligned_Old(chap, vii, loop, align);
+}
+
+void Character::LockViewAlignedEx_Old(ScriptMethodParams &params) {
+	PARAMS5(CharacterInfo *, chap, int, vii, int, loop, int, align, int, stopMoving);
+	AGS3::Character_LockViewAlignedEx_Old(chap, vii, loop, align, stopMoving);
+}
+
+void Character::LockViewAligned(ScriptMethodParams &params) {
+	PARAMS4(CharacterInfo *, chap, int, vii, int, loop, int, align);
+	AGS3::Character_LockViewAligned(chap, vii, loop, align);
+}
+
+void Character::LockViewAlignedEx(ScriptMethodParams &params) {
+	PARAMS5(CharacterInfo *, chap, int, vii, int, loop, int, align, int, stopMoving);
+	AGS3::Character_LockViewAlignedEx(chap, vii, loop, align, stopMoving);
+}
+
+void Character::LockViewFrame(ScriptMethodParams &params) {
+	PARAMS4(CharacterInfo *, chaa, int, view, int, loop, int, frame);
+	AGS3::Character_LockViewFrame(chaa, view, loop, frame);
+}
+
+void Character::LockViewFrameEx(ScriptMethodParams &params) {
+	PARAMS5(CharacterInfo *, chaa, int, view, int, loop, int, frame, int, stopMoving);
+	AGS3::Character_LockViewFrameEx(chaa, view, loop, frame, stopMoving);
+}
+
+void Character::LockViewOffset(ScriptMethodParams &params) {
+	PARAMS4(CharacterInfo *, chap, int, vii, int, xoffs, int, yoffs);
+	AGS3::Character_LockViewOffset(chap, vii, xoffs, yoffs);
+}
+
+void Character::LoseInventory(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chap, ScriptInvItem *, invi);
+	AGS3::Character_LoseInventory(chap, invi);
+}
+
+void Character::Move(ScriptMethodParams &params) {
+	PARAMS5(CharacterInfo *, chaa, int, x, int, y, int, blocking, int, direct);
+	AGS3::Character_Move(chaa, x, y, blocking, direct);
+}
+
+void Character::PlaceOnWalkableArea(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chap);
+	AGS3::Character_PlaceOnWalkableArea(chap);
+}
+
+void Character::RemoveTint(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	AGS3::Character_RemoveTint(chaa);
+}
+
+void Character::RunInteraction(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, mood);
+	AGS3::Character_RunInteraction(chaa, mood);
+}
+
+void Character::ScPl_Say(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	Common::String texx = params.format(1);
+	AGS3::Character_Say(chaa, texx.c_str());
+}
+
+void Character::SayAt(ScriptMethodParams &params) {
+	PARAMS5(CharacterInfo *, chaa, int, x, int, y, int, width, const char *, texx);
+	AGS3::Character_SayAt(chaa, x, y, width, texx);
+}
+
+void Character::SayBackground(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, const char *, texx);
+	params._result = AGS3::Character_SayBackground(chaa, texx);
+}
+
+void Character::SetAsPlayer(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	AGS3::Character_SetAsPlayer(chaa);
+}
+
+void Character::SetIdleView(ScriptMethodParams &params) {
+	PARAMS3(CharacterInfo *, chaa, int, iview, int, itime);
+	AGS3::Character_SetIdleView(chaa, iview, itime);
+}
+
+void Character::SetSpeed(ScriptMethodParams &params) {
+	PARAMS3(CharacterInfo *, chaa, int, xspeed, int, yspeed);
+	AGS3::Character_SetSpeed(chaa, xspeed, yspeed);
+}
+
+void Character::StopMoving(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, charp);
+	AGS3::Character_StopMoving(charp);
+}
+
+void Character::ScPl_Think(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	Common::String texx = params.format(1);
+	AGS3::Character_Think(chaa, texx.c_str());
+}
+
+void Character::Tint(ScriptMethodParams &params) {
+	PARAMS6(CharacterInfo *, chaa, int, red, int, green, int, blue, int, opacity, int, luminance);
+	AGS3::Character_Tint(chaa, red, green, blue, opacity, luminance);
+}
+
+void Character::UnlockView(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	AGS3::Character_UnlockView(chaa);
+}
+
+void Character::UnlockViewEx(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, stopMoving);
+	AGS3::Character_UnlockViewEx(chaa, stopMoving);
+}
+
+void Character::Walk(ScriptMethodParams &params) {
+	PARAMS5(CharacterInfo *, chaa, int, x, int, y, int, blocking, int, direct);
+	AGS3::Character_Walk(chaa, x, y, blocking, direct);
+}
+
+void Character::WalkStraight(ScriptMethodParams &params) {
+	PARAMS4(CharacterInfo *, chaa, int, xx, int, yy, int, blocking);
+	AGS3::Character_WalkStraight(chaa, xx, yy, blocking);
+}
+
+void Character::GetCharacterAtRoom(ScriptMethodParams &params) {
+	PARAMS2(int, x, int, y);
+	params._result = AGS3::GetCharacterAtRoom(x, y);
+}
+
+void Character::GetCharacterAtScreen(ScriptMethodParams &params) {
+	PARAMS2(int, x, int, y);
+	params._result = AGS3::GetCharacterAtScreen(x, y);
+}
+
+void Character::GetActiveInventory(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetActiveInventory(chaa);
+}
+
+void Character::SetActiveInventory(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, ScriptInvItem *, iit);
+	AGS3::Character_SetActiveInventory(chaa, iit);
+}
+
+void Character::GetAnimating(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetAnimating(chaa);
+}
+
+void Character::GetAnimationSpeed(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetAnimationSpeed(chaa);
+}
+
+void Character::SetAnimationSpeed(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, newval);
+	AGS3::Character_SetAnimationSpeed(chaa, newval);
+}
+
+void Character::GetBaseline(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetBaseline(chaa);
+}
+
+void Character::SetBaseline(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, basel);
+	AGS3::Character_SetBaseline(chaa, basel);
+}
+
+void Character::GetBlinkInterval(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetBlinkInterval(chaa);
+}
+
+void Character::SetBlinkInterval(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, interval);
+	AGS3::Character_SetBlinkInterval(chaa, interval);
+}
+
+void Character::GetBlinkView(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetBlinkView(chaa);
+}
+
+void Character::SetBlinkView(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, vii);
+	AGS3::Character_SetBlinkView(chaa, vii);
+}
+
+void Character::GetBlinkWhileThinking(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetBlinkWhileThinking(chaa);
+}
+
+void Character::SetBlinkWhileThinking(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, yesOrNo);
+	AGS3::Character_SetBlinkWhileThinking(chaa, yesOrNo);
+}
+
+void Character::GetBlockingHeight(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetBlockingHeight(chaa);
+}
+
+void Character::SetBlockingHeight(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, hit);
+	AGS3::Character_SetBlockingHeight(chaa, hit);
+}
+
+void Character::GetBlockingWidth(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetBlockingWidth(chaa);
+}
+
+void Character::SetBlockingWidth(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, wid);
+	AGS3::Character_SetBlockingWidth(chaa, wid);
+}
+
+void Character::GetClickable(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetClickable(chaa);
+}
+
+void Character::SetClickable(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, clik);
+	AGS3::Character_SetClickable(chaa, clik);
+}
+
+void Character::GetDestinationX(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetDestinationX(chaa);
+}
+
+void Character::GetDestinationY(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetDestinationX(chaa);
+}
+
+void Character::GetDiagonalWalking(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetDiagonalWalking(chaa);
+}
+
+void Character::SetDiagonalWalking(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, yesOrNo);
+	AGS3::Character_SetDiagonalWalking(chaa, yesOrNo);
+}
+
+void Character::GetFrame(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetFrame(chaa);
+}
+
+void Character::SetFrame(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, newVal);
+	AGS3::Character_SetFrame(chaa, newVal);
+}
+
+void Character::GetHasExplicitTint_Old(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetHasExplicitTint_Old(chaa);
+}
+
+void Character::GetHasExplicitTint(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetHasExplicitTint(chaa);
+}
+
+void Character::GetID(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetID(chaa);
+}
+
+void Character::GetIdleView(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetIdleView(chaa);
+}
+
+void Character::GetIInventoryQuantity(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, index);
+	params._result = AGS3::Character_GetIInventoryQuantity(chaa, index);
+}
+
+void Character::SetIInventoryQuantity(ScriptMethodParams &params) {
+	PARAMS3(CharacterInfo *, chaa, int, index, int, quant);
+	AGS3::Character_SetIInventoryQuantity(chaa, index, quant);
+}
+
+void Character::GetIgnoreLighting(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetIgnoreLighting(chaa);
+}
+
+void Character::SetIgnoreLighting(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, yesOrNo);
+	AGS3::Character_SetIgnoreLighting(chaa, yesOrNo);
+}
+
+void Character::GetIgnoreScaling(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetIgnoreScaling(chaa);
+}
+
+void Character::SetIgnoreScaling(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, yesOrNo);
+	AGS3::Character_SetIgnoreScaling(chaa, yesOrNo);
+}
+
+void Character::GetIgnoreWalkbehinds(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetIgnoreWalkbehinds(chaa);
+}
+
+void Character::SetIgnoreWalkbehinds(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, yesOrNo);
+	AGS3::Character_SetIgnoreWalkbehinds(chaa, yesOrNo);
+}
+
+void Character::GetLoop(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetLoop(chaa);
+}
+
+void Character::SetLoop(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, newVal);
+	AGS3::Character_SetLoop(chaa, newVal);
+}
+
+void Character::SetManualScaling(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, yesOrNo);
+	AGS3::Character_SetManualScaling(chaa, yesOrNo);
+}
+
+void Character::GetMovementLinkedToAnimation(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetMovementLinkedToAnimation(chaa);
+}
+
+void Character::SetMovementLinkedToAnimation(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, yesOrNo);
+	AGS3::Character_SetMovementLinkedToAnimation(chaa, yesOrNo);
+}
+
+void Character::GetMoving(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetMoving(chaa);
+}
+
+void Character::GetName(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetName(chaa);
+}
+
+void Character::SetName(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, const char *, newName);
+	AGS3::Character_SetName(chaa, newName);
+}
+
+void Character::GetNormalView(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetNormalView(chaa);
+}
+
+void Character::GetPreviousRoom(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetPreviousRoom(chaa);
+}
+
+void Character::GetRoom(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetRoom(chaa);
+}
+
+void Character::GetScaleMoveSpeed(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetScaleMoveSpeed(chaa);
+}
+
+void Character::SetScaleMoveSpeed(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, yesOrNo);
+	AGS3::Character_SetScaleMoveSpeed(chaa, yesOrNo);
+}
+
+void Character::GetScaleVolume(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetScaleVolume(chaa);
+}
+
+void Character::SetScaleVolume(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, yesOrNo);
+	AGS3::Character_SetScaleVolume(chaa, yesOrNo);
+}
+
+void Character::GetScaling(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetScaling(chaa);
+}
+
+void Character::SetScaling(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, zoomLevel);
+	AGS3::Character_SetScaling(chaa, zoomLevel);
+}
+
+void Character::GetSolid(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetSolid(chaa);
+}
+
+void Character::SetSolid(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, yesOrNo);
+	AGS3::Character_SetSolid(chaa, yesOrNo);
+}
+
+void Character::GetSpeaking(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetSpeaking(chaa);
+}
+
+void Character::GetSpeakingFrame(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetSpeakingFrame(chaa);
+}
+
+void Character::GetCharacterSpeechAnimationDelay(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::GetCharacterSpeechAnimationDelay(chaa);
+}
+
+void Character::SetSpeechAnimationDelay(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, newDelay);
+	AGS3::Character_SetSpeechAnimationDelay(chaa, newDelay);
+}
+
+void Character::GetSpeechColor(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetSpeechColor(chaa);
+}
+
+void Character::SetSpeechColor(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, ncol);
+	AGS3::Character_SetSpeechColor(chaa, ncol);
+}
+
+void Character::GetSpeechView(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetSpeechView(chaa);
+}
+
+void Character::SetSpeechView(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, vii);
+	AGS3::Character_SetSpeechView(chaa, vii);
+}
+
+void Character::GetThinkView(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetThinkView(chaa);
+}
+
+void Character::SetThinkView(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, vii);
+	AGS3::Character_SetThinkView(chaa, vii);
+}
+
+void Character::GetTransparency(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetTransparency(chaa);
+}
+
+void Character::SetTransparency(ScriptMethodParams &params) {
+}
+
+void Character::GetTurnBeforeWalking(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetTurnBeforeWalking(chaa);
+}
+
+void Character::SetTurnBeforeWalking(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, yesOrNo);
+	AGS3::Character_SetTurnBeforeWalking(chaa, yesOrNo);
+}
+
+void Character::GetView(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetView(chaa);
+}
+
+void Character::GetWalkSpeedX(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetWalkSpeedX(chaa);
+}
+
+void Character::GetWalkSpeedY(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetWalkSpeedY(chaa);
+}
+
+void Character::GetX(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetX(chaa);
+}
+
+void Character::SetX(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, newVal);
+	AGS3::Character_SetX(chaa, newVal);
+}
+
+void Character::GetY(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetY(chaa);
+}
+
+void Character::SetY(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, newVal);
+	AGS3::Character_SetY(chaa, newVal);
+}
+
+void Character::GetZ(ScriptMethodParams &params) {
+	PARAMS1(CharacterInfo *, chaa);
+	params._result = AGS3::Character_GetZ(chaa);
+}
+
+void Character::SetZ(ScriptMethodParams &params) {
+	PARAMS2(CharacterInfo *, chaa, int, newVal);
+	AGS3::Character_SetZ(chaa, newVal);
+}
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/core/character.h b/engines/ags/plugins/core/character.h
new file mode 100644
index 0000000000..a56132f01a
--- /dev/null
+++ b/engines/ags/plugins/core/character.h
@@ -0,0 +1,167 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef AGS_PLUGINS_CORE_CHARACTER_H
+#define AGS_PLUGINS_CORE_CHARACTER_H
+
+#include "ags/plugins/plugin_base.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+class Character : public ScriptContainer {
+public:
+	void AGS_EngineStartup(IAGSEngine *engine);
+
+	static void AddInventory(ScriptMethodParams &params);
+	static void AddWaypoint(ScriptMethodParams &params);
+	static void Animate(ScriptMethodParams &params);
+	static void ChangeRoom(ScriptMethodParams &params);
+	static void ChangeRoomAutoPosition(ScriptMethodParams &params);
+	static void ChangeView(ScriptMethodParams &params);
+	static void FaceCharacter(ScriptMethodParams &params);
+	static void FaceDirection(ScriptMethodParams &params);
+	static void FaceLocation(ScriptMethodParams &params);
+	static void FaceObject(ScriptMethodParams &params);
+	static void FollowCharacter(ScriptMethodParams &params);
+	static void GetProperty(ScriptMethodParams &params);
+	static void GetPropertyText(ScriptMethodParams &params);
+	static void GetTextProperty(ScriptMethodParams &params);
+	static void HasInventory(ScriptMethodParams &params);
+	static void IsCollidingWithChar(ScriptMethodParams &params);
+	static void IsCollidingWithObject(ScriptMethodParams &params);
+	static void LockView(ScriptMethodParams &params);
+	static void LockViewEx(ScriptMethodParams &params);
+	static void LockViewAligned_Old(ScriptMethodParams &params);
+	static void LockViewAlignedEx_Old(ScriptMethodParams &params);
+	static void LockViewAligned(ScriptMethodParams &params);
+	static void LockViewAlignedEx(ScriptMethodParams &params);
+	static void LockViewFrame(ScriptMethodParams &params);
+	static void LockViewFrameEx(ScriptMethodParams &params);
+	static void LockViewOffset(ScriptMethodParams &params);
+	static void LoseInventory(ScriptMethodParams &params);
+	static void Move(ScriptMethodParams &params);
+	static void PlaceOnWalkableArea(ScriptMethodParams &params);
+	static void RemoveTint(ScriptMethodParams &params);
+	static void RunInteraction(ScriptMethodParams &params);
+	static void ScPl_Say(ScriptMethodParams &params);
+	static void SayAt(ScriptMethodParams &params);
+	static void SayBackground(ScriptMethodParams &params);
+	static void SetAsPlayer(ScriptMethodParams &params);
+	static void SetIdleView(ScriptMethodParams &params);
+	static void SetSpeed(ScriptMethodParams &params);
+	static void StopMoving(ScriptMethodParams &params);
+	static void ScPl_Think(ScriptMethodParams &params);
+	static void Tint(ScriptMethodParams &params);
+	static void UnlockView(ScriptMethodParams &params);
+	static void UnlockViewEx(ScriptMethodParams &params);
+	static void Walk(ScriptMethodParams &params);
+	static void WalkStraight(ScriptMethodParams &params);
+	static void GetCharacterAtRoom(ScriptMethodParams &params);
+	static void GetCharacterAtScreen(ScriptMethodParams &params);
+	static void GetActiveInventory(ScriptMethodParams &params);
+	static void SetActiveInventory(ScriptMethodParams &params);
+	static void GetAnimating(ScriptMethodParams &params);
+	static void GetAnimationSpeed(ScriptMethodParams &params);
+	static void SetAnimationSpeed(ScriptMethodParams &params);
+	static void GetBaseline(ScriptMethodParams &params);
+	static void SetBaseline(ScriptMethodParams &params);
+	static void GetBlinkInterval(ScriptMethodParams &params);
+	static void SetBlinkInterval(ScriptMethodParams &params);
+	static void GetBlinkView(ScriptMethodParams &params);
+	static void SetBlinkView(ScriptMethodParams &params);
+	static void GetBlinkWhileThinking(ScriptMethodParams &params);
+	static void SetBlinkWhileThinking(ScriptMethodParams &params);
+	static void GetBlockingHeight(ScriptMethodParams &params);
+	static void SetBlockingHeight(ScriptMethodParams &params);
+	static void GetBlockingWidth(ScriptMethodParams &params);
+	static void SetBlockingWidth(ScriptMethodParams &params);
+	static void GetClickable(ScriptMethodParams &params);
+	static void SetClickable(ScriptMethodParams &params);
+	static void GetDestinationX(ScriptMethodParams &params);
+	static void GetDestinationY(ScriptMethodParams &params);
+	static void GetDiagonalWalking(ScriptMethodParams &params);
+	static void SetDiagonalWalking(ScriptMethodParams &params);
+	static void GetFrame(ScriptMethodParams &params);
+	static void SetFrame(ScriptMethodParams &params);
+	static void GetHasExplicitTint_Old(ScriptMethodParams &params);
+	static void GetHasExplicitTint(ScriptMethodParams &params);
+	static void GetID(ScriptMethodParams &params);
+	static void GetIdleView(ScriptMethodParams &params);
+	static void GetIInventoryQuantity(ScriptMethodParams &params);
+	static void SetIInventoryQuantity(ScriptMethodParams &params);
+	static void GetIgnoreLighting(ScriptMethodParams &params);
+	static void SetIgnoreLighting(ScriptMethodParams &params);
+	static void GetIgnoreScaling(ScriptMethodParams &params);
+	static void SetIgnoreScaling(ScriptMethodParams &params);
+	static void GetIgnoreWalkbehinds(ScriptMethodParams &params);
+	static void SetIgnoreWalkbehinds(ScriptMethodParams &params);
+	static void GetLoop(ScriptMethodParams &params);
+	static void SetLoop(ScriptMethodParams &params);
+	static void SetManualScaling(ScriptMethodParams &params);
+	static void GetMovementLinkedToAnimation(ScriptMethodParams &params);
+	static void SetMovementLinkedToAnimation(ScriptMethodParams &params);
+	static void GetMoving(ScriptMethodParams &params);
+	static void GetName(ScriptMethodParams &params);
+	static void SetName(ScriptMethodParams &params);
+	static void GetNormalView(ScriptMethodParams &params);
+	static void GetPreviousRoom(ScriptMethodParams &params);
+	static void GetRoom(ScriptMethodParams &params);
+	static void GetScaleMoveSpeed(ScriptMethodParams &params);
+	static void SetScaleMoveSpeed(ScriptMethodParams &params);
+	static void GetScaleVolume(ScriptMethodParams &params);
+	static void SetScaleVolume(ScriptMethodParams &params);
+	static void GetScaling(ScriptMethodParams &params);
+	static void SetScaling(ScriptMethodParams &params);
+	static void GetSolid(ScriptMethodParams &params);
+	static void SetSolid(ScriptMethodParams &params);
+	static void GetSpeaking(ScriptMethodParams &params);
+	static void GetSpeakingFrame(ScriptMethodParams &params);
+	static void GetCharacterSpeechAnimationDelay(ScriptMethodParams &params);
+	static void SetSpeechAnimationDelay(ScriptMethodParams &params);
+	static void GetSpeechColor(ScriptMethodParams &params);
+	static void SetSpeechColor(ScriptMethodParams &params);
+	static void GetSpeechView(ScriptMethodParams &params);
+	static void SetSpeechView(ScriptMethodParams &params);
+	static void GetThinkView(ScriptMethodParams &params);
+	static void SetThinkView(ScriptMethodParams &params);
+	static void GetTransparency(ScriptMethodParams &params);
+	static void SetTransparency(ScriptMethodParams &params);
+	static void GetTurnBeforeWalking(ScriptMethodParams &params);
+	static void SetTurnBeforeWalking(ScriptMethodParams &params);
+	static void GetView(ScriptMethodParams &params);
+	static void GetWalkSpeedX(ScriptMethodParams &params);
+	static void GetWalkSpeedY(ScriptMethodParams &params);
+	static void GetX(ScriptMethodParams &params);
+	static void SetX(ScriptMethodParams &params);
+	static void GetY(ScriptMethodParams &params);
+	static void SetY(ScriptMethodParams &params);
+	static void GetZ(ScriptMethodParams &params);
+	static void SetZ(ScriptMethodParams &params);
+};
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
+
+#endif
diff --git a/engines/ags/plugins/core/core.cpp b/engines/ags/plugins/core/core.cpp
index 6f5d26cdf4..d3cd116cb0 100644
--- a/engines/ags/plugins/core/core.cpp
+++ b/engines/ags/plugins/core/core.cpp
@@ -27,7 +27,15 @@ namespace Plugins {
 namespace Core {
 
 void EngineExports::AGS_EngineStartup(IAGSEngine *engine) {
+	_audioChannel.AGS_EngineStartup(engine);
+	_audioClip.AGS_EngineStartup(engine);
+	_button.AGS_EngineStartup(engine);
+	_character.AGS_EngineStartup(engine);
+	_dateTime.AGS_EngineStartup(engine);
+	_dialog.AGS_EngineStartup(engine);
+	_dialogOptionsRenderingInfo.AGS_EngineStartup(engine);
 	_drawingSurface.AGS_EngineStartup(engine);
+	_dynamicSprite.AGS_EngineStartup(engine);
 }
 
 } // namespace Core
diff --git a/engines/ags/plugins/core/core.h b/engines/ags/plugins/core/core.h
index 72fc9661d8..86811e540f 100644
--- a/engines/ags/plugins/core/core.h
+++ b/engines/ags/plugins/core/core.h
@@ -23,7 +23,15 @@
 #ifndef AGS_PLUGINS_CORE_CORE_H
 #define AGS_PLUGINS_CORE_CORE_H
 
+#include "ags/plugins/core/audio_channel.h"
+#include "ags/plugins/core/audio_clip.h"
+#include "ags/plugins/core/button.h"
+#include "ags/plugins/core/character.h"
+#include "ags/plugins/core/date_time.h"
+#include "ags/plugins/core/dialog.h"
+#include "ags/plugins/core/dialog_options_rendering_info.h"
 #include "ags/plugins/core/drawing_surface.h"
+#include "ags/plugins/core/dynamic_sprite.h"
 
 namespace AGS3 {
 namespace Plugins {
@@ -31,7 +39,15 @@ namespace Core {
 
 class EngineExports {
 private:
+	AudioChannel _audioChannel;
+	AudioClip _audioClip;
+	Button _button;
+	Character _character;
+	DateTime _dateTime;
+	Dialog _dialog;
+	DialogOptionsRenderingInfo _dialogOptionsRenderingInfo;
 	DrawingSurface _drawingSurface;
+	DynamicSprite _dynamicSprite;
 
 public:
 	void AGS_EngineStartup(IAGSEngine *engine);
diff --git a/engines/ags/plugins/core/date_time.cpp b/engines/ags/plugins/core/date_time.cpp
new file mode 100644
index 0000000000..0a39518ddb
--- /dev/null
+++ b/engines/ags/plugins/core/date_time.cpp
@@ -0,0 +1,82 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ags/plugins/core/date_time.h"
+#include "ags/engine/ac/date_time.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+void DateTime::AGS_EngineStartup(IAGSEngine *engine) {
+	SCRIPT_METHOD_EXT(DateTime::get_Now, Now);
+	SCRIPT_METHOD_EXT(DateTime::get_DayOfMonth, GetDayOfMonth);
+	SCRIPT_METHOD_EXT(DateTime::get_Hour, GetHour);
+	SCRIPT_METHOD_EXT(DateTime::get_Minute, GetMinute);
+	SCRIPT_METHOD_EXT(DateTime::get_Month, GetMonth);
+	SCRIPT_METHOD_EXT(DateTime::get_RawTime, GetRawTime);
+	SCRIPT_METHOD_EXT(DateTime::get_Second, GetSecond);
+	SCRIPT_METHOD_EXT(DateTime::get_Year, GetYear);
+}
+
+void DateTime::Now(ScriptMethodParams &params) {
+	params._result = AGS3::DateTime_Now();
+}
+
+void DateTime::GetDayOfMonth(ScriptMethodParams &params) {
+	PARAMS1(ScriptDateTime *, sdt);
+	params._result = AGS3::DateTime_GetDayOfMonth(sdt);
+}
+
+void DateTime::GetHour(ScriptMethodParams &params) {
+	PARAMS1(ScriptDateTime *, sdt);
+	params._result = AGS3::DateTime_GetHour(sdt);
+}
+
+void DateTime::GetMinute(ScriptMethodParams &params) {
+	PARAMS1(ScriptDateTime *, sdt);
+	params._result = AGS3::DateTime_GetMinute(sdt);
+}
+
+void DateTime::GetMonth(ScriptMethodParams &params) {
+	PARAMS1(ScriptDateTime *, sdt);
+	params._result = AGS3::DateTime_GetMonth(sdt);
+}
+
+void DateTime::GetRawTime(ScriptMethodParams &params) {
+	PARAMS1(ScriptDateTime *, sdt);
+	params._result = AGS3::DateTime_GetRawTime(sdt);
+}
+
+void DateTime::GetSecond(ScriptMethodParams &params) {
+	PARAMS1(ScriptDateTime *, sdt);
+	params._result = AGS3::DateTime_GetSecond(sdt);
+}
+
+void DateTime::GetYear(ScriptMethodParams &params) {
+	PARAMS1(ScriptDateTime *, sdt);
+	params._result = AGS3::DateTime_GetYear(sdt);
+}
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/core/date_time.h b/engines/ags/plugins/core/date_time.h
new file mode 100644
index 0000000000..4904591edb
--- /dev/null
+++ b/engines/ags/plugins/core/date_time.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef AGS_PLUGINS_CORE_DATE_TIME_H
+#define AGS_PLUGINS_CORE_DATE_TIME_H
+
+#include "ags/plugins/plugin_base.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+class DateTime : public ScriptContainer {
+public:
+	void AGS_EngineStartup(IAGSEngine *engine);
+
+	static void Now(ScriptMethodParams &params);
+	static void GetDayOfMonth(ScriptMethodParams &params);
+	static void GetHour(ScriptMethodParams &params);
+	static void GetMinute(ScriptMethodParams &params);
+	static void GetMonth(ScriptMethodParams &params);
+	static void GetRawTime(ScriptMethodParams &params);
+	static void GetSecond(ScriptMethodParams &params);
+	static void GetYear(ScriptMethodParams &params);
+};
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
+
+#endif
diff --git a/engines/ags/plugins/core/dialog.cpp b/engines/ags/plugins/core/dialog.cpp
new file mode 100644
index 0000000000..1a9d50e52d
--- /dev/null
+++ b/engines/ags/plugins/core/dialog.cpp
@@ -0,0 +1,89 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ags/plugins/core/dialog.h"
+#include "ags/engine/ac/dialog.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+void Dialog::AGS_EngineStartup(IAGSEngine *engine) {
+	SCRIPT_METHOD_EXT(Dialog::get_ID, GetID);
+	SCRIPT_METHOD_EXT(Dialog::get_OptionCount, GetOptionCount);
+	SCRIPT_METHOD_EXT(Dialog::get_ShowTextParser, GetShowTextParser);
+	SCRIPT_METHOD_EXT(Dialog::DisplayOptions^1, DisplayOptions);
+	SCRIPT_METHOD_EXT(Dialog::GetOptionState^1, GetOptionState);
+	SCRIPT_METHOD_EXT(Dialog::GetOptionText^1, GetOptionText);
+	SCRIPT_METHOD_EXT(Dialog::HasOptionBeenChosen^1, HasOptionBeenChosen);
+	SCRIPT_METHOD_EXT(Dialog::SetOptionState^2, SetOptionState);
+	SCRIPT_METHOD_EXT(Dialog::Start^0, Start);
+}
+
+void Dialog::GetID(ScriptMethodParams &params) {
+	PARAMS1(ScriptDialog *, sd);
+	params._result = AGS3::Dialog_GetID(sd);
+}
+
+void Dialog::GetOptionCount(ScriptMethodParams &params) {
+	PARAMS1(ScriptDialog *, sd);
+	params._result = AGS3::Dialog_GetOptionCount(sd);
+}
+
+void Dialog::GetShowTextParser(ScriptMethodParams &params) {
+	PARAMS1(ScriptDialog *, sd);
+	params._result = AGS3::Dialog_GetShowTextParser(sd);
+}
+
+void Dialog::DisplayOptions(ScriptMethodParams &params) {
+	PARAMS2(ScriptDialog *, sd, int, sayChosenOption);
+	params._result = AGS3::Dialog_DisplayOptions(sd, sayChosenOption);
+}
+
+void Dialog::GetOptionState(ScriptMethodParams &params) {
+	PARAMS2(ScriptDialog *, sd, int, option);
+	params._result = AGS3::Dialog_GetOptionState(sd, option);
+}
+
+void Dialog::GetOptionText(ScriptMethodParams &params) {
+	PARAMS2(ScriptDialog *, sd, int, option);
+	params._result = AGS3::Dialog_GetOptionText(sd, option);
+}
+
+void Dialog::HasOptionBeenChosen(ScriptMethodParams &params) {
+	PARAMS2(ScriptDialog *, sd, int, option);
+	params._result = AGS3::Dialog_HasOptionBeenChosen(sd, option);
+}
+
+void Dialog::SetOptionState(ScriptMethodParams &params) {
+	PARAMS3(ScriptDialog *, sd, int, option, int, newState);
+	AGS3::Dialog_SetOptionState(sd, option, newState);
+}
+
+void Dialog::Start(ScriptMethodParams &params) {
+	PARAMS1(ScriptDialog *, sd);
+	AGS3::Dialog_Start(sd);
+}
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/core/dialog.h b/engines/ags/plugins/core/dialog.h
new file mode 100644
index 0000000000..f8dab558f7
--- /dev/null
+++ b/engines/ags/plugins/core/dialog.h
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef AGS_PLUGINS_CORE_DIALOG_H
+#define AGS_PLUGINS_CORE_DIALOG_H
+
+#include "ags/plugins/plugin_base.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+class Dialog : public ScriptContainer {
+public:
+	static void AGS_EngineStartup(IAGSEngine *engine);
+
+	static void GetID(ScriptMethodParams &params);
+	static void GetOptionCount(ScriptMethodParams &params);
+	static void GetShowTextParser(ScriptMethodParams &params);
+	static void DisplayOptions(ScriptMethodParams &params);
+	static void GetOptionState(ScriptMethodParams &params);
+	static void GetOptionText(ScriptMethodParams &params);
+	static void HasOptionBeenChosen(ScriptMethodParams &params);
+	static void SetOptionState(ScriptMethodParams &params);
+	static void Start(ScriptMethodParams &params);
+};
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
+
+#endif
diff --git a/engines/ags/plugins/core/dialog_options_rendering_info.cpp b/engines/ags/plugins/core/dialog_options_rendering_info.cpp
new file mode 100644
index 0000000000..ffaa544461
--- /dev/null
+++ b/engines/ags/plugins/core/dialog_options_rendering_info.cpp
@@ -0,0 +1,143 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ags/plugins/core/dialog_options_rendering_info.h"
+#include "ags/engine/ac/dialog_options_rendering.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+void DialogOptionsRenderingInfo::AGS_EngineStartup(IAGSEngine *engine) {
+	SCRIPT_METHOD_EXT(DialogOptionsRenderingInfo::get_ActiveOptionID, GetActiveOptionID);
+	SCRIPT_METHOD_EXT(DialogOptionsRenderingInfo::set_ActiveOptionID, SetActiveOptionID);
+	SCRIPT_METHOD_EXT(DialogOptionsRenderingInfo::get_DialogToRender, GetDialogToRender);
+	SCRIPT_METHOD_EXT(DialogOptionsRenderingInfo::get_Height, GetHeight);
+	SCRIPT_METHOD_EXT(DialogOptionsRenderingInfo::set_Height, SetHeight);
+	SCRIPT_METHOD_EXT(DialogOptionsRenderingInfo::get_ParserTextBoxX, GetParserTextboxX);
+	SCRIPT_METHOD_EXT(DialogOptionsRenderingInfo::set_ParserTextBoxX, SetParserTextboxX);
+	SCRIPT_METHOD_EXT(DialogOptionsRenderingInfo::get_ParserTextBoxY, GetParserTextboxY);
+	SCRIPT_METHOD_EXT(DialogOptionsRenderingInfo::set_ParserTextBoxY, SetParserTextboxY);
+	SCRIPT_METHOD_EXT(DialogOptionsRenderingInfo::get_ParserTextBoxWidth, GetParserTextboxWidth);
+	SCRIPT_METHOD_EXT(DialogOptionsRenderingInfo::set_ParserTextBoxWidth, SetParserTextboxWidth);
+	SCRIPT_METHOD_EXT(DialogOptionsRenderingInfo::get_Surface, GetSurface);
+	SCRIPT_METHOD_EXT(DialogOptionsRenderingInfo::get_Width, GetWidth);
+	SCRIPT_METHOD_EXT(DialogOptionsRenderingInfo::set_Width, SetWidth);
+	SCRIPT_METHOD_EXT(DialogOptionsRenderingInfo::get_X, GetX);
+	SCRIPT_METHOD_EXT(DialogOptionsRenderingInfo::set_X, SetX);
+	SCRIPT_METHOD_EXT(DialogOptionsRenderingInfo::get_Y, GetY);
+	SCRIPT_METHOD_EXT(DialogOptionsRenderingInfo::set_Y, SetY);
+}
+
+void DialogOptionsRenderingInfo::GetActiveOptionID(ScriptMethodParams &params) {
+	PARAMS1(ScriptDialogOptionsRendering *, dlgOptRender);
+	params._result = AGS3::DialogOptionsRendering_GetActiveOptionID(dlgOptRender);
+}
+
+void DialogOptionsRenderingInfo::SetActiveOptionID(ScriptMethodParams &params) {
+	PARAMS2(ScriptDialogOptionsRendering *, dlgOptRender, int, activeOptionID);
+	AGS3::DialogOptionsRendering_SetActiveOptionID(dlgOptRender, activeOptionID);
+}
+
+void DialogOptionsRenderingInfo::GetDialogToRender(ScriptMethodParams &params) {
+	PARAMS1(ScriptDialogOptionsRendering *, dlgOptRender);
+	params._result = AGS3::DialogOptionsRendering_GetDialogToRender(dlgOptRender);
+}
+
+void DialogOptionsRenderingInfo::GetHeight(ScriptMethodParams &params) {
+	PARAMS1(ScriptDialogOptionsRendering *, dlgOptRender);
+	params._result = AGS3::DialogOptionsRendering_GetHeight(dlgOptRender);
+}
+
+void DialogOptionsRenderingInfo::SetHeight(ScriptMethodParams &params) {
+	PARAMS2(ScriptDialogOptionsRendering *, dlgOptRender, int, newHeight);
+	AGS3::DialogOptionsRendering_SetHeight(dlgOptRender, newHeight);
+}
+
+void DialogOptionsRenderingInfo::GetParserTextboxX(ScriptMethodParams &params) {
+	PARAMS1(ScriptDialogOptionsRendering *, dlgOptRender);
+	params._result = AGS3::DialogOptionsRendering_GetParserTextboxX(dlgOptRender);
+}
+
+void DialogOptionsRenderingInfo::SetParserTextboxX(ScriptMethodParams &params) {
+	PARAMS2(ScriptDialogOptionsRendering *, dlgOptRender, int, newX);
+	AGS3::DialogOptionsRendering_SetParserTextboxX(dlgOptRender, newX);
+}
+
+void DialogOptionsRenderingInfo::GetParserTextboxY(ScriptMethodParams &params) {
+	PARAMS1(ScriptDialogOptionsRendering *, dlgOptRender);
+	params._result = AGS3::DialogOptionsRendering_GetParserTextboxY(dlgOptRender);
+}
+
+void DialogOptionsRenderingInfo::SetParserTextboxY(ScriptMethodParams &params) {
+	PARAMS2(ScriptDialogOptionsRendering *, dlgOptRender, int, newY);
+	AGS3::DialogOptionsRendering_SetParserTextboxY(dlgOptRender, newY);
+}
+
+void DialogOptionsRenderingInfo::GetParserTextboxWidth(ScriptMethodParams &params) {
+	PARAMS1(ScriptDialogOptionsRendering *, dlgOptRender);
+	params._result = AGS3::DialogOptionsRendering_GetParserTextboxWidth(dlgOptRender);
+}
+
+void DialogOptionsRenderingInfo::SetParserTextboxWidth(ScriptMethodParams &params) {
+	PARAMS2(ScriptDialogOptionsRendering *, dlgOptRender, int, newWidth);
+	AGS3::DialogOptionsRendering_SetParserTextboxWidth(dlgOptRender, newWidth);
+}
+
+void DialogOptionsRenderingInfo::GetSurface(ScriptMethodParams &params) {
+	PARAMS1(ScriptDialogOptionsRendering *, dlgOptRender);
+	params._result = AGS3::DialogOptionsRendering_GetSurface(dlgOptRender);
+}
+
+void DialogOptionsRenderingInfo::GetWidth(ScriptMethodParams &params) {
+	PARAMS1(ScriptDialogOptionsRendering *, dlgOptRender);
+	params._result = AGS3::DialogOptionsRendering_GetWidth(dlgOptRender);
+}
+
+void DialogOptionsRenderingInfo::SetWidth(ScriptMethodParams &params) {
+	PARAMS2(ScriptDialogOptionsRendering *, dlgOptRender, int, newWidth);
+	AGS3::DialogOptionsRendering_SetWidth(dlgOptRender, newWidth);
+}
+
+void DialogOptionsRenderingInfo::GetX(ScriptMethodParams &params) {
+	PARAMS1(ScriptDialogOptionsRendering *, dlgOptRender);
+	params._result = AGS3::DialogOptionsRendering_GetX(dlgOptRender);
+}
+
+void DialogOptionsRenderingInfo::SetX(ScriptMethodParams &params) {
+	PARAMS2(ScriptDialogOptionsRendering *, dlgOptRender, int, newX);
+	AGS3::DialogOptionsRendering_SetX(dlgOptRender, newX);
+}
+
+void DialogOptionsRenderingInfo::GetY(ScriptMethodParams &params) {
+	PARAMS1(ScriptDialogOptionsRendering *, dlgOptRender);
+	params._result = AGS3::DialogOptionsRendering_GetY(dlgOptRender);
+}
+
+void DialogOptionsRenderingInfo::SetY(ScriptMethodParams &params) {
+	PARAMS2(ScriptDialogOptionsRendering *, dlgOptRender, int, newY);
+	AGS3::DialogOptionsRendering_SetY(dlgOptRender, newY);
+}
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/core/dialog_options_rendering_info.h b/engines/ags/plugins/core/dialog_options_rendering_info.h
new file mode 100644
index 0000000000..2a9cf63a8e
--- /dev/null
+++ b/engines/ags/plugins/core/dialog_options_rendering_info.h
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef AGS_PLUGINS_CORE_DIALOG_OPTIONS_RENDERING_INFO_H
+#define AGS_PLUGINS_CORE_DIALOG_OPTIONS_RENDERING_INFO_H
+
+#include "ags/plugins/plugin_base.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+class DialogOptionsRenderingInfo : public ScriptContainer {
+public:
+	static void AGS_EngineStartup(IAGSEngine *engine);
+
+	static void GetActiveOptionID(ScriptMethodParams &params);
+	static void SetActiveOptionID(ScriptMethodParams &params);
+	static void GetDialogToRender(ScriptMethodParams &params);
+	static void GetHeight(ScriptMethodParams &params);
+	static void SetHeight(ScriptMethodParams &params);
+	static void GetParserTextboxX(ScriptMethodParams &params);
+	static void SetParserTextboxX(ScriptMethodParams &params);
+	static void GetParserTextboxY(ScriptMethodParams &params);
+	static void SetParserTextboxY(ScriptMethodParams &params);
+	static void GetParserTextboxWidth(ScriptMethodParams &params);
+	static void SetParserTextboxWidth(ScriptMethodParams &params);
+	static void GetSurface(ScriptMethodParams &params);
+	static void GetWidth(ScriptMethodParams &params);
+	static void SetWidth(ScriptMethodParams &params);
+	static void GetX(ScriptMethodParams &params);
+	static void SetX(ScriptMethodParams &params);
+	static void GetY(ScriptMethodParams &params);
+	static void SetY(ScriptMethodParams &params);
+};
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
+
+#endif
diff --git a/engines/ags/plugins/core/drawing_surface.cpp b/engines/ags/plugins/core/drawing_surface.cpp
index d6a204322d..5c59100477 100644
--- a/engines/ags/plugins/core/drawing_surface.cpp
+++ b/engines/ags/plugins/core/drawing_surface.cpp
@@ -29,136 +29,136 @@ namespace Plugins {
 namespace Core {
 
 void DrawingSurface::AGS_EngineStartup(IAGSEngine *engine) {
-	SCRIPT_METHOD_EXT(DrawingSurface::Clear^1, DrawingSurface_Clear);
-	SCRIPT_METHOD_EXT(DrawingSurface::CreateCopy^0, DrawingSurface_CreateCopy);
-	SCRIPT_METHOD_EXT(DrawingSurface::DrawCircle^3, DrawingSurface_DrawCircle);
-	SCRIPT_METHOD_EXT(DrawingSurface::DrawImage^6, DrawingSurface_DrawImage);
-	SCRIPT_METHOD_EXT(DrawingSurface::DrawLine^5, DrawingSurface_DrawLine);
-	SCRIPT_METHOD_EXT(DrawingSurface::DrawMessageWrapped^5, DrawingSurface_DrawMessageWrapped);
-	SCRIPT_METHOD_EXT(DrawingSurface::DrawPixel^2, DrawingSurface_DrawPixel);
-	SCRIPT_METHOD_EXT(DrawingSurface::DrawRectangle^4, DrawingSurface_DrawRectangle);
-	SCRIPT_METHOD_EXT(DrawingSurface::DrawString^104, ScPl_DrawingSurface_DrawString);
+	SCRIPT_METHOD_EXT(DrawingSurface::Clear^1, Clear);
+	SCRIPT_METHOD_EXT(DrawingSurface::CreateCopy^0, CreateCopy);
+	SCRIPT_METHOD_EXT(DrawingSurface::DrawCircle^3, DrawCircle);
+	SCRIPT_METHOD_EXT(DrawingSurface::DrawImage^6, DrawImage);
+	SCRIPT_METHOD_EXT(DrawingSurface::DrawLine^5, DrawLine);
+	SCRIPT_METHOD_EXT(DrawingSurface::DrawMessageWrapped^5, DrawMessageWrapped);
+	SCRIPT_METHOD_EXT(DrawingSurface::DrawPixel^2, DrawPixel);
+	SCRIPT_METHOD_EXT(DrawingSurface::DrawRectangle^4, DrawRectangle);
+	SCRIPT_METHOD_EXT(DrawingSurface::DrawString^104, ScPl_DrawString);
 
 	if (engine->version < kScriptAPI_v350)
-		SCRIPT_METHOD_EXT(DrawingSurface::DrawStringWrapped^6, DrawingSurface_DrawStringWrapped_Old);
+		SCRIPT_METHOD_EXT(DrawingSurface::DrawStringWrapped^6, DrawStringWrapped_Old);
 	else
-		SCRIPT_METHOD_EXT(DrawingSurface::DrawStringWrapped^6, DrawingSurface_DrawStringWrapped);
+		SCRIPT_METHOD_EXT(DrawingSurface::DrawStringWrapped^6, DrawStringWrapped);
 
-	SCRIPT_METHOD_EXT(DrawingSurface::DrawSurface^2, DrawingSurface_DrawSurface);
-	SCRIPT_METHOD_EXT(DrawingSurface::DrawTriangle^6, DrawingSurface_DrawTriangle);
-	SCRIPT_METHOD_EXT(DrawingSurface::GetPixel^2, DrawingSurface_GetPixel);
-	SCRIPT_METHOD_EXT(DrawingSurface::Release^0, DrawingSurface_Release);
-	SCRIPT_METHOD_EXT(DrawingSurface::get_DrawingColor, DrawingSurface_GetDrawingColor);
-	SCRIPT_METHOD_EXT(DrawingSurface::set_DrawingColor, DrawingSurface_SetDrawingColor);
-	SCRIPT_METHOD_EXT(DrawingSurface::get_Height, DrawingSurface_GetHeight);
-	SCRIPT_METHOD_EXT(DrawingSurface::get_UseHighResCoordinates, DrawingSurface_GetUseHighResCoordinates);
-	SCRIPT_METHOD_EXT(DrawingSurface::set_UseHighResCoordinates, DrawingSurface_SetUseHighResCoordinates);
-	SCRIPT_METHOD_EXT(DrawingSurface::get_Width, DrawingSurface_GetWidth);
+	SCRIPT_METHOD_EXT(DrawingSurface::DrawSurface^2, DrawSurface);
+	SCRIPT_METHOD_EXT(DrawingSurface::DrawTriangle^6, DrawTriangle);
+	SCRIPT_METHOD_EXT(DrawingSurface::GetPixel^2, GetPixel);
+	SCRIPT_METHOD_EXT(DrawingSurface::Release^0, Release);
+	SCRIPT_METHOD_EXT(DrawingSurface::get_DrawingColor, GetDrawingColor);
+	SCRIPT_METHOD_EXT(DrawingSurface::set_DrawingColor, SetDrawingColor);
+	SCRIPT_METHOD_EXT(DrawingSurface::get_Height, GetHeight);
+	SCRIPT_METHOD_EXT(DrawingSurface::get_UseHighResCoordinates, GetUseHighResCoordinates);
+	SCRIPT_METHOD_EXT(DrawingSurface::set_UseHighResCoordinates, SetUseHighResCoordinates);
+	SCRIPT_METHOD_EXT(DrawingSurface::get_Width, GetWidth);
 }
 
-void DrawingSurface::DrawingSurface_Clear(ScriptMethodParams &params) {
+void DrawingSurface::Clear(ScriptMethodParams &params) {
 	PARAMS2(ScriptDrawingSurface *, sds, int, colour);
 	AGS3::DrawingSurface_Clear(sds, colour);
 }
 
-void DrawingSurface::DrawingSurface_CreateCopy(ScriptMethodParams &params) {
+void DrawingSurface::CreateCopy(ScriptMethodParams &params) {
 	PARAMS1(ScriptDrawingSurface *, sds);
 	params._result = AGS3::DrawingSurface_CreateCopy(sds);
 }
 
-void DrawingSurface::DrawingSurface_DrawCircle(ScriptMethodParams &params) {
+void DrawingSurface::DrawCircle(ScriptMethodParams &params) {
 	PARAMS4(ScriptDrawingSurface *, sds, int, x, int, y, int, radius);
 	AGS3::DrawingSurface_DrawCircle(sds, x, y, radius);
 }
 
-void DrawingSurface::DrawingSurface_DrawImage(ScriptMethodParams &params) {
+void DrawingSurface::DrawImage(ScriptMethodParams &params) {
 	PARAMS7(ScriptDrawingSurface *, sds, int, xx, int, yy, int, slot, int, trans, int, width, int, height);
 	AGS3::DrawingSurface_DrawImage(sds, xx, yy, slot, trans, width, height);
 }
 
-void DrawingSurface::DrawingSurface_DrawLine(ScriptMethodParams &params) {
+void DrawingSurface::DrawLine(ScriptMethodParams &params) {
 	PARAMS6(ScriptDrawingSurface *, sds, int, fromx, int, fromy, int, tox, int, toy, int, thickness);
 	AGS3::DrawingSurface_DrawLine(sds, fromx, fromy, tox, toy, thickness);
 }
 
-void DrawingSurface::DrawingSurface_DrawMessageWrapped(ScriptMethodParams &params) {
+void DrawingSurface::DrawMessageWrapped(ScriptMethodParams &params) {
 	PARAMS6(ScriptDrawingSurface *, sds, int, xx, int, yy, int, wid, int, font, int, msgm);
 	AGS3::DrawingSurface_DrawMessageWrapped(sds, xx, yy, wid, font, msgm);
 }
 
-void DrawingSurface::DrawingSurface_DrawPixel(ScriptMethodParams &params) {
+void DrawingSurface::DrawPixel(ScriptMethodParams &params) {
 	PARAMS3(ScriptDrawingSurface *, sds, int, x, int, y);
 	AGS3::DrawingSurface_DrawPixel(sds, x, y);
 }
 
-void DrawingSurface::DrawingSurface_DrawRectangle(ScriptMethodParams &params) {
+void DrawingSurface::DrawRectangle(ScriptMethodParams &params) {
 	PARAMS5(ScriptDrawingSurface *, sds, int, x1, int, y1, int, x2, int, y2);
 	AGS3::DrawingSurface_DrawRectangle(sds, x1, y1, x2, y2);
 }
 
-void DrawingSurface::ScPl_DrawingSurface_DrawString(ScriptMethodParams &params) {
+void DrawingSurface::ScPl_DrawString(ScriptMethodParams &params) {
 	PARAMS4(ScriptDrawingSurface *, sds, int, xx, int, yy, int, font);
 	Common::String buf = params.format(4);
 
 	AGS3::DrawingSurface_DrawString(sds, xx, yy, font, buf.c_str());
 }
 
-void DrawingSurface::DrawingSurface_DrawStringWrapped_Old(ScriptMethodParams &params) {
+void DrawingSurface::DrawStringWrapped_Old(ScriptMethodParams &params) {
 	PARAMS7(ScriptDrawingSurface *, sds, int, xx, int, yy, int, wid, int, font, int, alignment, const char *, msg);
 	AGS3::DrawingSurface_DrawStringWrapped_Old(sds, xx, yy, wid, font, alignment, msg);
 }
 
-void DrawingSurface::DrawingSurface_DrawStringWrapped(ScriptMethodParams &params) {
+void DrawingSurface::DrawStringWrapped(ScriptMethodParams &params) {
 	PARAMS7(ScriptDrawingSurface *, sds, int, xx, int, yy, int, wid, int, font, int, alignment, const char *, msg);
 	AGS3::DrawingSurface_DrawStringWrapped(sds, xx, yy, wid, font, alignment, msg);
 }
 
-void DrawingSurface::DrawingSurface_DrawSurface(ScriptMethodParams &params) {
+void DrawingSurface::DrawSurface(ScriptMethodParams &params) {
 	PARAMS3(ScriptDrawingSurface *, target, ScriptDrawingSurface *, source, int, translev);
 	AGS3::DrawingSurface_DrawSurface(target, source, translev);
 }
 
-void DrawingSurface::DrawingSurface_DrawTriangle(ScriptMethodParams &params) {
+void DrawingSurface::DrawTriangle(ScriptMethodParams &params) {
 	PARAMS7(ScriptDrawingSurface *, sds, int, x1, int, y1, int, x2, int, y2, int, x3, int, y3);
 	AGS3::DrawingSurface_DrawTriangle(sds, x1, y1, x2, y2, x3, y3);
 }
 
-void DrawingSurface::DrawingSurface_GetPixel(ScriptMethodParams &params) {
+void DrawingSurface::GetPixel(ScriptMethodParams &params) {
 	PARAMS3(ScriptDrawingSurface *, sds, int, x, int, y);
 	params._result = AGS3::DrawingSurface_GetPixel(sds, x, y);
 }
 
-void DrawingSurface::DrawingSurface_Release(ScriptMethodParams &params) {
+void DrawingSurface::Release(ScriptMethodParams &params) {
 	PARAMS1(ScriptDrawingSurface *, sds);
 	AGS3::DrawingSurface_Release(sds);
 }
 
-void DrawingSurface::DrawingSurface_GetDrawingColor(ScriptMethodParams &params) {
+void DrawingSurface::GetDrawingColor(ScriptMethodParams &params) {
 	PARAMS1(ScriptDrawingSurface *, sds);
 	params._result = AGS3::DrawingSurface_GetDrawingColor(sds);
 }
 
-void DrawingSurface::DrawingSurface_SetDrawingColor(ScriptMethodParams &params) {
+void DrawingSurface::SetDrawingColor(ScriptMethodParams &params) {
 	PARAMS2(ScriptDrawingSurface *, sds, int, newColour);
 	AGS3::DrawingSurface_SetDrawingColor(sds, newColour);
 }
 
-void DrawingSurface::DrawingSurface_GetHeight(ScriptMethodParams &params) {
+void DrawingSurface::GetHeight(ScriptMethodParams &params) {
 	PARAMS1(ScriptDrawingSurface *, sds);
 	params._result = AGS3::DrawingSurface_GetHeight(sds);
 }
 
-void DrawingSurface::DrawingSurface_GetUseHighResCoordinates(ScriptMethodParams &params) {
+void DrawingSurface::GetUseHighResCoordinates(ScriptMethodParams &params) {
 	PARAMS1(ScriptDrawingSurface *, sds);
 	params._result = AGS3::DrawingSurface_GetUseHighResCoordinates(sds);
 }
 
-void DrawingSurface::DrawingSurface_SetUseHighResCoordinates(ScriptMethodParams &params) {
+void DrawingSurface::SetUseHighResCoordinates(ScriptMethodParams &params) {
 	PARAMS2(ScriptDrawingSurface *, sds, int, highRes);
 	AGS3::DrawingSurface_SetUseHighResCoordinates(sds, highRes);
 }
 
-void DrawingSurface::DrawingSurface_GetWidth(ScriptMethodParams &params) {
+void DrawingSurface::GetWidth(ScriptMethodParams &params) {
 	PARAMS1(ScriptDrawingSurface *, sds);
 	params._result = AGS3::DrawingSurface_GetWidth(sds);
 }
diff --git a/engines/ags/plugins/core/drawing_surface.h b/engines/ags/plugins/core/drawing_surface.h
index d1569b8cc4..1f0e0ab03c 100644
--- a/engines/ags/plugins/core/drawing_surface.h
+++ b/engines/ags/plugins/core/drawing_surface.h
@@ -33,27 +33,27 @@ class DrawingSurface : public ScriptContainer {
 public:
 	void AGS_EngineStartup(IAGSEngine *engine);
 
-	static void DrawingSurface_Clear(ScriptMethodParams &params);
-	static void DrawingSurface_CreateCopy(ScriptMethodParams &params);
-	static void DrawingSurface_DrawCircle(ScriptMethodParams &params);
-	static void DrawingSurface_DrawImage(ScriptMethodParams &params);
-	static void DrawingSurface_DrawLine(ScriptMethodParams &params);
-	static void DrawingSurface_DrawMessageWrapped(ScriptMethodParams &params);
-	static void DrawingSurface_DrawPixel(ScriptMethodParams &params);
-	static void DrawingSurface_DrawRectangle(ScriptMethodParams &params);
-	static void ScPl_DrawingSurface_DrawString(ScriptMethodParams &params);
-	static void DrawingSurface_DrawStringWrapped_Old(ScriptMethodParams &params);
-	static void DrawingSurface_DrawStringWrapped(ScriptMethodParams &params);
-	static void DrawingSurface_DrawSurface(ScriptMethodParams &params);
-	static void DrawingSurface_DrawTriangle(ScriptMethodParams &params);
-	static void DrawingSurface_GetPixel(ScriptMethodParams &params);
-	static void DrawingSurface_Release(ScriptMethodParams &params);
-	static void DrawingSurface_GetDrawingColor(ScriptMethodParams &params);
-	static void DrawingSurface_SetDrawingColor(ScriptMethodParams &params);
-	static void DrawingSurface_GetHeight(ScriptMethodParams &params);
-	static void DrawingSurface_GetUseHighResCoordinates(ScriptMethodParams &params);
-	static void DrawingSurface_SetUseHighResCoordinates(ScriptMethodParams &params);
-	static void DrawingSurface_GetWidth(ScriptMethodParams &params);	
+	static void Clear(ScriptMethodParams &params);
+	static void CreateCopy(ScriptMethodParams &params);
+	static void DrawCircle(ScriptMethodParams &params);
+	static void DrawImage(ScriptMethodParams &params);
+	static void DrawLine(ScriptMethodParams &params);
+	static void DrawMessageWrapped(ScriptMethodParams &params);
+	static void DrawPixel(ScriptMethodParams &params);
+	static void DrawRectangle(ScriptMethodParams &params);
+	static void ScPl_DrawString(ScriptMethodParams &params);
+	static void DrawStringWrapped_Old(ScriptMethodParams &params);
+	static void DrawStringWrapped(ScriptMethodParams &params);
+	static void DrawSurface(ScriptMethodParams &params);
+	static void DrawTriangle(ScriptMethodParams &params);
+	static void GetPixel(ScriptMethodParams &params);
+	static void Release(ScriptMethodParams &params);
+	static void GetDrawingColor(ScriptMethodParams &params);
+	static void SetDrawingColor(ScriptMethodParams &params);
+	static void GetHeight(ScriptMethodParams &params);
+	static void GetUseHighResCoordinates(ScriptMethodParams &params);
+	static void SetUseHighResCoordinates(ScriptMethodParams &params);
+	static void GetWidth(ScriptMethodParams &params);
 };
 
 } // namespace Core
diff --git a/engines/ags/plugins/core/dynamic_sprite.cpp b/engines/ags/plugins/core/dynamic_sprite.cpp
new file mode 100644
index 0000000000..80abe02f5f
--- /dev/null
+++ b/engines/ags/plugins/core/dynamic_sprite.cpp
@@ -0,0 +1,167 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ags/plugins/core/dynamic_sprite.h"
+#include "ags/engine/ac/dynamic_sprite.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+void DynamicSprite::AGS_EngineStartup(IAGSEngine *engine) {
+	SCRIPT_METHOD_EXT(DynamicSprite::ChangeCanvasSize^4, ChangeCanvasSize);
+	SCRIPT_METHOD_EXT(DynamicSprite::CopyTransparencyMask^1, CopyTransparencyMask);
+	SCRIPT_METHOD_EXT(DynamicSprite::Crop^4, Crop);
+	SCRIPT_METHOD_EXT(DynamicSprite::Delete, Delete);
+	SCRIPT_METHOD_EXT(DynamicSprite::Flip^1, Flip);
+	SCRIPT_METHOD_EXT(DynamicSprite::GetDrawingSurface^0, GetDrawingSurface);
+	SCRIPT_METHOD_EXT(DynamicSprite::Resize^2, Resize);
+	SCRIPT_METHOD_EXT(DynamicSprite::Rotate^3, Rotate);
+	SCRIPT_METHOD_EXT(DynamicSprite::SaveToFile^1, SaveToFile);
+	SCRIPT_METHOD_EXT(DynamicSprite::Tint^5, Tint);
+	SCRIPT_METHOD_EXT(DynamicSprite::get_ColorDepth, GetColorDepth);
+	SCRIPT_METHOD_EXT(DynamicSprite::get_Graphic, GetGraphic);
+	SCRIPT_METHOD_EXT(DynamicSprite::get_Height, GetHeight);
+	SCRIPT_METHOD_EXT(DynamicSprite::get_Width, GetWidth);
+	SCRIPT_METHOD_EXT(DynamicSprite::Create^3, Create);
+	SCRIPT_METHOD_EXT(DynamicSprite::CreateFromBackground, CreateFromBackground);
+	SCRIPT_METHOD_EXT(DynamicSprite::CreateFromDrawingSurface^5, CreateFromDrawingSurface);
+	SCRIPT_METHOD_EXT(DynamicSprite::CreateFromExistingSprite^1, CreateFromExistingSprite_Old);
+	SCRIPT_METHOD_EXT(DynamicSprite::CreateFromExistingSprite^2, CreateFromExistingSprite);
+	SCRIPT_METHOD_EXT(DynamicSprite::CreateFromFile, CreateFromFile);
+	SCRIPT_METHOD_EXT(DynamicSprite::CreateFromSaveGame, CreateFromSaveGame);
+	SCRIPT_METHOD_EXT(DynamicSprite::CreateFromScreenShot, CreateFromScreenShot);
+}
+
+void DynamicSprite::ChangeCanvasSize(ScriptMethodParams &params) {
+	PARAMS5(ScriptDynamicSprite *, sds, int, width, int, height, int, x, int, y);
+	AGS3::DynamicSprite_ChangeCanvasSize(sds, width, height, x, y);
+}
+
+void DynamicSprite::CopyTransparencyMask(ScriptMethodParams &params) {
+	PARAMS2(ScriptDynamicSprite *, sds, int, sourceSprite);
+	AGS3::DynamicSprite_CopyTransparencyMask(sds, sourceSprite);
+}
+
+void DynamicSprite::Crop(ScriptMethodParams &params) {
+	PARAMS5(ScriptDynamicSprite *, sds, int, x1, int, y1, int, width, int, height);
+	AGS3::DynamicSprite_Crop(sds, x1, y1, width, height);
+}
+
+void DynamicSprite::Delete(ScriptMethodParams &params) {
+	PARAMS1(ScriptDynamicSprite *, sds);
+	AGS3::DynamicSprite_Delete(sds);
+}
+
+void DynamicSprite::Flip(ScriptMethodParams &params) {
+	PARAMS2(ScriptDynamicSprite *, sds, int, direction);
+	AGS3::DynamicSprite_Flip(sds, direction);
+}
+
+void DynamicSprite::GetDrawingSurface(ScriptMethodParams &params) {
+	PARAMS1(ScriptDynamicSprite *, dss);
+	params._result = AGS3::DynamicSprite_GetDrawingSurface(dss);
+}
+
+void DynamicSprite::Resize(ScriptMethodParams &params) {
+	PARAMS3(ScriptDynamicSprite *, sds, int, width, int, height);
+	AGS3::DynamicSprite_Resize(sds, width, height);
+}
+
+void DynamicSprite::Rotate(ScriptMethodParams &params) {
+	PARAMS4(ScriptDynamicSprite *, sds, int, angle, int, width, int, height);
+	AGS3::DynamicSprite_Rotate(sds, angle, width, height);
+}
+
+void DynamicSprite::SaveToFile(ScriptMethodParams &params) {
+	PARAMS2(ScriptDynamicSprite *, sds, const char *, namm);
+	params._result = AGS3::DynamicSprite_SaveToFile(sds, namm);
+}
+
+void DynamicSprite::Tint(ScriptMethodParams &params) {
+	PARAMS6(ScriptDynamicSprite *, sds, int, red, int, green, int, blue, int, saturation, int, luminance);
+	AGS3::DynamicSprite_Tint(sds, red, green, blue, saturation, luminance);
+}
+
+void DynamicSprite::GetColorDepth(ScriptMethodParams &params) {
+	PARAMS1(ScriptDynamicSprite *, sds);
+	params._result = AGS3::DynamicSprite_GetColorDepth(sds);
+}
+
+void DynamicSprite::GetGraphic(ScriptMethodParams &params) {
+	PARAMS1(ScriptDynamicSprite *, sds);
+	params._result = AGS3::DynamicSprite_GetGraphic(sds);
+}
+
+void DynamicSprite::GetHeight(ScriptMethodParams &params) {
+	PARAMS1(ScriptDynamicSprite *, sds);
+	params._result = AGS3::DynamicSprite_GetHeight(sds);
+}
+
+void DynamicSprite::GetWidth(ScriptMethodParams &params) {
+	PARAMS1(ScriptDynamicSprite *, sds);
+	params._result = AGS3::DynamicSprite_GetWidth(sds);
+}
+
+void DynamicSprite::Create(ScriptMethodParams &params) {
+	PARAMS3(int, width, int, height, int, alphaChannel);
+	params._result = AGS3::DynamicSprite_Create(width, height, alphaChannel);
+}
+
+void DynamicSprite::CreateFromBackground(ScriptMethodParams &params) {
+	PARAMS5(int, frame, int, x1, int, y1, int, width, int, height);
+	params._result = AGS3::DynamicSprite_CreateFromBackground(frame, x1, y1, width, height);
+}
+
+void DynamicSprite::CreateFromDrawingSurface(ScriptMethodParams &params) {
+	PARAMS5(ScriptDrawingSurface *, sds, int, x, int, y, int, width, int, height);
+	params._result = AGS3::DynamicSprite_CreateFromDrawingSurface(sds, x, y, width, height);
+}
+
+void DynamicSprite::CreateFromExistingSprite_Old(ScriptMethodParams &params) {
+	PARAMS1(int, slot);
+	params._result = AGS3::DynamicSprite_CreateFromExistingSprite_Old(slot);
+}
+
+void DynamicSprite::CreateFromExistingSprite(ScriptMethodParams &params) {
+	PARAMS2(int, slot, int, preserveAlphaChannel);
+	params._result = AGS3::DynamicSprite_CreateFromExistingSprite(slot, preserveAlphaChannel);
+}
+
+void DynamicSprite::CreateFromFile(ScriptMethodParams &params) {
+	PARAMS1(const char *, filename);
+	params._result = AGS3::DynamicSprite_CreateFromFile(filename);
+}
+
+void DynamicSprite::CreateFromSaveGame(ScriptMethodParams &params) {
+	PARAMS3(int, sgslot, int, width, int, height);
+	params._result = AGS3::DynamicSprite_CreateFromSaveGame(sgslot, width, height);
+}
+
+void DynamicSprite::CreateFromScreenShot(ScriptMethodParams &params) {
+	PARAMS2(int, width, int, height);
+	params._result = AGS3::DynamicSprite_CreateFromScreenShot(width, height);
+}
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/core/dynamic_sprite.h b/engines/ags/plugins/core/dynamic_sprite.h
new file mode 100644
index 0000000000..4692e4d775
--- /dev/null
+++ b/engines/ags/plugins/core/dynamic_sprite.h
@@ -0,0 +1,64 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef AGS_PLUGINS_CORE_DYNAMIC_SPRITE_H
+#define AGS_PLUGINS_CORE_DYNAMIC_SPRITE_H
+
+#include "ags/plugins/plugin_base.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+class DynamicSprite : public ScriptContainer {
+public:
+	static void AGS_EngineStartup(IAGSEngine *engine);
+
+	static void ChangeCanvasSize(ScriptMethodParams &params);
+	static void CopyTransparencyMask(ScriptMethodParams &params);
+	static void Crop(ScriptMethodParams &params);
+	static void Delete(ScriptMethodParams &params);
+	static void Flip(ScriptMethodParams &params);
+	static void GetDrawingSurface(ScriptMethodParams &params);
+	static void Resize(ScriptMethodParams &params);
+	static void Rotate(ScriptMethodParams &params);
+	static void SaveToFile(ScriptMethodParams &params);
+	static void Tint(ScriptMethodParams &params);
+	static void GetColorDepth(ScriptMethodParams &params);
+	static void GetGraphic(ScriptMethodParams &params);
+	static void GetHeight(ScriptMethodParams &params);
+	static void GetWidth(ScriptMethodParams &params);
+	static void Create(ScriptMethodParams &params);
+	static void CreateFromBackground(ScriptMethodParams &params);
+	static void CreateFromDrawingSurface(ScriptMethodParams &params);
+	static void CreateFromExistingSprite_Old(ScriptMethodParams &params);
+	static void CreateFromExistingSprite(ScriptMethodParams &params);
+	static void CreateFromFile(ScriptMethodParams &params);
+	static void CreateFromSaveGame(ScriptMethodParams &params);
+	static void CreateFromScreenShot(ScriptMethodParams &params);
+};
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
+
+#endif


Commit: c89b21b90110e735bee746cae8d5e6b35418cdd1
    https://github.com/scummvm/scummvm/commit/c89b21b90110e735bee746cae8d5e6b35418cdd1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-07-16T19:48:14-07:00

Commit Message:
AGS: Shifting more classes to plugins/core/

Changed paths:
  A engines/ags/plugins/core/file.cpp
  A engines/ags/plugins/core/file.h
  A engines/ags/plugins/core/game.cpp
  A engines/ags/plugins/core/game.h
    engines/ags/engine/ac/file.cpp
    engines/ags/engine/ac/game.cpp
    engines/ags/module.mk
    engines/ags/plugins/core/core.cpp
    engines/ags/plugins/core/core.h


diff --git a/engines/ags/engine/ac/file.cpp b/engines/ags/engine/ac/file.cpp
index 7f667bd5bd..9ed36878a2 100644
--- a/engines/ags/engine/ac/file.cpp
+++ b/engines/ags/engine/ac/file.cpp
@@ -653,26 +653,6 @@ void RegisterFileAPI() {
 	ccAddExternalObjectFunction("File::get_EOF", Sc_File_GetEOF);
 	ccAddExternalObjectFunction("File::get_Error", Sc_File_GetError);
 	ccAddExternalObjectFunction("File::get_Position", Sc_File_GetPosition);
-
-	/* ----------------------- Registering unsafe exports for plugins -----------------------*/
-
-	ccAddExternalFunctionForPlugin("File::Delete^1", (void *)File_Delete);
-	ccAddExternalFunctionForPlugin("File::Exists^1", (void *)File_Exists);
-	ccAddExternalFunctionForPlugin("File::Open^2", (void *)sc_OpenFile);
-	ccAddExternalFunctionForPlugin("File::Close^0", (void *)File_Close);
-	ccAddExternalFunctionForPlugin("File::ReadInt^0", (void *)File_ReadInt);
-	ccAddExternalFunctionForPlugin("File::ReadRawChar^0", (void *)File_ReadRawChar);
-	ccAddExternalFunctionForPlugin("File::ReadRawInt^0", (void *)File_ReadRawInt);
-	ccAddExternalFunctionForPlugin("File::ReadRawLine^1", (void *)File_ReadRawLine);
-	ccAddExternalFunctionForPlugin("File::ReadRawLineBack^0", (void *)File_ReadRawLineBack);
-	ccAddExternalFunctionForPlugin("File::ReadString^1", (void *)File_ReadString);
-	ccAddExternalFunctionForPlugin("File::ReadStringBack^0", (void *)File_ReadStringBack);
-	ccAddExternalFunctionForPlugin("File::WriteInt^1", (void *)File_WriteInt);
-	ccAddExternalFunctionForPlugin("File::WriteRawChar^1", (void *)File_WriteRawChar);
-	ccAddExternalFunctionForPlugin("File::WriteRawLine^1", (void *)File_WriteRawLine);
-	ccAddExternalFunctionForPlugin("File::WriteString^1", (void *)File_WriteString);
-	ccAddExternalFunctionForPlugin("File::get_EOF", (void *)File_GetEOF);
-	ccAddExternalFunctionForPlugin("File::get_Error", (void *)File_GetError);
 }
 
 } // namespace AGS3
diff --git a/engines/ags/engine/ac/game.cpp b/engines/ags/engine/ac/game.cpp
index 55e102b175..07bdaa31bb 100644
--- a/engines/ags/engine/ac/game.cpp
+++ b/engines/ags/engine/ac/game.cpp
@@ -1779,56 +1779,6 @@ void RegisterGameAPI() {
 	ccAddExternalStaticFunction("Game::get_Camera",                             Sc_Game_GetCamera);
 	ccAddExternalStaticFunction("Game::get_CameraCount",                        Sc_Game_GetCameraCount);
 	ccAddExternalStaticFunction("Game::geti_Cameras",                           Sc_Game_GetAnyCamera);
-
-	/* ----------------------- Registering unsafe exports for plugins -----------------------*/
-
-	ccAddExternalFunctionForPlugin("Game::IsAudioPlaying^1", (void *)Game_IsAudioPlaying);
-	ccAddExternalFunctionForPlugin("Game::SetAudioTypeSpeechVolumeDrop^2", (void *)Game_SetAudioTypeSpeechVolumeDrop);
-	ccAddExternalFunctionForPlugin("Game::SetAudioTypeVolume^3", (void *)Game_SetAudioTypeVolume);
-	ccAddExternalFunctionForPlugin("Game::StopAudio^1", (void *)Game_StopAudio);
-	ccAddExternalFunctionForPlugin("Game::ChangeTranslation^1", (void *)Game_ChangeTranslation);
-	ccAddExternalFunctionForPlugin("Game::DoOnceOnly^1", (void *)Game_DoOnceOnly);
-	ccAddExternalFunctionForPlugin("Game::GetColorFromRGB^3", (void *)Game_GetColorFromRGB);
-	ccAddExternalFunctionForPlugin("Game::GetFrameCountForLoop^2", (void *)Game_GetFrameCountForLoop);
-	ccAddExternalFunctionForPlugin("Game::GetLocationName^2", (void *)Game_GetLocationName);
-	ccAddExternalFunctionForPlugin("Game::GetLoopCountForView^1", (void *)Game_GetLoopCountForView);
-	ccAddExternalFunctionForPlugin("Game::GetMODPattern^0", (void *)Game_GetMODPattern);
-	ccAddExternalFunctionForPlugin("Game::GetRunNextSettingForLoop^2", (void *)Game_GetRunNextSettingForLoop);
-	ccAddExternalFunctionForPlugin("Game::GetSaveSlotDescription^1", (void *)Game_GetSaveSlotDescription);
-	ccAddExternalFunctionForPlugin("Game::GetViewFrame^3", (void *)Game_GetViewFrame);
-	ccAddExternalFunctionForPlugin("Game::InputBox^1", (void *)Game_InputBox);
-	ccAddExternalFunctionForPlugin("Game::SetSaveGameDirectory^1", (void *)Game_SetSaveGameDirectory);
-	ccAddExternalFunctionForPlugin("Game::StopSound^1", (void *)StopAllSounds);
-	ccAddExternalFunctionForPlugin("Game::get_CharacterCount", (void *)Game_GetCharacterCount);
-	ccAddExternalFunctionForPlugin("Game::get_DialogCount", (void *)Game_GetDialogCount);
-	ccAddExternalFunctionForPlugin("Game::get_FileName", (void *)Game_GetFileName);
-	ccAddExternalFunctionForPlugin("Game::get_FontCount", (void *)Game_GetFontCount);
-	ccAddExternalFunctionForPlugin("Game::geti_GlobalMessages", (void *)Game_GetGlobalMessages);
-	ccAddExternalFunctionForPlugin("Game::geti_GlobalStrings", (void *)Game_GetGlobalStrings);
-	ccAddExternalFunctionForPlugin("Game::seti_GlobalStrings", (void *)SetGlobalString);
-	ccAddExternalFunctionForPlugin("Game::get_GUICount", (void *)Game_GetGUICount);
-	ccAddExternalFunctionForPlugin("Game::get_IgnoreUserInputAfterTextTimeoutMs", (void *)Game_GetIgnoreUserInputAfterTextTimeoutMs);
-	ccAddExternalFunctionForPlugin("Game::set_IgnoreUserInputAfterTextTimeoutMs", (void *)Game_SetIgnoreUserInputAfterTextTimeoutMs);
-	ccAddExternalFunctionForPlugin("Game::get_InSkippableCutscene", (void *)Game_GetInSkippableCutscene);
-	ccAddExternalFunctionForPlugin("Game::get_InventoryItemCount", (void *)Game_GetInventoryItemCount);
-	ccAddExternalFunctionForPlugin("Game::get_MinimumTextDisplayTimeMs", (void *)Game_GetMinimumTextDisplayTimeMs);
-	ccAddExternalFunctionForPlugin("Game::set_MinimumTextDisplayTimeMs", (void *)Game_SetMinimumTextDisplayTimeMs);
-	ccAddExternalFunctionForPlugin("Game::get_MouseCursorCount", (void *)Game_GetMouseCursorCount);
-	ccAddExternalFunctionForPlugin("Game::get_Name", (void *)Game_GetName);
-	ccAddExternalFunctionForPlugin("Game::set_Name", (void *)Game_SetName);
-	ccAddExternalFunctionForPlugin("Game::get_NormalFont", (void *)Game_GetNormalFont);
-	ccAddExternalFunctionForPlugin("Game::set_NormalFont", (void *)SetNormalFont);
-	ccAddExternalFunctionForPlugin("Game::get_SkippingCutscene", (void *)Game_GetSkippingCutscene);
-	ccAddExternalFunctionForPlugin("Game::get_SpeechFont", (void *)Game_GetSpeechFont);
-	ccAddExternalFunctionForPlugin("Game::set_SpeechFont", (void *)SetSpeechFont);
-	ccAddExternalFunctionForPlugin("Game::geti_SpriteWidth", (void *)Game_GetSpriteWidth);
-	ccAddExternalFunctionForPlugin("Game::geti_SpriteHeight", (void *)Game_GetSpriteHeight);
-	ccAddExternalFunctionForPlugin("Game::get_TextReadingSpeed", (void *)Game_GetTextReadingSpeed);
-	ccAddExternalFunctionForPlugin("Game::set_TextReadingSpeed", (void *)Game_SetTextReadingSpeed);
-	ccAddExternalFunctionForPlugin("Game::get_TranslationFilename", (void *)Game_GetTranslationFilename);
-	ccAddExternalFunctionForPlugin("Game::get_UseNativeCoordinates", (void *)Game_GetUseNativeCoordinates);
-	ccAddExternalFunctionForPlugin("Game::get_ViewCount", (void *)Game_GetViewCount);
-	ccAddExternalFunctionForPlugin("Game::PlayVoiceClip", (void *)PlayVoiceClip);
 }
 
 void RegisterStaticObjects() {
diff --git a/engines/ags/module.mk b/engines/ags/module.mk
index b57661e52c..5284f5e048 100644
--- a/engines/ags/module.mk
+++ b/engines/ags/module.mk
@@ -296,6 +296,8 @@ MODULE_OBJS = \
 	plugins/core/dialog_options_rendering_info.o \
 	plugins/core/drawing_surface.o \
 	plugins/core/dynamic_sprite.o \
+	plugins/core/file.o \
+	plugins/core/game.o \
 	plugins/ags_agi/ags_agi.o \
 	plugins/ags_blend/ags_blend.o \
 	plugins/ags_clipboard/ags_clipboard.o \
diff --git a/engines/ags/plugins/core/core.cpp b/engines/ags/plugins/core/core.cpp
index d3cd116cb0..31d2b52a83 100644
--- a/engines/ags/plugins/core/core.cpp
+++ b/engines/ags/plugins/core/core.cpp
@@ -36,6 +36,8 @@ void EngineExports::AGS_EngineStartup(IAGSEngine *engine) {
 	_dialogOptionsRenderingInfo.AGS_EngineStartup(engine);
 	_drawingSurface.AGS_EngineStartup(engine);
 	_dynamicSprite.AGS_EngineStartup(engine);
+	_file.AGS_EngineStartup(engine);
+	_game.AGS_EngineStartup(engine);
 }
 
 } // namespace Core
diff --git a/engines/ags/plugins/core/core.h b/engines/ags/plugins/core/core.h
index 86811e540f..cc9870789b 100644
--- a/engines/ags/plugins/core/core.h
+++ b/engines/ags/plugins/core/core.h
@@ -32,6 +32,8 @@
 #include "ags/plugins/core/dialog_options_rendering_info.h"
 #include "ags/plugins/core/drawing_surface.h"
 #include "ags/plugins/core/dynamic_sprite.h"
+#include "ags/plugins/core/file.h"
+#include "ags/plugins/core/game.h"
 
 namespace AGS3 {
 namespace Plugins {
@@ -48,6 +50,8 @@ private:
 	DialogOptionsRenderingInfo _dialogOptionsRenderingInfo;
 	DrawingSurface _drawingSurface;
 	DynamicSprite _dynamicSprite;
+	File _file;
+	Game _game;
 
 public:
 	void AGS_EngineStartup(IAGSEngine *engine);
diff --git a/engines/ags/plugins/core/file.cpp b/engines/ags/plugins/core/file.cpp
new file mode 100644
index 0000000000..f8c82f96f0
--- /dev/null
+++ b/engines/ags/plugins/core/file.cpp
@@ -0,0 +1,135 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ags/plugins/core/file.h"
+#include "ags/engine/ac/file.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+void File::AGS_EngineStartup(IAGSEngine *engine) {
+	SCRIPT_METHOD_EXT(File::Delete^1, Delete);
+	SCRIPT_METHOD_EXT(File::Exists^1, Exists);
+	SCRIPT_METHOD_EXT(File::Open^2, OpenFile);
+	SCRIPT_METHOD_EXT(File::Close^0, Close);
+	SCRIPT_METHOD_EXT(File::ReadInt^0, ReadInt);
+	SCRIPT_METHOD_EXT(File::ReadRawChar^0, ReadRawChar);
+	SCRIPT_METHOD_EXT(File::ReadRawInt^0, ReadRawInt);
+	SCRIPT_METHOD_EXT(File::ReadRawLine^1, ReadRawLine);
+	SCRIPT_METHOD_EXT(File::ReadRawLineBack^0, ReadRawLineBack);
+	SCRIPT_METHOD_EXT(File::ReadString^1, ReadString);
+	SCRIPT_METHOD_EXT(File::ReadStringBack^0, ReadStringBack);
+	SCRIPT_METHOD_EXT(File::WriteInt^1, WriteInt);
+	SCRIPT_METHOD_EXT(File::WriteRawChar^1, WriteRawChar);
+	SCRIPT_METHOD_EXT(File::WriteRawLine^1, WriteRawLine);
+	SCRIPT_METHOD_EXT(File::WriteString^1, WriteString);
+	SCRIPT_METHOD_EXT(File::get_EOF, GetEOF);
+	SCRIPT_METHOD_EXT(File::get_Error, GetError);
+}
+
+void File::Delete(ScriptMethodParams &params) {
+	PARAMS1(const char *, fnmm);
+	params._result = AGS3::File_Delete(fnmm);
+}
+
+void File::Exists(ScriptMethodParams &params) {
+	PARAMS1(const char *, fnmm);
+	params._result = AGS3::File_Exists(fnmm);
+}
+
+void File::OpenFile(ScriptMethodParams &params) {
+}
+
+void File::Close(ScriptMethodParams &params) {
+	PARAMS1(sc_File *, fil);
+	AGS3::File_Close(fil);
+}
+
+void File::ReadInt(ScriptMethodParams &params) {
+	PARAMS1(sc_File *, fil);
+	params._result = AGS3::File_ReadInt(fil);
+}
+
+void File::ReadRawChar(ScriptMethodParams &params) {
+	PARAMS1(sc_File *, fil);
+	params._result = AGS3::File_ReadRawChar(fil);
+}
+
+void File::ReadRawInt(ScriptMethodParams &params) {
+	PARAMS1(sc_File *, fil);
+	params._result = AGS3::File_ReadRawInt(fil);
+}
+
+void File::ReadRawLine(ScriptMethodParams &params) {
+	PARAMS2(sc_File *, fil, char *, buffer);
+	AGS3::File_ReadRawLine(fil, buffer);
+}
+
+void File::ReadRawLineBack(ScriptMethodParams &params) {
+	PARAMS1(sc_File *, fil);
+	params._result = AGS3::File_ReadRawLineBack(fil);
+}
+
+void File::ReadString(ScriptMethodParams &params) {
+	PARAMS1(sc_File *, fil);
+	params._result = AGS3::File_ReadInt(fil);
+}
+
+void File::ReadStringBack(ScriptMethodParams &params) {
+	PARAMS1(sc_File *, fil);
+	params._result = AGS3::File_ReadStringBack(fil);
+}
+
+void File::WriteInt(ScriptMethodParams &params) {
+	PARAMS2(sc_File *, fil, int, towrite);
+	AGS3::File_WriteInt(fil, towrite);
+}
+
+void File::WriteRawChar(ScriptMethodParams &params) {
+	PARAMS2(sc_File *, fil, int, towrite);
+	AGS3::File_WriteRawChar(fil, towrite);
+}
+
+void File::WriteRawLine(ScriptMethodParams &params) {
+	PARAMS2(sc_File *, fil, const char *, toWrite);
+	AGS3::File_WriteRawLine(fil, toWrite);
+}
+
+void File::WriteString(ScriptMethodParams &params) {
+	PARAMS2(sc_File *, fil, const char *, toWrite);
+	AGS3::File_WriteString(fil, toWrite);
+}
+
+void File::GetEOF(ScriptMethodParams &params) {
+	PARAMS1(sc_File *, fil);
+	params._result = AGS3::File_GetEOF(fil);
+}
+
+void File::GetError(ScriptMethodParams &params) {
+	PARAMS1(sc_File *, fil);
+	params._result = AGS3::File_GetError(fil);
+}
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/core/file.h b/engines/ags/plugins/core/file.h
new file mode 100644
index 0000000000..4c6cfe56b5
--- /dev/null
+++ b/engines/ags/plugins/core/file.h
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef AGS_PLUGINS_CORE_FILE_H
+#define AGS_PLUGINS_CORE_FILE_H
+
+#include "ags/plugins/plugin_base.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+class File : public ScriptContainer {
+public:
+	void AGS_EngineStartup(IAGSEngine *engine);
+
+	static void Delete(ScriptMethodParams &params);
+	static void Exists(ScriptMethodParams &params);
+	static void OpenFile(ScriptMethodParams &params);
+	static void Close(ScriptMethodParams &params);
+	static void ReadInt(ScriptMethodParams &params);
+	static void ReadRawChar(ScriptMethodParams &params);
+	static void ReadRawInt(ScriptMethodParams &params);
+	static void ReadRawLine(ScriptMethodParams &params);
+	static void ReadRawLineBack(ScriptMethodParams &params);
+	static void ReadString(ScriptMethodParams &params);
+	static void ReadStringBack(ScriptMethodParams &params);
+	static void WriteInt(ScriptMethodParams &params);
+	static void WriteRawChar(ScriptMethodParams &params);
+	static void WriteRawLine(ScriptMethodParams &params);
+	static void WriteString(ScriptMethodParams &params);
+	static void GetEOF(ScriptMethodParams &params);
+	static void GetError(ScriptMethodParams &params);
+};
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
+
+#endif
diff --git a/engines/ags/plugins/core/game.cpp b/engines/ags/plugins/core/game.cpp
new file mode 100644
index 0000000000..616171cd06
--- /dev/null
+++ b/engines/ags/plugins/core/game.cpp
@@ -0,0 +1,300 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ags/plugins/core/game.h"
+#include "ags/engine/ac/game.h"
+#include "ags/engine/ac/global_audio.h"
+#include "ags/engine/ac/global_game.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+void Game::AGS_EngineStartup(IAGSEngine *engine) {
+	SCRIPT_METHOD_EXT(Game::IsAudioPlaying^1, IsAudioPlaying);
+	SCRIPT_METHOD_EXT(Game::SetAudioTypeSpeechVolumeDrop^2, SetAudioTypeSpeechVolumeDrop);
+	SCRIPT_METHOD_EXT(Game::SetAudioTypeVolume^3, SetAudioTypeVolume);
+	SCRIPT_METHOD_EXT(Game::StopAudio^1, StopAudio);
+	SCRIPT_METHOD_EXT(Game::ChangeTranslation^1, ChangeTranslation);
+	SCRIPT_METHOD_EXT(Game::DoOnceOnly^1, DoOnceOnly);
+	SCRIPT_METHOD_EXT(Game::GetColorFromRGB^3, GetColorFromRGB);
+	SCRIPT_METHOD_EXT(Game::GetFrameCountForLoop^2, GetFrameCountForLoop);
+	SCRIPT_METHOD_EXT(Game::GetLocationName^2, GetLocationName);
+	SCRIPT_METHOD_EXT(Game::GetLoopCountForView^1, GetLoopCountForView);
+	SCRIPT_METHOD_EXT(Game::GetMODPattern^0, GetMODPattern);
+	SCRIPT_METHOD_EXT(Game::GetRunNextSettingForLoop^2, GetRunNextSettingForLoop);
+	SCRIPT_METHOD_EXT(Game::GetSaveSlotDescription^1, GetSaveSlotDescription);
+	SCRIPT_METHOD_EXT(Game::GetViewFrame^3, GetViewFrame);
+	SCRIPT_METHOD_EXT(Game::InputBox^1, InputBox);
+	SCRIPT_METHOD_EXT(Game::SetSaveGameDirectory^1, SetSaveGameDirectory);
+	SCRIPT_METHOD_EXT(Game::StopSound^1, StopAllSounds);
+	SCRIPT_METHOD_EXT(Game::get_CharacterCount, GetCharacterCount);
+	SCRIPT_METHOD_EXT(Game::get_DialogCount, GetDialogCount);
+	SCRIPT_METHOD_EXT(Game::get_FileName, GetFileName);
+	SCRIPT_METHOD_EXT(Game::get_FontCount, GetFontCount);
+	SCRIPT_METHOD_EXT(Game::geti_GlobalMessages, GetGlobalMessages);
+	SCRIPT_METHOD_EXT(Game::geti_GlobalStrings, GetGlobalStrings);
+	SCRIPT_METHOD_EXT(Game::seti_GlobalStrings, SetGlobalString);
+	SCRIPT_METHOD_EXT(Game::get_GUICount, GetGUICount);
+	SCRIPT_METHOD_EXT(Game::get_IgnoreUserInputAfterTextTimeoutMs, GetIgnoreUserInputAfterTextTimeoutMs);
+	SCRIPT_METHOD_EXT(Game::set_IgnoreUserInputAfterTextTimeoutMs, SetIgnoreUserInputAfterTextTimeoutMs);
+	SCRIPT_METHOD_EXT(Game::get_InSkippableCutscene, GetInSkippableCutscene);
+	SCRIPT_METHOD_EXT(Game::get_InventoryItemCount, GetInventoryItemCount);
+	SCRIPT_METHOD_EXT(Game::get_MinimumTextDisplayTimeMs, GetMinimumTextDisplayTimeMs);
+	SCRIPT_METHOD_EXT(Game::set_MinimumTextDisplayTimeMs, SetMinimumTextDisplayTimeMs);
+	SCRIPT_METHOD_EXT(Game::get_MouseCursorCount, GetMouseCursorCount);
+	SCRIPT_METHOD_EXT(Game::get_Name, GetName);
+	SCRIPT_METHOD_EXT(Game::set_Name, SetName);
+	SCRIPT_METHOD_EXT(Game::get_NormalFont, GetNormalFont);
+	SCRIPT_METHOD_EXT(Game::set_NormalFont, SetNormalFont);
+	SCRIPT_METHOD_EXT(Game::get_SkippingCutscene, GetSkippingCutscene);
+	SCRIPT_METHOD_EXT(Game::get_SpeechFont, GetSpeechFont);
+	SCRIPT_METHOD_EXT(Game::set_SpeechFont, SetSpeechFont);
+	SCRIPT_METHOD_EXT(Game::geti_SpriteWidth, GetSpriteWidth);
+	SCRIPT_METHOD_EXT(Game::geti_SpriteHeight, GetSpriteHeight);
+	SCRIPT_METHOD_EXT(Game::get_TextReadingSpeed, GetTextReadingSpeed);
+	SCRIPT_METHOD_EXT(Game::set_TextReadingSpeed, SetTextReadingSpeed);
+	SCRIPT_METHOD_EXT(Game::get_TranslationFilename, GetTranslationFilename);
+	SCRIPT_METHOD_EXT(Game::get_UseNativeCoordinates, GetUseNativeCoordinates);
+	SCRIPT_METHOD_EXT(Game::get_ViewCount, GetViewCount);
+	SCRIPT_METHOD_EXT(Game::PlayVoiceClip, PlayVoiceClip);
+}
+
+void Game::IsAudioPlaying(ScriptMethodParams &params) {
+	PARAMS1(int, audioType);
+	params._result = AGS3::Game_IsAudioPlaying(audioType);
+}
+
+void Game::SetAudioTypeSpeechVolumeDrop(ScriptMethodParams &params) {
+	PARAMS2(int, audioType, int, volumeDrop);
+	AGS3::Game_SetAudioTypeSpeechVolumeDrop(audioType, volumeDrop);
+}
+
+void Game::SetAudioTypeVolume(ScriptMethodParams &params) {
+	PARAMS3(int, audioType, int, volume, int, changeType);
+	AGS3::Game_SetAudioTypeVolume(audioType, volume, changeType);
+}
+
+void Game::StopAudio(ScriptMethodParams &params) {
+	PARAMS1(int, audioType);
+	AGS3::Game_StopAudio(audioType);
+}
+
+void Game::ChangeTranslation(ScriptMethodParams &params) {
+	PARAMS1(const char *, newFilename);
+	params._result = AGS3::Game_ChangeTranslation(newFilename);
+}
+
+void Game::DoOnceOnly(ScriptMethodParams &params) {
+	PARAMS1(const char *, token);
+	params._result = AGS3::Game_DoOnceOnly(token);
+}
+
+void Game::GetColorFromRGB(ScriptMethodParams &params) {
+	PARAMS3(int, red, int, grn, int, blu);
+	params._result = AGS3::Game_GetColorFromRGB(red, grn, blu);
+}
+
+void Game::GetFrameCountForLoop(ScriptMethodParams &params) {
+	PARAMS2(int, viewNumber, int, loopNumber);
+	params._result = AGS3::Game_GetFrameCountForLoop(viewNumber, loopNumber);
+}
+
+void Game::GetLocationName(ScriptMethodParams &params) {
+	PARAMS2(int, x, int, y);
+	params._result = AGS3::Game_GetLocationName(x, y);
+}
+
+void Game::GetLoopCountForView(ScriptMethodParams &params) {
+	PARAMS1(int, viewNumber);
+	params._result = AGS3::Game_GetLoopCountForView(viewNumber);
+}
+
+void Game::GetMODPattern(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetMODPattern();
+}
+
+void Game::GetRunNextSettingForLoop(ScriptMethodParams &params) {
+	PARAMS2(int, viewNumber, int, loopNumber);
+	params._result = AGS3::Game_GetRunNextSettingForLoop(viewNumber, loopNumber);
+}
+
+void Game::GetSaveSlotDescription(ScriptMethodParams &params) {
+	PARAMS1(int, slnum);
+	params._result = AGS3::Game_GetSaveSlotDescription(slnum);
+}
+
+void Game::GetViewFrame(ScriptMethodParams &params) {
+	PARAMS3(int, viewNumber, int, loopNumber, int, frame);
+	params._result = AGS3::Game_GetViewFrame(viewNumber, loopNumber, frame);
+}
+
+void Game::InputBox(ScriptMethodParams &params) {
+	PARAMS1(const char *, msg);
+	params._result = AGS3::Game_InputBox(msg);
+}
+
+void Game::SetSaveGameDirectory(ScriptMethodParams &params) {
+	PARAMS1(const char *, newFolder);
+	params._result = AGS3::Game_SetSaveGameDirectory(newFolder);
+}
+
+void Game::StopAllSounds(ScriptMethodParams &params) {
+	PARAMS1(int, evenAmbient);
+	AGS3::StopAllSounds(evenAmbient);
+}
+
+void Game::GetCharacterCount(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetCharacterCount();
+}
+
+void Game::GetDialogCount(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetDialogCount();
+}
+
+void Game::GetFileName(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetFileName();
+}
+
+void Game::GetFontCount(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetFontCount();
+}
+
+void Game::GetGlobalMessages(ScriptMethodParams &params) {
+	PARAMS1(int, index);
+	params._result = AGS3::Game_GetGlobalMessages(index);
+}
+
+void Game::GetGlobalStrings(ScriptMethodParams &params) {
+	PARAMS1(int, index);
+	params._result = AGS3::Game_GetGlobalStrings(index);
+}
+
+void Game::SetGlobalString(ScriptMethodParams &params) {
+	PARAMS2(int, index, const char *, newVal);
+	AGS3::SetGlobalString(index, newVal);
+}
+
+void Game::GetGUICount(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetGUICount();
+}
+
+void Game::GetIgnoreUserInputAfterTextTimeoutMs(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetIgnoreUserInputAfterTextTimeoutMs();
+}
+
+void Game::SetIgnoreUserInputAfterTextTimeoutMs(ScriptMethodParams &params) {
+	PARAMS1(int, newValueMs);
+	AGS3::Game_SetIgnoreUserInputAfterTextTimeoutMs(newValueMs);
+}
+
+void Game::GetInSkippableCutscene(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetInSkippableCutscene();
+}
+
+void Game::GetInventoryItemCount(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetInventoryItemCount();
+}
+
+void Game::GetMinimumTextDisplayTimeMs(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetMinimumTextDisplayTimeMs();
+}
+
+void Game::SetMinimumTextDisplayTimeMs(ScriptMethodParams &params) {
+	PARAMS1(int, newTextMinTime);
+	AGS3::Game_SetMinimumTextDisplayTimeMs(newTextMinTime);
+}
+
+void Game::GetMouseCursorCount(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetMouseCursorCount();
+}
+
+void Game::GetName(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetName();
+}
+
+void Game::SetName(ScriptMethodParams &params) {
+	PARAMS1(const char *, newName);
+	AGS3::Game_SetName(newName);
+}
+
+void Game::GetNormalFont(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetNormalFont();
+}
+
+void Game::SetNormalFont(ScriptMethodParams &params) {
+	PARAMS1(int, fontNum);
+	AGS3::SetNormalFont(fontNum);
+}
+
+void Game::GetSkippingCutscene(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetName();
+}
+
+void Game::GetSpeechFont(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetSpeechFont();
+}
+
+void Game::SetSpeechFont(ScriptMethodParams &params) {
+	PARAMS1(int, fontNum);
+	AGS3::SetSpeechFont(fontNum);
+}
+
+void Game::GetSpriteWidth(ScriptMethodParams &params) {
+	PARAMS1(int, spriteNum);
+	params._result = AGS3::Game_GetSpriteWidth(spriteNum);
+}
+
+void Game::GetSpriteHeight(ScriptMethodParams &params) {
+	PARAMS1(int, spriteNum);
+	params._result = AGS3::Game_GetSpriteHeight(spriteNum);
+}
+
+void Game::GetTextReadingSpeed(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetTextReadingSpeed();
+}
+
+void Game::SetTextReadingSpeed(ScriptMethodParams &params) {
+	PARAMS1(int, newTextSpeed);
+	AGS3::Game_SetTextReadingSpeed(newTextSpeed);
+}
+
+void Game::GetTranslationFilename(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetTranslationFilename();
+}
+
+void Game::GetUseNativeCoordinates(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetUseNativeCoordinates();
+}
+
+void Game::GetViewCount(ScriptMethodParams &params) {
+	params._result = AGS3::Game_GetViewCount();
+}
+
+void Game::PlayVoiceClip(ScriptMethodParams &params) {
+	PARAMS3(CharacterInfo *, ch, int, sndid, bool, as_speech);
+	params._result = AGS3::PlayVoiceClip(ch, sndid, as_speech);
+}
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/core/game.h b/engines/ags/plugins/core/game.h
new file mode 100644
index 0000000000..837c54aa46
--- /dev/null
+++ b/engines/ags/plugins/core/game.h
@@ -0,0 +1,89 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef AGS_PLUGINS_CORE_GAME_H
+#define AGS_PLUGINS_CORE_GAME_H
+
+#include "ags/plugins/plugin_base.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+class Game : public ScriptContainer {
+public:
+	void AGS_EngineStartup(IAGSEngine *engine);
+
+	static void IsAudioPlaying(ScriptMethodParams &params);
+	static void SetAudioTypeSpeechVolumeDrop(ScriptMethodParams &params);
+	static void SetAudioTypeVolume(ScriptMethodParams &params);
+	static void StopAudio(ScriptMethodParams &params);
+	static void ChangeTranslation(ScriptMethodParams &params);
+	static void DoOnceOnly(ScriptMethodParams &params);
+	static void GetColorFromRGB(ScriptMethodParams &params);
+	static void GetFrameCountForLoop(ScriptMethodParams &params);
+	static void GetLocationName(ScriptMethodParams &params);
+	static void GetLoopCountForView(ScriptMethodParams &params);
+	static void GetMODPattern(ScriptMethodParams &params);
+	static void GetRunNextSettingForLoop(ScriptMethodParams &params);
+	static void GetSaveSlotDescription(ScriptMethodParams &params);
+	static void GetViewFrame(ScriptMethodParams &params);
+	static void InputBox(ScriptMethodParams &params);
+	static void SetSaveGameDirectory(ScriptMethodParams &params);
+	static void StopAllSounds(ScriptMethodParams &params);
+	static void GetCharacterCount(ScriptMethodParams &params);
+	static void GetDialogCount(ScriptMethodParams &params);
+	static void GetFileName(ScriptMethodParams &params);
+	static void GetFontCount(ScriptMethodParams &params);
+	static void GetGlobalMessages(ScriptMethodParams &params);
+	static void GetGlobalStrings(ScriptMethodParams &params);
+	static void SetGlobalString(ScriptMethodParams &params);
+	static void GetGUICount(ScriptMethodParams &params);
+	static void GetIgnoreUserInputAfterTextTimeoutMs(ScriptMethodParams &params);
+	static void SetIgnoreUserInputAfterTextTimeoutMs(ScriptMethodParams &params);
+	static void GetInSkippableCutscene(ScriptMethodParams &params);
+	static void GetInventoryItemCount(ScriptMethodParams &params);
+	static void GetMinimumTextDisplayTimeMs(ScriptMethodParams &params);
+	static void SetMinimumTextDisplayTimeMs(ScriptMethodParams &params);
+	static void GetMouseCursorCount(ScriptMethodParams &params);
+	static void GetName(ScriptMethodParams &params);
+	static void SetName(ScriptMethodParams &params);
+	static void GetNormalFont(ScriptMethodParams &params);
+	static void SetNormalFont(ScriptMethodParams &params);
+	static void GetSkippingCutscene(ScriptMethodParams &params);
+	static void GetSpeechFont(ScriptMethodParams &params);
+	static void SetSpeechFont(ScriptMethodParams &params);
+	static void GetSpriteWidth(ScriptMethodParams &params);
+	static void GetSpriteHeight(ScriptMethodParams &params);
+	static void GetTextReadingSpeed(ScriptMethodParams &params);
+	static void SetTextReadingSpeed(ScriptMethodParams &params);
+	static void GetTranslationFilename(ScriptMethodParams &params);
+	static void GetUseNativeCoordinates(ScriptMethodParams &params);
+	static void GetViewCount(ScriptMethodParams &params);
+	static void PlayVoiceClip(ScriptMethodParams &params);
+};
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
+
+#endif


Commit: 9e7a459d387b6735832bd5d92656dd811185a08e
    https://github.com/scummvm/scummvm/commit/9e7a459d387b6735832bd5d92656dd811185a08e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-07-16T19:48:14-07:00

Commit Message:
AGS: In-progress shifting GlobalAPI to plugins/core/

Changed paths:
  A engines/ags/plugins/core/global_api.cpp
  A engines/ags/plugins/core/global_api.h
    engines/ags/engine/ac/global_api.cpp
    engines/ags/module.mk
    engines/ags/plugins/core/core.cpp
    engines/ags/plugins/core/core.h


diff --git a/engines/ags/engine/ac/global_api.cpp b/engines/ags/engine/ac/global_api.cpp
index 52c99ffa56..5cc1c35994 100644
--- a/engines/ags/engine/ac/global_api.cpp
+++ b/engines/ags/engine/ac/global_api.cpp
@@ -1867,73 +1867,6 @@ RuntimeScriptValue Sc_WaitMouseKey(const RuntimeScriptValue *params, int32_t par
 	API_SCALL_INT_PINT(WaitMouseKey);
 }
 
-//=============================================================================
-//
-// Exclusive API for Plugins
-//
-//=============================================================================
-
-// void (char*texx, ...)
-void ScPl_sc_AbortGame(const char *texx, ...) {
-	API_PLUGIN_SCRIPT_SPRINTF(texx);
-	_sc_AbortGame(scsf_buffer);
-}
-
-// int (int xx,int yy,int wii,int fontid,int clr,char*texx, ...)
-int ScPl_CreateTextOverlay(int xx, int yy, int wii, int fontid, int clr, char *texx, ...) {
-	API_PLUGIN_SCRIPT_SPRINTF(texx);
-	return CreateTextOverlay(xx, yy, wii, fontid, clr, scsf_buffer, DISPLAYTEXT_NORMALOVERLAY);
-}
-
-// void (char*texx, ...)
-void ScPl_Display(char *texx, ...) {
-	API_PLUGIN_SCRIPT_SPRINTF(texx);
-	DisplaySimple(scsf_buffer);
-}
-
-// void (int xxp,int yyp,int widd,char*texx, ...)
-void ScPl_DisplayAt(int xxp, int yyp, int widd, char *texx, ...) {
-	API_PLUGIN_SCRIPT_SPRINTF(texx);
-	DisplayAt(xxp, yyp, widd, scsf_buffer);
-}
-
-// void (int chid,char*texx, ...)
-void ScPl_sc_displayspeech(int chid, char *texx, ...) {
-	API_PLUGIN_SCRIPT_SPRINTF(texx);
-	__sc_displayspeech(chid, scsf_buffer);
-}
-
-// void (int chid, const char*texx, ...)
-void ScPl_DisplayThought(int chid, const char *texx, ...) {
-	API_PLUGIN_SCRIPT_SPRINTF(texx);
-	DisplayThought(chid, scsf_buffer);
-}
-
-// void (int ypos, int ttexcol, int backcol, char *title, char*texx, ...)
-void ScPl_DisplayTopBar(int ypos, int ttexcol, int backcol, char *title, char *texx, ...) {
-	API_PLUGIN_SCRIPT_SPRINTF(texx);
-	DisplayTopBar(ypos, ttexcol, backcol, title, scsf_buffer);
-}
-
-// void  (int xx, int yy, char*texx, ...)
-void ScPl_RawPrint(int xx, int yy, char *texx, ...) {
-	API_PLUGIN_SCRIPT_SPRINTF(texx);
-	RawPrint(xx, yy, scsf_buffer);
-}
-
-// void (int ovrid,int xx,int yy,int wii,int fontid,int clr,char*texx,...)
-void ScPl_SetTextOverlay(int ovrid, int xx, int yy, int wii, int fontid, int clr, char *texx, ...) {
-	API_PLUGIN_SCRIPT_SPRINTF(texx);
-	SetTextOverlay(ovrid, xx, yy, wii, fontid, clr, scsf_buffer);
-}
-
-// void (char*destt, const char*texx, ...);
-void ScPl_sc_sprintf(char *destt, const char *texx, ...) {
-	API_PLUGIN_SCRIPT_SPRINTF(texx);
-	_sc_strcpy(destt, scsf_buffer);
-}
-
-
 void RegisterGlobalAPI() {
 	ccAddExternalStaticFunction("AbortGame",                Sc_sc_AbortGame);
 	ccAddExternalStaticFunction("AddInventory",             Sc_add_inventory);
@@ -2303,374 +2236,6 @@ void RegisterGlobalAPI() {
 	ccAddExternalStaticFunction("Wait",                     Sc_scrWait);
 	ccAddExternalStaticFunction("WaitKey",                  Sc_WaitKey);
 	ccAddExternalStaticFunction("WaitMouseKey",             Sc_WaitMouseKey);
-
-	/* ----------------------- Registering unsafe exports for plugins -----------------------*/
-
-	ccAddExternalFunctionForPlugin("AbortGame", (void *)ScPl_sc_AbortGame);
-	ccAddExternalFunctionForPlugin("AddInventory", (void *)add_inventory);
-	ccAddExternalFunctionForPlugin("AddInventoryToCharacter", (void *)AddInventoryToCharacter);
-	ccAddExternalFunctionForPlugin("AnimateButton", (void *)AnimateButton);
-	ccAddExternalFunctionForPlugin("AnimateCharacter", (void *)scAnimateCharacter);
-	ccAddExternalFunctionForPlugin("AnimateCharacterEx", (void *)AnimateCharacterEx);
-	ccAddExternalFunctionForPlugin("AnimateObject", (void *)AnimateObject);
-	ccAddExternalFunctionForPlugin("AnimateObjectEx", (void *)AnimateObjectEx);
-	ccAddExternalFunctionForPlugin("AreCharactersColliding", (void *)AreCharactersColliding);
-	ccAddExternalFunctionForPlugin("AreCharObjColliding", (void *)AreCharObjColliding);
-	ccAddExternalFunctionForPlugin("AreObjectsColliding", (void *)AreObjectsColliding);
-	ccAddExternalFunctionForPlugin("AreThingsOverlapping", (void *)AreThingsOverlapping);
-	ccAddExternalFunctionForPlugin("CallRoomScript", (void *)CallRoomScript);
-	ccAddExternalFunctionForPlugin("CDAudio", (void *)cd_manager);
-	ccAddExternalFunctionForPlugin("CentreGUI", (void *)CentreGUI);
-	ccAddExternalFunctionForPlugin("ChangeCharacterView", (void *)ChangeCharacterView);
-	ccAddExternalFunctionForPlugin("ChangeCursorGraphic", (void *)ChangeCursorGraphic);
-	ccAddExternalFunctionForPlugin("ChangeCursorHotspot", (void *)ChangeCursorHotspot);
-	ccAddExternalFunctionForPlugin("ClaimEvent", (void *)ClaimEvent);
-	ccAddExternalFunctionForPlugin("CreateGraphicOverlay", (void *)CreateGraphicOverlay);
-	ccAddExternalFunctionForPlugin("CreateTextOverlay", (void *)ScPl_CreateTextOverlay);
-	ccAddExternalFunctionForPlugin("CyclePalette", (void *)CyclePalette);
-	ccAddExternalFunctionForPlugin("Debug", (void *)script_debug);
-	ccAddExternalFunctionForPlugin("DeleteSaveSlot", (void *)DeleteSaveSlot);
-	ccAddExternalFunctionForPlugin("DeleteSprite", (void *)free_dynamic_sprite);
-	ccAddExternalFunctionForPlugin("DisableCursorMode", (void *)disable_cursor_mode);
-	ccAddExternalFunctionForPlugin("DisableGroundLevelAreas", (void *)DisableGroundLevelAreas);
-	ccAddExternalFunctionForPlugin("DisableHotspot", (void *)DisableHotspot);
-	ccAddExternalFunctionForPlugin("DisableInterface", (void *)DisableInterface);
-	ccAddExternalFunctionForPlugin("DisableRegion", (void *)DisableRegion);
-	ccAddExternalFunctionForPlugin("Display", (void *)ScPl_Display);
-	ccAddExternalFunctionForPlugin("DisplayAt", (void *)ScPl_DisplayAt);
-	ccAddExternalFunctionForPlugin("DisplayAtY", (void *)DisplayAtY);
-	ccAddExternalFunctionForPlugin("DisplayMessage", (void *)DisplayMessage);
-	ccAddExternalFunctionForPlugin("DisplayMessageAtY", (void *)DisplayMessageAtY);
-	ccAddExternalFunctionForPlugin("DisplayMessageBar", (void *)DisplayMessageBar);
-	ccAddExternalFunctionForPlugin("DisplaySpeech", (void *)ScPl_sc_displayspeech);
-	ccAddExternalFunctionForPlugin("DisplaySpeechAt", (void *)DisplaySpeechAt);
-	ccAddExternalFunctionForPlugin("DisplaySpeechBackground", (void *)DisplaySpeechBackground);
-	ccAddExternalFunctionForPlugin("DisplayThought", (void *)ScPl_DisplayThought);
-	ccAddExternalFunctionForPlugin("DisplayTopBar", (void *)ScPl_DisplayTopBar);
-	ccAddExternalFunctionForPlugin("EnableCursorMode", (void *)enable_cursor_mode);
-	ccAddExternalFunctionForPlugin("EnableGroundLevelAreas", (void *)EnableGroundLevelAreas);
-	ccAddExternalFunctionForPlugin("EnableHotspot", (void *)EnableHotspot);
-	ccAddExternalFunctionForPlugin("EnableInterface", (void *)EnableInterface);
-	ccAddExternalFunctionForPlugin("EnableRegion", (void *)EnableRegion);
-	ccAddExternalFunctionForPlugin("EndCutscene", (void *)EndCutscene);
-	ccAddExternalFunctionForPlugin("FaceCharacter", (void *)FaceCharacter);
-	ccAddExternalFunctionForPlugin("FaceLocation", (void *)FaceLocation);
-	ccAddExternalFunctionForPlugin("FadeIn", (void *)FadeIn);
-	ccAddExternalFunctionForPlugin("FadeOut", (void *)my_fade_out);
-	ccAddExternalFunctionForPlugin("FileClose", (void *)FileClose);
-	ccAddExternalFunctionForPlugin("FileIsEOF", (void *)FileIsEOF);
-	ccAddExternalFunctionForPlugin("FileIsError", (void *)FileIsError);
-	// NOTE: FileOpenCMode is a backwards-compatible replacement for old-style global script function FileOpen
-	ccAddExternalFunctionForPlugin("FileOpen", (void *)FileOpenCMode);
-	ccAddExternalFunctionForPlugin("FileRead", (void *)FileRead);
-	ccAddExternalFunctionForPlugin("FileReadInt", (void *)FileReadInt);
-	ccAddExternalFunctionForPlugin("FileReadRawChar", (void *)FileReadRawChar);
-	ccAddExternalFunctionForPlugin("FileReadRawInt", (void *)FileReadRawInt);
-	ccAddExternalFunctionForPlugin("FileWrite", (void *)FileWrite);
-	ccAddExternalFunctionForPlugin("FileWriteInt", (void *)FileWriteInt);
-	ccAddExternalFunctionForPlugin("FileWriteRawChar", (void *)FileWriteRawChar);
-	ccAddExternalFunctionForPlugin("FileWriteRawLine", (void *)FileWriteRawLine);
-	ccAddExternalFunctionForPlugin("FindGUIID", (void *)FindGUIID);
-	ccAddExternalFunctionForPlugin("FlipScreen", (void *)FlipScreen);
-	ccAddExternalFunctionForPlugin("FloatToInt", (void *)FloatToInt);
-	ccAddExternalFunctionForPlugin("FollowCharacter", (void *)FollowCharacter);
-	ccAddExternalFunctionForPlugin("FollowCharacterEx", (void *)FollowCharacterEx);
-	ccAddExternalFunctionForPlugin("GetBackgroundFrame", (void *)GetBackgroundFrame);
-	ccAddExternalFunctionForPlugin("GetButtonPic", (void *)GetButtonPic);
-	ccAddExternalFunctionForPlugin("GetCharacterAt", (void *)GetCharIDAtScreen);
-	ccAddExternalFunctionForPlugin("GetCharacterProperty", (void *)GetCharacterProperty);
-	ccAddExternalFunctionForPlugin("GetCharacterPropertyText", (void *)GetCharacterPropertyText);
-	ccAddExternalFunctionForPlugin("GetCurrentMusic", (void *)GetCurrentMusic);
-	ccAddExternalFunctionForPlugin("GetCursorMode", (void *)GetCursorMode);
-	ccAddExternalFunctionForPlugin("GetDialogOption", (void *)GetDialogOption);
-	ccAddExternalFunctionForPlugin("GetGameOption", (void *)GetGameOption);
-	ccAddExternalFunctionForPlugin("GetGameParameter", (void *)GetGameParameter);
-	ccAddExternalFunctionForPlugin("GetGameSpeed", (void *)GetGameSpeed);
-	ccAddExternalFunctionForPlugin("GetGlobalInt", (void *)GetGlobalInt);
-	ccAddExternalFunctionForPlugin("GetGlobalString", (void *)GetGlobalString);
-	ccAddExternalFunctionForPlugin("GetGraphicalVariable", (void *)GetGraphicalVariable);
-	ccAddExternalFunctionForPlugin("GetGUIAt", (void *)GetGUIAt);
-	ccAddExternalFunctionForPlugin("GetGUIObjectAt", (void *)GetGUIObjectAt);
-	ccAddExternalFunctionForPlugin("GetHotspotAt", (void *)GetHotspotIDAtScreen);
-	ccAddExternalFunctionForPlugin("GetHotspotName", (void *)GetHotspotName);
-	ccAddExternalFunctionForPlugin("GetHotspotPointX", (void *)GetHotspotPointX);
-	ccAddExternalFunctionForPlugin("GetHotspotPointY", (void *)GetHotspotPointY);
-	ccAddExternalFunctionForPlugin("GetHotspotProperty", (void *)GetHotspotProperty);
-	ccAddExternalFunctionForPlugin("GetHotspotPropertyText", (void *)GetHotspotPropertyText);
-	ccAddExternalFunctionForPlugin("GetInvAt", (void *)GetInvAt);
-	ccAddExternalFunctionForPlugin("GetInvGraphic", (void *)GetInvGraphic);
-	ccAddExternalFunctionForPlugin("GetInvName", (void *)GetInvName);
-	ccAddExternalFunctionForPlugin("GetInvProperty", (void *)GetInvProperty);
-	ccAddExternalFunctionForPlugin("GetInvPropertyText", (void *)GetInvPropertyText);
-	//ccAddExternalFunctionForPlugin("GetLanguageString",      (void*)GetLanguageString);
-	ccAddExternalFunctionForPlugin("GetLocationName", (void *)GetLocationName);
-	ccAddExternalFunctionForPlugin("GetLocationType", (void *)GetLocationType);
-	ccAddExternalFunctionForPlugin("GetMessageText", (void *)GetMessageText);
-	ccAddExternalFunctionForPlugin("GetMIDIPosition", (void *)GetMIDIPosition);
-	ccAddExternalFunctionForPlugin("GetMP3PosMillis", (void *)GetMP3PosMillis);
-	ccAddExternalFunctionForPlugin("GetObjectAt", (void *)GetObjectIDAtScreen);
-	ccAddExternalFunctionForPlugin("GetObjectBaseline", (void *)GetObjectBaseline);
-	ccAddExternalFunctionForPlugin("GetObjectGraphic", (void *)GetObjectGraphic);
-	ccAddExternalFunctionForPlugin("GetObjectName", (void *)GetObjectName);
-	ccAddExternalFunctionForPlugin("GetObjectProperty", (void *)GetObjectProperty);
-	ccAddExternalFunctionForPlugin("GetObjectPropertyText", (void *)GetObjectPropertyText);
-	ccAddExternalFunctionForPlugin("GetObjectX", (void *)GetObjectX);
-	ccAddExternalFunctionForPlugin("GetObjectY", (void *)GetObjectY);
-	//  ccAddExternalFunctionForPlugin("GetPalette",           (void*)scGetPal);
-	ccAddExternalFunctionForPlugin("GetPlayerCharacter", (void *)GetPlayerCharacter);
-	ccAddExternalFunctionForPlugin("GetRawTime", (void *)GetRawTime);
-	ccAddExternalFunctionForPlugin("GetRegionAt", (void *)GetRegionIDAtRoom);
-	ccAddExternalFunctionForPlugin("GetRoomProperty", (void *)Room_GetProperty);
-	ccAddExternalFunctionForPlugin("GetRoomPropertyText", (void *)GetRoomPropertyText);
-	ccAddExternalFunctionForPlugin("GetSaveSlotDescription", (void *)GetSaveSlotDescription);
-	ccAddExternalFunctionForPlugin("GetScalingAt", (void *)GetScalingAt);
-	ccAddExternalFunctionForPlugin("GetSliderValue", (void *)GetSliderValue);
-	ccAddExternalFunctionForPlugin("GetTextBoxText", (void *)GetTextBoxText);
-	ccAddExternalFunctionForPlugin("GetTextHeight", (void *)GetTextHeight);
-	ccAddExternalFunctionForPlugin("GetTextWidth", (void *)GetTextWidth);
-	ccAddExternalFunctionForPlugin("GetTime", (void *)sc_GetTime);
-	ccAddExternalFunctionForPlugin("GetTranslation", (void *)get_translation);
-	ccAddExternalFunctionForPlugin("GetTranslationName", (void *)GetTranslationName);
-	ccAddExternalFunctionForPlugin("GetViewportX", (void *)GetViewportX);
-	ccAddExternalFunctionForPlugin("GetViewportY", (void *)GetViewportY);
-	ccAddExternalFunctionForPlugin("GetWalkableAreaAtRoom", (void *)GetWalkableAreaAtRoom);
-	ccAddExternalFunctionForPlugin("GetWalkableAreaAt", (void *)GetWalkableAreaAtScreen);
-	ccAddExternalFunctionForPlugin("GetWalkableAreaAtScreen", (void *)GetWalkableAreaAtScreen);
-	ccAddExternalFunctionForPlugin("GiveScore", (void *)GiveScore);
-	ccAddExternalFunctionForPlugin("HasPlayerBeenInRoom", (void *)HasPlayerBeenInRoom);
-	ccAddExternalFunctionForPlugin("HideMouseCursor", (void *)HideMouseCursor);
-	ccAddExternalFunctionForPlugin("InputBox", (void *)sc_inputbox);
-	ccAddExternalFunctionForPlugin("InterfaceOff", (void *)InterfaceOff);
-	ccAddExternalFunctionForPlugin("InterfaceOn", (void *)InterfaceOn);
-	ccAddExternalFunctionForPlugin("IntToFloat", (void *)IntToFloat);
-	ccAddExternalFunctionForPlugin("InventoryScreen", (void *)sc_invscreen);
-	ccAddExternalFunctionForPlugin("IsButtonDown", (void *)IsButtonDown);
-	ccAddExternalFunctionForPlugin("IsChannelPlaying", (void *)IsChannelPlaying);
-	ccAddExternalFunctionForPlugin("IsGamePaused", (void *)IsGamePaused);
-	ccAddExternalFunctionForPlugin("IsGUIOn", (void *)IsGUIOn);
-	ccAddExternalFunctionForPlugin("IsInteractionAvailable", (void *)IsInteractionAvailable);
-	ccAddExternalFunctionForPlugin("IsInventoryInteractionAvailable", (void *)IsInventoryInteractionAvailable);
-	ccAddExternalFunctionForPlugin("IsInterfaceEnabled", (void *)IsInterfaceEnabled);
-	ccAddExternalFunctionForPlugin("IsKeyPressed", (void *)IsKeyPressed);
-	ccAddExternalFunctionForPlugin("IsMusicPlaying", (void *)IsMusicPlaying);
-	ccAddExternalFunctionForPlugin("IsMusicVoxAvailable", (void *)IsMusicVoxAvailable);
-	ccAddExternalFunctionForPlugin("IsObjectAnimating", (void *)IsObjectAnimating);
-	ccAddExternalFunctionForPlugin("IsObjectMoving", (void *)IsObjectMoving);
-	ccAddExternalFunctionForPlugin("IsObjectOn", (void *)IsObjectOn);
-	ccAddExternalFunctionForPlugin("IsOverlayValid", (void *)IsOverlayValid);
-	ccAddExternalFunctionForPlugin("IsSoundPlaying", (void *)IsSoundPlaying);
-	ccAddExternalFunctionForPlugin("IsTimerExpired", (void *)IsTimerExpired);
-	ccAddExternalFunctionForPlugin("IsTranslationAvailable", (void *)IsTranslationAvailable);
-	ccAddExternalFunctionForPlugin("IsVoxAvailable", (void *)IsVoxAvailable);
-	ccAddExternalFunctionForPlugin("ListBoxAdd", (void *)ListBoxAdd);
-	ccAddExternalFunctionForPlugin("ListBoxClear", (void *)ListBoxClear);
-	ccAddExternalFunctionForPlugin("ListBoxDirList", (void *)ListBoxDirList);
-	ccAddExternalFunctionForPlugin("ListBoxGetItemText", (void *)ListBoxGetItemText);
-	ccAddExternalFunctionForPlugin("ListBoxGetNumItems", (void *)ListBoxGetNumItems);
-	ccAddExternalFunctionForPlugin("ListBoxGetSelected", (void *)ListBoxGetSelected);
-	ccAddExternalFunctionForPlugin("ListBoxRemove", (void *)ListBoxRemove);
-	ccAddExternalFunctionForPlugin("ListBoxSaveGameList", (void *)ListBoxSaveGameList);
-	ccAddExternalFunctionForPlugin("ListBoxSetSelected", (void *)ListBoxSetSelected);
-	ccAddExternalFunctionForPlugin("ListBoxSetTopItem", (void *)ListBoxSetTopItem);
-	ccAddExternalFunctionForPlugin("LoadImageFile", (void *)LoadImageFile);
-	ccAddExternalFunctionForPlugin("LoadSaveSlotScreenshot", (void *)LoadSaveSlotScreenshot);
-	ccAddExternalFunctionForPlugin("LoseInventory", (void *)lose_inventory);
-	ccAddExternalFunctionForPlugin("LoseInventoryFromCharacter", (void *)LoseInventoryFromCharacter);
-	ccAddExternalFunctionForPlugin("MergeObject", (void *)MergeObject);
-	ccAddExternalFunctionForPlugin("MoveCharacter", (void *)MoveCharacter);
-	ccAddExternalFunctionForPlugin("MoveCharacterBlocking", (void *)MoveCharacterBlocking);
-	ccAddExternalFunctionForPlugin("MoveCharacterDirect", (void *)MoveCharacterDirect);
-	ccAddExternalFunctionForPlugin("MoveCharacterPath", (void *)MoveCharacterPath);
-	ccAddExternalFunctionForPlugin("MoveCharacterStraight", (void *)MoveCharacterStraight);
-	ccAddExternalFunctionForPlugin("MoveCharacterToHotspot", (void *)MoveCharacterToHotspot);
-	ccAddExternalFunctionForPlugin("MoveCharacterToObject", (void *)MoveCharacterToObject);
-	ccAddExternalFunctionForPlugin("MoveObject", (void *)MoveObject);
-	ccAddExternalFunctionForPlugin("MoveObjectDirect", (void *)MoveObjectDirect);
-	ccAddExternalFunctionForPlugin("MoveOverlay", (void *)MoveOverlay);
-	ccAddExternalFunctionForPlugin("MoveToWalkableArea", (void *)MoveToWalkableArea);
-	ccAddExternalFunctionForPlugin("NewRoom", (void *)NewRoom);
-	ccAddExternalFunctionForPlugin("NewRoomEx", (void *)NewRoomEx);
-	ccAddExternalFunctionForPlugin("NewRoomNPC", (void *)NewRoomNPC);
-	ccAddExternalFunctionForPlugin("ObjectOff", (void *)ObjectOff);
-	ccAddExternalFunctionForPlugin("ObjectOn", (void *)ObjectOn);
-	ccAddExternalFunctionForPlugin("ParseText", (void *)ParseText);
-	ccAddExternalFunctionForPlugin("PauseGame", (void *)PauseGame);
-	ccAddExternalFunctionForPlugin("PlayAmbientSound", (void *)PlayAmbientSound);
-	ccAddExternalFunctionForPlugin("PlayFlic", (void *)play_flc_file);
-	ccAddExternalFunctionForPlugin("PlayMP3File", (void *)PlayMP3File);
-	ccAddExternalFunctionForPlugin("PlayMusic", (void *)PlayMusicResetQueue);
-	ccAddExternalFunctionForPlugin("PlayMusicQueued", (void *)PlayMusicQueued);
-	ccAddExternalFunctionForPlugin("PlaySilentMIDI", (void *)PlaySilentMIDI);
-	ccAddExternalFunctionForPlugin("PlaySound", (void *)play_sound);
-	ccAddExternalFunctionForPlugin("PlaySoundEx", (void *)PlaySoundEx);
-	ccAddExternalFunctionForPlugin("PlayVideo", (void *)scrPlayVideo);
-	ccAddExternalFunctionForPlugin("ProcessClick", (void *)RoomProcessClick);
-	ccAddExternalFunctionForPlugin("QuitGame", (void *)QuitGame);
-	ccAddExternalFunctionForPlugin("Random", (void *)__Rand);
-	ccAddExternalFunctionForPlugin("RawClearScreen", (void *)RawClear);
-	ccAddExternalFunctionForPlugin("RawDrawCircle", (void *)RawDrawCircle);
-	ccAddExternalFunctionForPlugin("RawDrawFrameTransparent", (void *)RawDrawFrameTransparent);
-	ccAddExternalFunctionForPlugin("RawDrawImage", (void *)RawDrawImage);
-	ccAddExternalFunctionForPlugin("RawDrawImageOffset", (void *)RawDrawImageOffset);
-	ccAddExternalFunctionForPlugin("RawDrawImageResized", (void *)RawDrawImageResized);
-	ccAddExternalFunctionForPlugin("RawDrawImageTransparent", (void *)RawDrawImageTransparent);
-	ccAddExternalFunctionForPlugin("RawDrawLine", (void *)RawDrawLine);
-	ccAddExternalFunctionForPlugin("RawDrawRectangle", (void *)RawDrawRectangle);
-	ccAddExternalFunctionForPlugin("RawDrawTriangle", (void *)RawDrawTriangle);
-	ccAddExternalFunctionForPlugin("RawPrint", (void *)ScPl_RawPrint);
-	ccAddExternalFunctionForPlugin("RawPrintMessageWrapped", (void *)RawPrintMessageWrapped);
-	ccAddExternalFunctionForPlugin("RawRestoreScreen", (void *)RawRestoreScreen);
-	ccAddExternalFunctionForPlugin("RawRestoreScreenTinted", (void *)RawRestoreScreenTinted);
-	ccAddExternalFunctionForPlugin("RawSaveScreen", (void *)RawSaveScreen);
-	ccAddExternalFunctionForPlugin("RawSetColor", (void *)RawSetColor);
-	ccAddExternalFunctionForPlugin("RawSetColorRGB", (void *)RawSetColorRGB);
-	ccAddExternalFunctionForPlugin("RefreshMouse", (void *)RefreshMouse);
-	ccAddExternalFunctionForPlugin("ReleaseCharacterView", (void *)ReleaseCharacterView);
-	ccAddExternalFunctionForPlugin("ReleaseViewport", (void *)ReleaseViewport);
-	ccAddExternalFunctionForPlugin("RemoveObjectTint", (void *)RemoveObjectTint);
-	ccAddExternalFunctionForPlugin("RemoveOverlay", (void *)RemoveOverlay);
-	ccAddExternalFunctionForPlugin("RemoveWalkableArea", (void *)RemoveWalkableArea);
-	ccAddExternalFunctionForPlugin("ResetRoom", (void *)ResetRoom);
-	ccAddExternalFunctionForPlugin("RestartGame", (void *)restart_game);
-	ccAddExternalFunctionForPlugin("RestoreGameDialog", (void *)restore_game_dialog);
-	ccAddExternalFunctionForPlugin("RestoreGameSlot", (void *)RestoreGameSlot);
-	ccAddExternalFunctionForPlugin("RestoreWalkableArea", (void *)RestoreWalkableArea);
-	ccAddExternalFunctionForPlugin("RunAGSGame", (void *)RunAGSGame);
-	ccAddExternalFunctionForPlugin("RunCharacterInteraction", (void *)RunCharacterInteraction);
-	ccAddExternalFunctionForPlugin("RunDialog", (void *)RunDialog);
-	ccAddExternalFunctionForPlugin("RunHotspotInteraction", (void *)RunHotspotInteraction);
-	ccAddExternalFunctionForPlugin("RunInventoryInteraction", (void *)RunInventoryInteraction);
-	ccAddExternalFunctionForPlugin("RunObjectInteraction", (void *)RunObjectInteraction);
-	ccAddExternalFunctionForPlugin("RunRegionInteraction", (void *)RunRegionInteraction);
-	ccAddExternalFunctionForPlugin("Said", (void *)Said);
-	ccAddExternalFunctionForPlugin("SaidUnknownWord", (void *)SaidUnknownWord);
-	ccAddExternalFunctionForPlugin("SaveCursorForLocationChange", (void *)SaveCursorForLocationChange);
-	ccAddExternalFunctionForPlugin("SaveGameDialog", (void *)save_game_dialog);
-	ccAddExternalFunctionForPlugin("SaveGameSlot", (void *)save_game);
-	ccAddExternalFunctionForPlugin("SaveScreenShot", (void *)SaveScreenShot);
-	ccAddExternalFunctionForPlugin("SeekMIDIPosition", (void *)SeekMIDIPosition);
-	ccAddExternalFunctionForPlugin("SeekMODPattern", (void *)SeekMODPattern);
-	ccAddExternalFunctionForPlugin("SeekMP3PosMillis", (void *)SeekMP3PosMillis);
-	ccAddExternalFunctionForPlugin("SetActiveInventory", (void *)SetActiveInventory);
-	ccAddExternalFunctionForPlugin("SetAmbientTint", (void *)SetAmbientTint);
-	ccAddExternalFunctionForPlugin("SetAreaLightLevel", (void *)SetAreaLightLevel);
-	ccAddExternalFunctionForPlugin("SetAreaScaling", (void *)SetAreaScaling);
-	ccAddExternalFunctionForPlugin("SetBackgroundFrame", (void *)SetBackgroundFrame);
-	ccAddExternalFunctionForPlugin("SetButtonPic", (void *)SetButtonPic);
-	ccAddExternalFunctionForPlugin("SetButtonText", (void *)SetButtonText);
-	ccAddExternalFunctionForPlugin("SetChannelVolume", (void *)SetChannelVolume);
-	ccAddExternalFunctionForPlugin("SetCharacterBaseline", (void *)SetCharacterBaseline);
-	ccAddExternalFunctionForPlugin("SetCharacterClickable", (void *)SetCharacterClickable);
-	ccAddExternalFunctionForPlugin("SetCharacterFrame", (void *)SetCharacterFrame);
-	ccAddExternalFunctionForPlugin("SetCharacterIdle", (void *)SetCharacterIdle);
-	ccAddExternalFunctionForPlugin("SetCharacterIgnoreLight", (void *)SetCharacterIgnoreLight);
-	ccAddExternalFunctionForPlugin("SetCharacterIgnoreWalkbehinds", (void *)SetCharacterIgnoreWalkbehinds);
-	ccAddExternalFunctionForPlugin("SetCharacterProperty", (void *)SetCharacterProperty);
-	ccAddExternalFunctionForPlugin("SetCharacterBlinkView", (void *)SetCharacterBlinkView);
-	ccAddExternalFunctionForPlugin("SetCharacterSpeechView", (void *)SetCharacterSpeechView);
-	ccAddExternalFunctionForPlugin("SetCharacterSpeed", (void *)SetCharacterSpeed);
-	ccAddExternalFunctionForPlugin("SetCharacterSpeedEx", (void *)SetCharacterSpeedEx);
-	ccAddExternalFunctionForPlugin("SetCharacterTransparency", (void *)SetCharacterTransparency);
-	ccAddExternalFunctionForPlugin("SetCharacterView", (void *)SetCharacterView);
-	ccAddExternalFunctionForPlugin("SetCharacterViewEx", (void *)SetCharacterViewEx);
-	ccAddExternalFunctionForPlugin("SetCharacterViewOffset", (void *)SetCharacterViewOffset);
-	ccAddExternalFunctionForPlugin("SetCursorMode", (void *)set_cursor_mode);
-	ccAddExternalFunctionForPlugin("SetDefaultCursor", (void *)set_default_cursor);
-	ccAddExternalFunctionForPlugin("SetDialogOption", (void *)SetDialogOption);
-	ccAddExternalFunctionForPlugin("SetDigitalMasterVolume", (void *)SetDigitalMasterVolume);
-	ccAddExternalFunctionForPlugin("SetFadeColor", (void *)SetFadeColor);
-	ccAddExternalFunctionForPlugin("SetFrameSound", (void *)SetFrameSound);
-	ccAddExternalFunctionForPlugin("SetGameOption", (void *)SetGameOption);
-	ccAddExternalFunctionForPlugin("SetGameSpeed", (void *)SetGameSpeed);
-	ccAddExternalFunctionForPlugin("SetGlobalInt", (void *)SetGlobalInt);
-	ccAddExternalFunctionForPlugin("SetGlobalString", (void *)SetGlobalString);
-	ccAddExternalFunctionForPlugin("SetGraphicalVariable", (void *)SetGraphicalVariable);
-	ccAddExternalFunctionForPlugin("SetGUIBackgroundPic", (void *)SetGUIBackgroundPic);
-	ccAddExternalFunctionForPlugin("SetGUIClickable", (void *)SetGUIClickable);
-	ccAddExternalFunctionForPlugin("SetGUIObjectEnabled", (void *)SetGUIObjectEnabled);
-	ccAddExternalFunctionForPlugin("SetGUIObjectPosition", (void *)SetGUIObjectPosition);
-	ccAddExternalFunctionForPlugin("SetGUIObjectSize", (void *)SetGUIObjectSize);
-	ccAddExternalFunctionForPlugin("SetGUIPosition", (void *)SetGUIPosition);
-	ccAddExternalFunctionForPlugin("SetGUISize", (void *)SetGUISize);
-	ccAddExternalFunctionForPlugin("SetGUITransparency", (void *)SetGUITransparency);
-	ccAddExternalFunctionForPlugin("SetGUIZOrder", (void *)SetGUIZOrder);
-	ccAddExternalFunctionForPlugin("SetInvItemName", (void *)SetInvItemName);
-	ccAddExternalFunctionForPlugin("SetInvItemPic", (void *)set_inv_item_pic);
-	ccAddExternalFunctionForPlugin("SetInvDimensions", (void *)SetInvDimensions);
-	ccAddExternalFunctionForPlugin("SetLabelColor", (void *)SetLabelColor);
-	ccAddExternalFunctionForPlugin("SetLabelFont", (void *)SetLabelFont);
-	ccAddExternalFunctionForPlugin("SetLabelText", (void *)SetLabelText);
-	ccAddExternalFunctionForPlugin("SetMouseBounds", (void *)SetMouseBounds);
-	ccAddExternalFunctionForPlugin("SetMouseCursor", (void *)set_mouse_cursor);
-	ccAddExternalFunctionForPlugin("SetMousePosition", (void *)SetMousePosition);
-	ccAddExternalFunctionForPlugin("SetMultitaskingMode", (void *)SetMultitasking);
-	ccAddExternalFunctionForPlugin("SetMusicMasterVolume", (void *)SetMusicMasterVolume);
-	ccAddExternalFunctionForPlugin("SetMusicRepeat", (void *)SetMusicRepeat);
-	ccAddExternalFunctionForPlugin("SetMusicVolume", (void *)SetMusicVolume);
-	ccAddExternalFunctionForPlugin("SetNextCursorMode", (void *)SetNextCursor);
-	ccAddExternalFunctionForPlugin("SetNextScreenTransition", (void *)SetNextScreenTransition);
-	ccAddExternalFunctionForPlugin("SetNormalFont", (void *)SetNormalFont);
-	ccAddExternalFunctionForPlugin("SetObjectBaseline", (void *)SetObjectBaseline);
-	ccAddExternalFunctionForPlugin("SetObjectClickable", (void *)SetObjectClickable);
-	ccAddExternalFunctionForPlugin("SetObjectFrame", (void *)SetObjectFrame);
-	ccAddExternalFunctionForPlugin("SetObjectGraphic", (void *)SetObjectGraphic);
-	ccAddExternalFunctionForPlugin("SetObjectIgnoreWalkbehinds", (void *)SetObjectIgnoreWalkbehinds);
-	ccAddExternalFunctionForPlugin("SetObjectPosition", (void *)SetObjectPosition);
-	ccAddExternalFunctionForPlugin("SetObjectTint", (void *)SetObjectTint);
-	ccAddExternalFunctionForPlugin("SetObjectTransparency", (void *)SetObjectTransparency);
-	ccAddExternalFunctionForPlugin("SetObjectView", (void *)SetObjectView);
-	//  ccAddExternalFunctionForPlugin("SetPalette",           (void*)scSetPal);
-	ccAddExternalFunctionForPlugin("SetPalRGB", (void *)SetPalRGB);
-	ccAddExternalFunctionForPlugin("SetPlayerCharacter", (void *)SetPlayerCharacter);
-	ccAddExternalFunctionForPlugin("SetRegionTint", (void *)SetRegionTint);
-	ccAddExternalFunctionForPlugin("SetRestartPoint", (void *)SetRestartPoint);
-	ccAddExternalFunctionForPlugin("SetScreenTransition", (void *)SetScreenTransition);
-	ccAddExternalFunctionForPlugin("SetSkipSpeech", (void *)SetSkipSpeech);
-	ccAddExternalFunctionForPlugin("SetSliderValue", (void *)SetSliderValue);
-	ccAddExternalFunctionForPlugin("SetSoundVolume", (void *)SetSoundVolume);
-	ccAddExternalFunctionForPlugin("SetSpeechFont", (void *)SetSpeechFont);
-	ccAddExternalFunctionForPlugin("SetSpeechStyle", (void *)SetSpeechStyle);
-	ccAddExternalFunctionForPlugin("SetSpeechVolume", (void *)SetSpeechVolume);
-	ccAddExternalFunctionForPlugin("SetTalkingColor", (void *)SetTalkingColor);
-	ccAddExternalFunctionForPlugin("SetTextBoxFont", (void *)SetTextBoxFont);
-	ccAddExternalFunctionForPlugin("SetTextBoxText", (void *)SetTextBoxText);
-	ccAddExternalFunctionForPlugin("SetTextOverlay", (void *)ScPl_SetTextOverlay);
-	ccAddExternalFunctionForPlugin("SetTextWindowGUI", (void *)SetTextWindowGUI);
-	ccAddExternalFunctionForPlugin("SetTimer", (void *)script_SetTimer);
-	ccAddExternalFunctionForPlugin("SetViewport", (void *)SetViewport);
-	ccAddExternalFunctionForPlugin("SetVoiceMode", (void *)SetVoiceMode);
-	ccAddExternalFunctionForPlugin("SetWalkBehindBase", (void *)SetWalkBehindBase);
-	ccAddExternalFunctionForPlugin("ShakeScreen", (void *)ShakeScreen);
-	ccAddExternalFunctionForPlugin("ShakeScreenBackground", (void *)ShakeScreenBackground);
-	ccAddExternalFunctionForPlugin("ShowMouseCursor", (void *)ShowMouseCursor);
-	ccAddExternalFunctionForPlugin("SkipUntilCharacterStops", (void *)SkipUntilCharacterStops);
-	ccAddExternalFunctionForPlugin("StartCutscene", (void *)StartCutscene);
-	ccAddExternalFunctionForPlugin("StartRecording", (void *)scStartRecording);
-	ccAddExternalFunctionForPlugin("StopAmbientSound", (void *)StopAmbientSound);
-	ccAddExternalFunctionForPlugin("StopChannel", (void *)stop_and_destroy_channel);
-	ccAddExternalFunctionForPlugin("StopDialog", (void *)StopDialog);
-	ccAddExternalFunctionForPlugin("StopMoving", (void *)StopMoving);
-	ccAddExternalFunctionForPlugin("StopMusic", (void *)scr_StopMusic);
-	ccAddExternalFunctionForPlugin("StopObjectMoving", (void *)StopObjectMoving);
-	ccAddExternalFunctionForPlugin("StrCat", (void *)_sc_strcat);
-	ccAddExternalFunctionForPlugin("StrCaseComp", (void *)ags_stricmp);
-	ccAddExternalFunctionForPlugin("StrComp", (void *)strcmp);
-	ccAddExternalFunctionForPlugin("StrContains", (void *)StrContains);
-	ccAddExternalFunctionForPlugin("StrCopy", (void *)_sc_strcpy);
-	ccAddExternalFunctionForPlugin("StrFormat", (void *)ScPl_sc_sprintf);
-	ccAddExternalFunctionForPlugin("StrGetCharAt", (void *)StrGetCharAt);
-	ccAddExternalFunctionForPlugin("StringToInt", (void *)StringToInt);
-	ccAddExternalFunctionForPlugin("StrLen", (void *)strlen);
-	ccAddExternalFunctionForPlugin("StrSetCharAt", (void *)StrSetCharAt);
-	ccAddExternalFunctionForPlugin("StrToLowerCase", (void *)_sc_strlower);
-	ccAddExternalFunctionForPlugin("StrToUpperCase", (void *)_sc_strupper);
-	ccAddExternalFunctionForPlugin("TintScreen", (void *)TintScreen);
-	ccAddExternalFunctionForPlugin("UnPauseGame", (void *)UnPauseGame);
-	ccAddExternalFunctionForPlugin("UpdateInventory", (void *)update_invorder);
-	ccAddExternalFunctionForPlugin("UpdatePalette", (void *)UpdatePalette);
-	ccAddExternalFunctionForPlugin("Wait", (void *)scrWait);
-	ccAddExternalFunctionForPlugin("WaitKey", (void *)WaitKey);
-	ccAddExternalFunctionForPlugin("WaitMouseKey", (void *)WaitMouseKey);
 }
 
 } // namespace AGS3
diff --git a/engines/ags/module.mk b/engines/ags/module.mk
index 5284f5e048..3232c38b91 100644
--- a/engines/ags/module.mk
+++ b/engines/ags/module.mk
@@ -298,6 +298,7 @@ MODULE_OBJS = \
 	plugins/core/dynamic_sprite.o \
 	plugins/core/file.o \
 	plugins/core/game.o \
+	plugins/core/global_api.o \
 	plugins/ags_agi/ags_agi.o \
 	plugins/ags_blend/ags_blend.o \
 	plugins/ags_clipboard/ags_clipboard.o \
diff --git a/engines/ags/plugins/core/core.cpp b/engines/ags/plugins/core/core.cpp
index 31d2b52a83..856b0c444c 100644
--- a/engines/ags/plugins/core/core.cpp
+++ b/engines/ags/plugins/core/core.cpp
@@ -38,6 +38,7 @@ void EngineExports::AGS_EngineStartup(IAGSEngine *engine) {
 	_dynamicSprite.AGS_EngineStartup(engine);
 	_file.AGS_EngineStartup(engine);
 	_game.AGS_EngineStartup(engine);
+	_globalAPI.AGS_EngineStartup(engine);
 }
 
 } // namespace Core
diff --git a/engines/ags/plugins/core/core.h b/engines/ags/plugins/core/core.h
index cc9870789b..b06a1947e4 100644
--- a/engines/ags/plugins/core/core.h
+++ b/engines/ags/plugins/core/core.h
@@ -34,6 +34,7 @@
 #include "ags/plugins/core/dynamic_sprite.h"
 #include "ags/plugins/core/file.h"
 #include "ags/plugins/core/game.h"
+#include "ags/plugins/core/global_api.h"
 
 namespace AGS3 {
 namespace Plugins {
@@ -52,6 +53,7 @@ private:
 	DynamicSprite _dynamicSprite;
 	File _file;
 	Game _game;
+	GlobalAPI _globalAPI;
 
 public:
 	void AGS_EngineStartup(IAGSEngine *engine);
diff --git a/engines/ags/plugins/core/global_api.cpp b/engines/ags/plugins/core/global_api.cpp
new file mode 100644
index 0000000000..1ac646e1a4
--- /dev/null
+++ b/engines/ags/plugins/core/global_api.cpp
@@ -0,0 +1,1511 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ags/plugins/core/global_api.h"
+#include "ags/engine/ac/cd_audio.h"
+#include "ags/engine/ac/display.h"
+#include "ags/engine/ac/dynamic_sprite.h"
+#include "ags/engine/ac/event.h"
+#include "ags/engine/ac/global_audio.h"
+#include "ags/engine/ac/global_button.h"
+#include "ags/engine/ac/global_character.h"
+#include "ags/engine/ac/global_debug.h"
+#include "ags/engine/ac/global_dialog.h"
+#include "ags/engine/ac/global_display.h"
+#include "ags/engine/ac/global_drawing_surface.h"
+#include "ags/engine/ac/global_file.h"
+#include "ags/engine/ac/global_game.h"
+#include "ags/engine/ac/global_gui.h"
+#include "ags/engine/ac/global_hotspot.h"
+#include "ags/engine/ac/global_inventory_item.h"
+#include "ags/engine/ac/global_object.h"
+#include "ags/engine/ac/global_overlay.h"
+#include "ags/engine/ac/global_palette.h"
+#include "ags/engine/ac/global_region.h"
+#include "ags/engine/ac/global_room.h"
+#include "ags/engine/ac/global_screen.h"
+#include "ags/engine/ac/global_string.h"
+#include "ags/engine/ac/math.h"
+#include "ags/engine/ac/mouse.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+void GlobalAPI::AGS_EngineStartup(IAGSEngine *engine) {
+	SCRIPT_METHOD_EXT(AbortGame, ScPl_sc_AbortGame);
+	SCRIPT_METHOD_EXT(AddInventory, add_inventory);
+	SCRIPT_METHOD_EXT(AddInventoryToCharacter, AddInventoryToCharacter);
+	SCRIPT_METHOD_EXT(AnimateButton, AnimateButton);
+	SCRIPT_METHOD_EXT(AnimateCharacter, scAnimateCharacter);
+	SCRIPT_METHOD_EXT(AnimateCharacterEx, AnimateCharacterEx);
+	SCRIPT_METHOD_EXT(AnimateObject, AnimateObject);
+	SCRIPT_METHOD_EXT(AnimateObjectEx, AnimateObjectEx);
+	SCRIPT_METHOD_EXT(AreCharactersColliding, AreCharactersColliding);
+	SCRIPT_METHOD_EXT(AreCharObjColliding, AreCharObjColliding);
+	SCRIPT_METHOD_EXT(AreObjectsColliding, AreObjectsColliding);
+	SCRIPT_METHOD_EXT(AreThingsOverlapping, AreThingsOverlapping);
+	SCRIPT_METHOD_EXT(CallRoomScript, CallRoomScript);
+	SCRIPT_METHOD_EXT(CDAudio, cd_manager);
+	SCRIPT_METHOD_EXT(CentreGUI, CentreGUI);
+	SCRIPT_METHOD_EXT(ChangeCharacterView, ChangeCharacterView);
+	SCRIPT_METHOD_EXT(ChangeCursorGraphic, ChangeCursorGraphic);
+	SCRIPT_METHOD_EXT(ChangeCursorHotspot, ChangeCursorHotspot);
+	SCRIPT_METHOD_EXT(ClaimEvent, ClaimEvent);
+	SCRIPT_METHOD_EXT(CreateGraphicOverlay, CreateGraphicOverlay);
+	SCRIPT_METHOD_EXT(CreateTextOverlay, ScPl_CreateTextOverlay);
+	SCRIPT_METHOD_EXT(CyclePalette, CyclePalette);
+	SCRIPT_METHOD_EXT(Debug, script_debug);
+	SCRIPT_METHOD_EXT(DeleteSaveSlot, DeleteSaveSlot);
+	SCRIPT_METHOD_EXT(DeleteSprite, free_dynamic_sprite);
+	SCRIPT_METHOD_EXT(DisableCursorMode, disable_cursor_mode);
+	SCRIPT_METHOD_EXT(DisableGroundLevelAreas, DisableGroundLevelAreas);
+	SCRIPT_METHOD_EXT(DisableHotspot, DisableHotspot);
+	SCRIPT_METHOD_EXT(DisableInterface, DisableInterface);
+	SCRIPT_METHOD_EXT(DisableRegion, DisableRegion);
+	SCRIPT_METHOD_EXT(Display, ScPl_Display);
+	SCRIPT_METHOD_EXT(DisplayAt, ScPl_DisplayAt);
+	SCRIPT_METHOD_EXT(DisplayAtY, DisplayAtY);
+	SCRIPT_METHOD_EXT(DisplayMessage, DisplayMessage);
+	SCRIPT_METHOD_EXT(DisplayMessageAtY, DisplayMessageAtY);
+	SCRIPT_METHOD_EXT(DisplayMessageBar, DisplayMessageBar);
+	SCRIPT_METHOD_EXT(DisplaySpeech, ScPl_sc_displayspeech);
+	SCRIPT_METHOD_EXT(DisplaySpeechAt, DisplaySpeechAt);
+	SCRIPT_METHOD_EXT(DisplaySpeechBackground, DisplaySpeechBackground);
+	SCRIPT_METHOD_EXT(DisplayThought, ScPl_DisplayThought);
+	SCRIPT_METHOD_EXT(DisplayTopBar, ScPl_DisplayTopBar);
+	SCRIPT_METHOD_EXT(EnableCursorMode, enable_cursor_mode);
+	SCRIPT_METHOD_EXT(EnableGroundLevelAreas, EnableGroundLevelAreas);
+	SCRIPT_METHOD_EXT(EnableHotspot, EnableHotspot);
+	SCRIPT_METHOD_EXT(EnableInterface, EnableInterface);
+	SCRIPT_METHOD_EXT(EnableRegion, EnableRegion);
+	SCRIPT_METHOD_EXT(EndCutscene, EndCutscene);
+	SCRIPT_METHOD_EXT(FaceCharacter, FaceCharacter);
+	SCRIPT_METHOD_EXT(FaceLocation, FaceLocation);
+	SCRIPT_METHOD_EXT(FadeIn, FadeIn);
+	SCRIPT_METHOD_EXT(FadeOut, my_fade_out);
+	SCRIPT_METHOD_EXT(FileClose, FileClose);
+	SCRIPT_METHOD_EXT(FileIsEOF, FileIsEOF);
+	SCRIPT_METHOD_EXT(FileIsError, FileIsError);
+	// NOTE: FileOpenCMode is a backwards-compatible replacement for old-style global script function FileOpen
+	SCRIPT_METHOD_EXT(FileOpen, FileOpenCMode);
+	SCRIPT_METHOD_EXT(FileRead, FileRead);
+	SCRIPT_METHOD_EXT(FileReadInt, FileReadInt);
+	SCRIPT_METHOD_EXT(FileReadRawChar, FileReadRawChar);
+	SCRIPT_METHOD_EXT(FileReadRawInt, FileReadRawInt);
+	SCRIPT_METHOD_EXT(FileWrite, FileWrite);
+	SCRIPT_METHOD_EXT(FileWriteInt, FileWriteInt);
+	SCRIPT_METHOD_EXT(FileWriteRawChar, FileWriteRawChar);
+	SCRIPT_METHOD_EXT(FileWriteRawLine, FileWriteRawLine);
+	SCRIPT_METHOD_EXT(FindGUIID, FindGUIID);
+	SCRIPT_METHOD_EXT(FlipScreen, FlipScreen);
+	SCRIPT_METHOD_EXT(FloatToInt, FloatToInt);
+	SCRIPT_METHOD_EXT(FollowCharacter, FollowCharacter);
+	SCRIPT_METHOD_EXT(FollowCharacterEx, FollowCharacterEx);
+	SCRIPT_METHOD_EXT(GetBackgroundFrame, GetBackgroundFrame);
+	SCRIPT_METHOD_EXT(GetButtonPic, GetButtonPic);
+	SCRIPT_METHOD_EXT(GetCharacterAt, GetCharIDAtScreen);
+	SCRIPT_METHOD_EXT(GetCharacterProperty, GetCharacterProperty);
+	SCRIPT_METHOD_EXT(GetCharacterPropertyText, GetCharacterPropertyText);
+	SCRIPT_METHOD_EXT(GetCurrentMusic, GetCurrentMusic);
+	SCRIPT_METHOD_EXT(GetCursorMode, GetCursorMode);
+	SCRIPT_METHOD_EXT(GetDialogOption, GetDialogOption);
+	SCRIPT_METHOD_EXT(GetGameOption, GetGameOption);
+	SCRIPT_METHOD_EXT(GetGameParameter, GetGameParameter);
+	SCRIPT_METHOD_EXT(GetGameSpeed, GetGameSpeed);
+	SCRIPT_METHOD_EXT(GetGlobalInt, GetGlobalInt);
+	SCRIPT_METHOD_EXT(GetGlobalString, GetGlobalString);
+	SCRIPT_METHOD_EXT(GetGraphicalVariable, GetGraphicalVariable);
+	SCRIPT_METHOD_EXT(GetGUIAt, GetGUIAt);
+	SCRIPT_METHOD_EXT(GetGUIObjectAt, GetGUIObjectAt);
+	SCRIPT_METHOD_EXT(GetHotspotAt, GetHotspotIDAtScreen);
+	SCRIPT_METHOD_EXT(GetHotspotName, GetHotspotName);
+	SCRIPT_METHOD_EXT(GetHotspotPointX, GetHotspotPointX);
+	SCRIPT_METHOD_EXT(GetHotspotPointY, GetHotspotPointY);
+	SCRIPT_METHOD_EXT(GetHotspotProperty, GetHotspotProperty);
+	SCRIPT_METHOD_EXT(GetHotspotPropertyText, GetHotspotPropertyText);
+	SCRIPT_METHOD_EXT(GetInvAt, GetInvAt);
+	SCRIPT_METHOD_EXT(GetInvGraphic, GetInvGraphic);
+	SCRIPT_METHOD_EXT(GetInvName, GetInvName);
+	SCRIPT_METHOD_EXT(GetInvProperty, GetInvProperty);
+	SCRIPT_METHOD_EXT(GetInvPropertyText, GetInvPropertyText);
+	//SCRIPT_METHOD_EXT(GetLanguageString",      (void*)GetLanguageString);
+	SCRIPT_METHOD_EXT(GetLocationName, GetLocationName);
+	SCRIPT_METHOD_EXT(GetLocationType, GetLocationType);
+	SCRIPT_METHOD_EXT(GetMessageText, GetMessageText);
+	SCRIPT_METHOD_EXT(GetMIDIPosition, GetMIDIPosition);
+	SCRIPT_METHOD_EXT(GetMP3PosMillis, GetMP3PosMillis);
+	SCRIPT_METHOD_EXT(GetObjectAt, GetObjectIDAtScreen);
+	SCRIPT_METHOD_EXT(GetObjectBaseline, GetObjectBaseline);
+	SCRIPT_METHOD_EXT(GetObjectGraphic, GetObjectGraphic);
+	SCRIPT_METHOD_EXT(GetObjectName, GetObjectName);
+	SCRIPT_METHOD_EXT(GetObjectProperty, GetObjectProperty);
+	SCRIPT_METHOD_EXT(GetObjectPropertyText, GetObjectPropertyText);
+	SCRIPT_METHOD_EXT(GetObjectX, GetObjectX);
+	SCRIPT_METHOD_EXT(GetObjectY, GetObjectY);
+	//  SCRIPT_METHOD_EXT(GetPalette",           (void*)scGetPal);
+	SCRIPT_METHOD_EXT(GetPlayerCharacter, GetPlayerCharacter);
+	SCRIPT_METHOD_EXT(GetRawTime, GetRawTime);
+	SCRIPT_METHOD_EXT(GetRegionAt, GetRegionIDAtRoom);
+	SCRIPT_METHOD_EXT(GetRoomProperty, Room_GetProperty);
+	SCRIPT_METHOD_EXT(GetRoomPropertyText, GetRoomPropertyText);
+	SCRIPT_METHOD_EXT(GetSaveSlotDescription, GetSaveSlotDescription);
+	SCRIPT_METHOD_EXT(GetScalingAt, GetScalingAt);
+	SCRIPT_METHOD_EXT(GetSliderValue, GetSliderValue);
+	SCRIPT_METHOD_EXT(GetTextBoxText, GetTextBoxText);
+	SCRIPT_METHOD_EXT(GetTextHeight, GetTextHeight);
+	SCRIPT_METHOD_EXT(GetTextWidth, GetTextWidth);
+	SCRIPT_METHOD_EXT(GetTime, sc_GetTime);
+	SCRIPT_METHOD_EXT(GetTranslation, get_translation);
+	SCRIPT_METHOD_EXT(GetTranslationName, GetTranslationName);
+	SCRIPT_METHOD_EXT(GetViewportX, GetViewportX);
+	SCRIPT_METHOD_EXT(GetViewportY, GetViewportY);
+	SCRIPT_METHOD_EXT(GetWalkableAreaAtRoom, GetWalkableAreaAtRoom);
+	SCRIPT_METHOD_EXT(GetWalkableAreaAt, GetWalkableAreaAtScreen);
+	SCRIPT_METHOD_EXT(GetWalkableAreaAtScreen, GetWalkableAreaAtScreen);
+	SCRIPT_METHOD_EXT(GiveScore, GiveScore);
+	SCRIPT_METHOD_EXT(HasPlayerBeenInRoom, HasPlayerBeenInRoom);
+	SCRIPT_METHOD_EXT(HideMouseCursor, HideMouseCursor);
+	SCRIPT_METHOD_EXT(InputBox, sc_inputbox);
+	SCRIPT_METHOD_EXT(InterfaceOff, InterfaceOff);
+	SCRIPT_METHOD_EXT(InterfaceOn, InterfaceOn);
+	SCRIPT_METHOD_EXT(IntToFloat, IntToFloat);
+	SCRIPT_METHOD_EXT(InventoryScreen, sc_invscreen);
+	SCRIPT_METHOD_EXT(IsButtonDown, IsButtonDown);
+	SCRIPT_METHOD_EXT(IsChannelPlaying, IsChannelPlaying);
+	SCRIPT_METHOD_EXT(IsGamePaused, IsGamePaused);
+	SCRIPT_METHOD_EXT(IsGUIOn, IsGUIOn);
+	SCRIPT_METHOD_EXT(IsInteractionAvailable, IsInteractionAvailable);
+	SCRIPT_METHOD_EXT(IsInventoryInteractionAvailable, IsInventoryInteractionAvailable);
+	SCRIPT_METHOD_EXT(IsInterfaceEnabled, IsInterfaceEnabled);
+	SCRIPT_METHOD_EXT(IsKeyPressed, IsKeyPressed);
+	SCRIPT_METHOD_EXT(IsMusicPlaying, IsMusicPlaying);
+	SCRIPT_METHOD_EXT(IsMusicVoxAvailable, IsMusicVoxAvailable);
+	SCRIPT_METHOD_EXT(IsObjectAnimating, IsObjectAnimating);
+	SCRIPT_METHOD_EXT(IsObjectMoving, IsObjectMoving);
+	SCRIPT_METHOD_EXT(IsObjectOn, IsObjectOn);
+	SCRIPT_METHOD_EXT(IsOverlayValid, IsOverlayValid);
+	SCRIPT_METHOD_EXT(IsSoundPlaying, IsSoundPlaying);
+	SCRIPT_METHOD_EXT(IsTimerExpired, IsTimerExpired);
+	SCRIPT_METHOD_EXT(IsTranslationAvailable, IsTranslationAvailable);
+	SCRIPT_METHOD_EXT(IsVoxAvailable, IsVoxAvailable);
+	SCRIPT_METHOD_EXT(ListBoxAdd, ListBoxAdd);
+	SCRIPT_METHOD_EXT(ListBoxClear, ListBoxClear);
+	SCRIPT_METHOD_EXT(ListBoxDirList, ListBoxDirList);
+	SCRIPT_METHOD_EXT(ListBoxGetItemText, ListBoxGetItemText);
+	SCRIPT_METHOD_EXT(ListBoxGetNumItems, ListBoxGetNumItems);
+	SCRIPT_METHOD_EXT(ListBoxGetSelected, ListBoxGetSelected);
+	SCRIPT_METHOD_EXT(ListBoxRemove, ListBoxRemove);
+	SCRIPT_METHOD_EXT(ListBoxSaveGameList, ListBoxSaveGameList);
+	SCRIPT_METHOD_EXT(ListBoxSetSelected, ListBoxSetSelected);
+	SCRIPT_METHOD_EXT(ListBoxSetTopItem, ListBoxSetTopItem);
+	SCRIPT_METHOD_EXT(LoadImageFile, LoadImageFile);
+	SCRIPT_METHOD_EXT(LoadSaveSlotScreenshot, LoadSaveSlotScreenshot);
+	SCRIPT_METHOD_EXT(LoseInventory, lose_inventory);
+	SCRIPT_METHOD_EXT(LoseInventoryFromCharacter, LoseInventoryFromCharacter);
+	SCRIPT_METHOD_EXT(MergeObject, MergeObject);
+	SCRIPT_METHOD_EXT(MoveCharacter, MoveCharacter);
+	SCRIPT_METHOD_EXT(MoveCharacterBlocking, MoveCharacterBlocking);
+	SCRIPT_METHOD_EXT(MoveCharacterDirect, MoveCharacterDirect);
+	SCRIPT_METHOD_EXT(MoveCharacterPath, MoveCharacterPath);
+	SCRIPT_METHOD_EXT(MoveCharacterStraight, MoveCharacterStraight);
+	SCRIPT_METHOD_EXT(MoveCharacterToHotspot, MoveCharacterToHotspot);
+	SCRIPT_METHOD_EXT(MoveCharacterToObject, MoveCharacterToObject);
+	SCRIPT_METHOD_EXT(MoveObject, MoveObject);
+	SCRIPT_METHOD_EXT(MoveObjectDirect, MoveObjectDirect);
+	SCRIPT_METHOD_EXT(MoveOverlay, MoveOverlay);
+	SCRIPT_METHOD_EXT(MoveToWalkableArea, MoveToWalkableArea);
+	SCRIPT_METHOD_EXT(NewRoom, NewRoom);
+	SCRIPT_METHOD_EXT(NewRoomEx, NewRoomEx);
+	SCRIPT_METHOD_EXT(NewRoomNPC, NewRoomNPC);
+	SCRIPT_METHOD_EXT(ObjectOff, ObjectOff);
+	SCRIPT_METHOD_EXT(ObjectOn, ObjectOn);
+	SCRIPT_METHOD_EXT(ParseText, ParseText);
+	SCRIPT_METHOD_EXT(PauseGame, PauseGame);
+	SCRIPT_METHOD_EXT(PlayAmbientSound, PlayAmbientSound);
+	SCRIPT_METHOD_EXT(PlayFlic, play_flc_file);
+	SCRIPT_METHOD_EXT(PlayMP3File, PlayMP3File);
+	SCRIPT_METHOD_EXT(PlayMusic, PlayMusicResetQueue);
+	SCRIPT_METHOD_EXT(PlayMusicQueued, PlayMusicQueued);
+	SCRIPT_METHOD_EXT(PlaySilentMIDI, PlaySilentMIDI);
+	SCRIPT_METHOD_EXT(PlaySound, play_sound);
+	SCRIPT_METHOD_EXT(PlaySoundEx, PlaySoundEx);
+	SCRIPT_METHOD_EXT(PlayVideo, scrPlayVideo);
+	SCRIPT_METHOD_EXT(ProcessClick, RoomProcessClick);
+	SCRIPT_METHOD_EXT(QuitGame, QuitGame);
+	SCRIPT_METHOD_EXT(Random, __Rand);
+	SCRIPT_METHOD_EXT(RawClearScreen, RawClear);
+	SCRIPT_METHOD_EXT(RawDrawCircle, RawDrawCircle);
+	SCRIPT_METHOD_EXT(RawDrawFrameTransparent, RawDrawFrameTransparent);
+	SCRIPT_METHOD_EXT(RawDrawImage, RawDrawImage);
+	SCRIPT_METHOD_EXT(RawDrawImageOffset, RawDrawImageOffset);
+	SCRIPT_METHOD_EXT(RawDrawImageResized, RawDrawImageResized);
+	SCRIPT_METHOD_EXT(RawDrawImageTransparent, RawDrawImageTransparent);
+	SCRIPT_METHOD_EXT(RawDrawLine, RawDrawLine);
+	SCRIPT_METHOD_EXT(RawDrawRectangle, RawDrawRectangle);
+	SCRIPT_METHOD_EXT(RawDrawTriangle, RawDrawTriangle);
+	SCRIPT_METHOD_EXT(RawPrint, ScPl_RawPrint);
+	SCRIPT_METHOD_EXT(RawPrintMessageWrapped, RawPrintMessageWrapped);
+	SCRIPT_METHOD_EXT(RawRestoreScreen, RawRestoreScreen);
+	SCRIPT_METHOD_EXT(RawRestoreScreenTinted, RawRestoreScreenTinted);
+	SCRIPT_METHOD_EXT(RawSaveScreen, RawSaveScreen);
+	SCRIPT_METHOD_EXT(RawSetColor, RawSetColor);
+	SCRIPT_METHOD_EXT(RawSetColorRGB, RawSetColorRGB);
+	SCRIPT_METHOD_EXT(RefreshMouse, RefreshMouse);
+	SCRIPT_METHOD_EXT(ReleaseCharacterView, ReleaseCharacterView);
+	SCRIPT_METHOD_EXT(ReleaseViewport, ReleaseViewport);
+	SCRIPT_METHOD_EXT(RemoveObjectTint, RemoveObjectTint);
+	SCRIPT_METHOD_EXT(RemoveOverlay, RemoveOverlay);
+	SCRIPT_METHOD_EXT(RemoveWalkableArea, RemoveWalkableArea);
+	SCRIPT_METHOD_EXT(ResetRoom, ResetRoom);
+	SCRIPT_METHOD_EXT(RestartGame, restart_game);
+	SCRIPT_METHOD_EXT(RestoreGameDialog, restore_game_dialog);
+	SCRIPT_METHOD_EXT(RestoreGameSlot, RestoreGameSlot);
+	SCRIPT_METHOD_EXT(RestoreWalkableArea, RestoreWalkableArea);
+	SCRIPT_METHOD_EXT(RunAGSGame, RunAGSGame);
+	SCRIPT_METHOD_EXT(RunCharacterInteraction, RunCharacterInteraction);
+	SCRIPT_METHOD_EXT(RunDialog, RunDialog);
+	SCRIPT_METHOD_EXT(RunHotspotInteraction, RunHotspotInteraction);
+	SCRIPT_METHOD_EXT(RunInventoryInteraction, RunInventoryInteraction);
+	SCRIPT_METHOD_EXT(RunObjectInteraction, RunObjectInteraction);
+	SCRIPT_METHOD_EXT(RunRegionInteraction, RunRegionInteraction);
+	SCRIPT_METHOD_EXT(Said, Said);
+	SCRIPT_METHOD_EXT(SaidUnknownWord, SaidUnknownWord);
+	SCRIPT_METHOD_EXT(SaveCursorForLocationChange, SaveCursorForLocationChange);
+	SCRIPT_METHOD_EXT(SaveGameDialog, save_game_dialog);
+	SCRIPT_METHOD_EXT(SaveGameSlot, save_game);
+	SCRIPT_METHOD_EXT(SaveScreenShot, SaveScreenShot);
+	SCRIPT_METHOD_EXT(SeekMIDIPosition, SeekMIDIPosition);
+	SCRIPT_METHOD_EXT(SeekMODPattern, SeekMODPattern);
+	SCRIPT_METHOD_EXT(SeekMP3PosMillis, SeekMP3PosMillis);
+	SCRIPT_METHOD_EXT(SetActiveInventory, SetActiveInventory);
+	SCRIPT_METHOD_EXT(SetAmbientTint, SetAmbientTint);
+	SCRIPT_METHOD_EXT(SetAreaLightLevel, SetAreaLightLevel);
+	SCRIPT_METHOD_EXT(SetAreaScaling, SetAreaScaling);
+	SCRIPT_METHOD_EXT(SetBackgroundFrame, SetBackgroundFrame);
+	SCRIPT_METHOD_EXT(SetButtonPic, SetButtonPic);
+	SCRIPT_METHOD_EXT(SetButtonText, SetButtonText);
+	SCRIPT_METHOD_EXT(SetChannelVolume, SetChannelVolume);
+	SCRIPT_METHOD_EXT(SetCharacterBaseline, SetCharacterBaseline);
+	SCRIPT_METHOD_EXT(SetCharacterClickable, SetCharacterClickable);
+	SCRIPT_METHOD_EXT(SetCharacterFrame, SetCharacterFrame);
+	SCRIPT_METHOD_EXT(SetCharacterIdle, SetCharacterIdle);
+	SCRIPT_METHOD_EXT(SetCharacterIgnoreLight, SetCharacterIgnoreLight);
+	SCRIPT_METHOD_EXT(SetCharacterIgnoreWalkbehinds, SetCharacterIgnoreWalkbehinds);
+	SCRIPT_METHOD_EXT(SetCharacterProperty, SetCharacterProperty);
+	SCRIPT_METHOD_EXT(SetCharacterBlinkView, SetCharacterBlinkView);
+	SCRIPT_METHOD_EXT(SetCharacterSpeechView, SetCharacterSpeechView);
+	SCRIPT_METHOD_EXT(SetCharacterSpeed, SetCharacterSpeed);
+	SCRIPT_METHOD_EXT(SetCharacterSpeedEx, SetCharacterSpeedEx);
+	SCRIPT_METHOD_EXT(SetCharacterTransparency, SetCharacterTransparency);
+	SCRIPT_METHOD_EXT(SetCharacterView, SetCharacterView);
+	SCRIPT_METHOD_EXT(SetCharacterViewEx, SetCharacterViewEx);
+	SCRIPT_METHOD_EXT(SetCharacterViewOffset, SetCharacterViewOffset);
+	SCRIPT_METHOD_EXT(SetCursorMode, set_cursor_mode);
+	SCRIPT_METHOD_EXT(SetDefaultCursor, set_default_cursor);
+	SCRIPT_METHOD_EXT(SetDialogOption, SetDialogOption);
+	SCRIPT_METHOD_EXT(SetDigitalMasterVolume, SetDigitalMasterVolume);
+	SCRIPT_METHOD_EXT(SetFadeColor, SetFadeColor);
+	SCRIPT_METHOD_EXT(SetFrameSound, SetFrameSound);
+	SCRIPT_METHOD_EXT(SetGameOption, SetGameOption);
+	SCRIPT_METHOD_EXT(SetGameSpeed, SetGameSpeed);
+	SCRIPT_METHOD_EXT(SetGlobalInt, SetGlobalInt);
+	SCRIPT_METHOD_EXT(SetGlobalString, SetGlobalString);
+	SCRIPT_METHOD_EXT(SetGraphicalVariable, SetGraphicalVariable);
+	SCRIPT_METHOD_EXT(SetGUIBackgroundPic, SetGUIBackgroundPic);
+	SCRIPT_METHOD_EXT(SetGUIClickable, SetGUIClickable);
+	SCRIPT_METHOD_EXT(SetGUIObjectEnabled, SetGUIObjectEnabled);
+	SCRIPT_METHOD_EXT(SetGUIObjectPosition, SetGUIObjectPosition);
+	SCRIPT_METHOD_EXT(SetGUIObjectSize, SetGUIObjectSize);
+	SCRIPT_METHOD_EXT(SetGUIPosition, SetGUIPosition);
+	SCRIPT_METHOD_EXT(SetGUISize, SetGUISize);
+	SCRIPT_METHOD_EXT(SetGUITransparency, SetGUITransparency);
+	SCRIPT_METHOD_EXT(SetGUIZOrder, SetGUIZOrder);
+	SCRIPT_METHOD_EXT(SetInvItemName, SetInvItemName);
+	SCRIPT_METHOD_EXT(SetInvItemPic, set_inv_item_pic);
+	SCRIPT_METHOD_EXT(SetInvDimensions, SetInvDimensions);
+	SCRIPT_METHOD_EXT(SetLabelColor, SetLabelColor);
+	SCRIPT_METHOD_EXT(SetLabelFont, SetLabelFont);
+	SCRIPT_METHOD_EXT(SetLabelText, SetLabelText);
+	SCRIPT_METHOD_EXT(SetMouseBounds, SetMouseBounds);
+	SCRIPT_METHOD_EXT(SetMouseCursor, set_mouse_cursor);
+	SCRIPT_METHOD_EXT(SetMousePosition, SetMousePosition);
+	SCRIPT_METHOD_EXT(SetMultitaskingMode, SetMultitasking);
+	SCRIPT_METHOD_EXT(SetMusicMasterVolume, SetMusicMasterVolume);
+	SCRIPT_METHOD_EXT(SetMusicRepeat, SetMusicRepeat);
+	SCRIPT_METHOD_EXT(SetMusicVolume, SetMusicVolume);
+	SCRIPT_METHOD_EXT(SetNextCursorMode, SetNextCursor);
+	SCRIPT_METHOD_EXT(SetNextScreenTransition, SetNextScreenTransition);
+	SCRIPT_METHOD_EXT(SetNormalFont, SetNormalFont);
+	SCRIPT_METHOD_EXT(SetObjectBaseline, SetObjectBaseline);
+	SCRIPT_METHOD_EXT(SetObjectClickable, SetObjectClickable);
+	SCRIPT_METHOD_EXT(SetObjectFrame, SetObjectFrame);
+	SCRIPT_METHOD_EXT(SetObjectGraphic, SetObjectGraphic);
+	SCRIPT_METHOD_EXT(SetObjectIgnoreWalkbehinds, SetObjectIgnoreWalkbehinds);
+	SCRIPT_METHOD_EXT(SetObjectPosition, SetObjectPosition);
+	SCRIPT_METHOD_EXT(SetObjectTint, SetObjectTint);
+	SCRIPT_METHOD_EXT(SetObjectTransparency, SetObjectTransparency);
+	SCRIPT_METHOD_EXT(SetObjectView, SetObjectView);
+	//  SCRIPT_METHOD_EXT(SetPalette",           (void*)scSetPal);
+	SCRIPT_METHOD_EXT(SetPalRGB, SetPalRGB);
+	SCRIPT_METHOD_EXT(SetPlayerCharacter, SetPlayerCharacter);
+	SCRIPT_METHOD_EXT(SetRegionTint, SetRegionTint);
+	SCRIPT_METHOD_EXT(SetRestartPoint, SetRestartPoint);
+	SCRIPT_METHOD_EXT(SetScreenTransition, SetScreenTransition);
+	SCRIPT_METHOD_EXT(SetSkipSpeech, SetSkipSpeech);
+	SCRIPT_METHOD_EXT(SetSliderValue, SetSliderValue);
+	SCRIPT_METHOD_EXT(SetSoundVolume, SetSoundVolume);
+	SCRIPT_METHOD_EXT(SetSpeechFont, SetSpeechFont);
+	SCRIPT_METHOD_EXT(SetSpeechStyle, SetSpeechStyle);
+	SCRIPT_METHOD_EXT(SetSpeechVolume, SetSpeechVolume);
+	SCRIPT_METHOD_EXT(SetTalkingColor, SetTalkingColor);
+	SCRIPT_METHOD_EXT(SetTextBoxFont, SetTextBoxFont);
+	SCRIPT_METHOD_EXT(SetTextBoxText, SetTextBoxText);
+	SCRIPT_METHOD_EXT(SetTextOverlay, ScPl_SetTextOverlay);
+	SCRIPT_METHOD_EXT(SetTextWindowGUI, SetTextWindowGUI);
+	SCRIPT_METHOD_EXT(SetTimer, script_SetTimer);
+	SCRIPT_METHOD_EXT(SetViewport, SetViewport);
+	SCRIPT_METHOD_EXT(SetVoiceMode, SetVoiceMode);
+	SCRIPT_METHOD_EXT(SetWalkBehindBase, SetWalkBehindBase);
+	SCRIPT_METHOD_EXT(ShakeScreen, ShakeScreen);
+	SCRIPT_METHOD_EXT(ShakeScreenBackground, ShakeScreenBackground);
+	SCRIPT_METHOD_EXT(ShowMouseCursor, ShowMouseCursor);
+	SCRIPT_METHOD_EXT(SkipUntilCharacterStops, SkipUntilCharacterStops);
+	SCRIPT_METHOD_EXT(StartCutscene, StartCutscene);
+	SCRIPT_METHOD_EXT(StartRecording, scStartRecording);
+	SCRIPT_METHOD_EXT(StopAmbientSound, StopAmbientSound);
+	SCRIPT_METHOD_EXT(StopChannel, stop_and_destroy_channel);
+	SCRIPT_METHOD_EXT(StopDialog, StopDialog);
+	SCRIPT_METHOD_EXT(StopMoving, StopMoving);
+	SCRIPT_METHOD_EXT(StopMusic, scr_StopMusic);
+	SCRIPT_METHOD_EXT(StopObjectMoving, StopObjectMoving);
+	SCRIPT_METHOD_EXT(StrCat, _sc_strcat);
+	SCRIPT_METHOD_EXT(StrCaseComp, ags_stricmp);
+	SCRIPT_METHOD_EXT(StrComp, strcmp);
+	SCRIPT_METHOD_EXT(StrContains, StrContains);
+	SCRIPT_METHOD_EXT(StrCopy, _sc_strcpy);
+	SCRIPT_METHOD_EXT(StrFormat, ScPl_sc_sprintf);
+	SCRIPT_METHOD_EXT(StrGetCharAt, StrGetCharAt);
+	SCRIPT_METHOD_EXT(StringToInt, StringToInt);
+	SCRIPT_METHOD_EXT(StrLen, strlen);
+	SCRIPT_METHOD_EXT(StrSetCharAt, StrSetCharAt);
+	SCRIPT_METHOD_EXT(StrToLowerCase, _sc_strlower);
+	SCRIPT_METHOD_EXT(StrToUpperCase, _sc_strupper);
+	SCRIPT_METHOD_EXT(TintScreen, TintScreen);
+	SCRIPT_METHOD_EXT(UnPauseGame, UnPauseGame);
+	SCRIPT_METHOD_EXT(UpdateInventory, update_invorder);
+	SCRIPT_METHOD_EXT(UpdatePalette, UpdatePalette);
+	SCRIPT_METHOD_EXT(Wait, scrWait);
+	SCRIPT_METHOD_EXT(WaitKey, WaitKey);
+	SCRIPT_METHOD_EXT(WaitMouseKey, WaitMouseKey);
+
+}
+
+void GlobalAPI::ScPl_sc_AbortGame(ScriptMethodParams &params) {
+	Common::String texx = params.format(0);
+	AGS3::_sc_AbortGame(texx.c_str());
+}
+
+void GlobalAPI::add_inventory(ScriptMethodParams &params) {
+	PARAMS1(int, inum);
+	AGS3::add_inventory(inum);
+}
+
+void GlobalAPI::AddInventoryToCharacter(ScriptMethodParams &params) {
+	PARAMS2(int, charid, int, inum);
+	AGS3::AddInventoryToCharacter(charid, inum);
+}
+
+void GlobalAPI::AnimateButton(ScriptMethodParams &params) {
+	PARAMS6(int, guin, int, objn, int, view, int, loop, int, speed, int, repeat);
+	AGS3::AnimateButton(guin, objn, view, loop, speed, repeat);
+}
+
+void GlobalAPI::scAnimateCharacter(ScriptMethodParams &params) {
+	PARAMS4(int, chh, int, loopn, int, sppd, int, rept);
+	AGS3::scAnimateCharacter(chh, loopn, sppd, rept);
+}
+
+void GlobalAPI::AnimateCharacterEx(ScriptMethodParams &params) {
+	PARAMS6(int, chh, int, loopn, int, sppd, int, rept, int, direction, int, blocking);
+	AGS3::AnimateCharacterEx(chh, loopn, sppd, rept, direction, blocking);
+}
+
+void GlobalAPI::AnimateObject(ScriptMethodParams &params) {
+	PARAMS4(int, obn, int, loopn, int, spdd, int, rept);
+	AGS3::AnimateObject(obn, loopn, spdd, rept);
+}
+
+void GlobalAPI::AnimateObjectEx(ScriptMethodParams &params) {
+	PARAMS6(int, obn, int, loopn, int, spdd, int, rept, int, direction, int, blocking);
+	AGS3::AnimateObjectEx(obn, loopn, spdd, rept, direction, blocking);
+}
+
+void GlobalAPI::AreCharactersColliding(ScriptMethodParams &params) {
+	PARAMS2(int, cchar1, int, cchar2);
+	params._result = AGS3::AreCharactersColliding(cchar1, cchar2);
+}
+
+void GlobalAPI::AreCharObjColliding(ScriptMethodParams &params) {
+	PARAMS2(int, charid, int, objid);
+	params._result = AGS3::AreCharObjColliding(charid, objid);
+}
+
+void GlobalAPI::AreObjectsColliding(ScriptMethodParams &params) {
+	PARAMS2(int, obj1, int, obj2);
+	params._result = AGS3::AreObjectsColliding(obj1, obj2);
+}
+
+void GlobalAPI::AreThingsOverlapping(ScriptMethodParams &params) {
+	PARAMS2(int, thing1, int, thing2);
+	params._result = AGS3::AreThingsOverlapping(thing1, thing2);
+}
+
+void GlobalAPI::CallRoomScript(ScriptMethodParams &params) {
+	PARAMS1(int, value);
+	AGS3::CallRoomScript(value);
+}
+
+void GlobalAPI::cd_manager(ScriptMethodParams &params) {
+	PARAMS2(int, cmdd, int, datt);
+	params._result = AGS3::cd_manager(cmdd, datt);
+}
+
+void GlobalAPI::CentreGUI(ScriptMethodParams &params) {
+	PARAMS1(int, ifn);
+	AGS3::CentreGUI(ifn);
+}
+
+void GlobalAPI::ChangeCharacterView(ScriptMethodParams &params) {
+	PARAMS2(int, chaa, int, vii);
+	AGS3::ChangeCharacterView(chaa, vii);
+}
+
+void GlobalAPI::ChangeCursorGraphic(ScriptMethodParams &params) {
+	PARAMS2(int, curs, int, newslot);
+	AGS3::ChangeCursorGraphic(curs, newslot);
+}
+
+void GlobalAPI::ChangeCursorHotspot(ScriptMethodParams &params) {
+	PARAMS3(int, curs, int, x, int, y);
+	AGS3::ChangeCursorHotspot(curs, x, y);
+}
+
+void GlobalAPI::ClaimEvent(ScriptMethodParams &params) {
+	AGS3::ClaimEvent();
+}
+
+void GlobalAPI::CreateGraphicOverlay(ScriptMethodParams &params) {
+	PARAMS4(int, xx, int, yy, int, slott, int, trans);
+	params._result = AGS3::CreateGraphicOverlay(xx, yy, slott, trans);
+}
+
+void GlobalAPI::ScPl_CreateTextOverlay(ScriptMethodParams &params) {
+	PARAMS5(int, xx, int, yy, int, wii, int, fontid, int, clr);
+	Common::String texx = params.format(5);
+
+	params._result = AGS3::CreateTextOverlay(xx, yy, wii, fontid, clr,
+		texx.c_str(), DISPLAYTEXT_NORMALOVERLAY);
+}
+
+void GlobalAPI::CyclePalette(ScriptMethodParams &params) {
+	PARAMS2(int, strt, int, eend);
+	AGS3::CyclePalette(strt, eend);
+}
+
+void GlobalAPI::script_debug(ScriptMethodParams &params) {
+	PARAMS2(int, cmdd, int, dataa);
+	AGS3::script_debug(cmdd, dataa);
+}
+
+void GlobalAPI::DeleteSaveSlot(ScriptMethodParams &params) {
+	PARAMS1(int, slnum);
+	AGS3::DeleteSaveSlot(slnum);
+}
+
+void GlobalAPI::free_dynamic_sprite(ScriptMethodParams &params) {
+	PARAMS1(int, gotSlot);
+	AGS3::free_dynamic_sprite(gotSlot);
+}
+
+void GlobalAPI::disable_cursor_mode(ScriptMethodParams &params) {
+	PARAMS1(int, modd);
+	AGS3::disable_cursor_mode(modd);
+}
+
+void GlobalAPI::DisableGroundLevelAreas(ScriptMethodParams &params) {
+	PARAMS1(int, alsoEffects);
+	AGS3::DisableGroundLevelAreas(alsoEffects);
+}
+
+void GlobalAPI::DisableHotspot(ScriptMethodParams &params) {
+	PARAMS1(int, hsnum);
+	AGS3::DisableHotspot(hsnum);
+}
+
+void GlobalAPI::DisableInterface(ScriptMethodParams &params) {
+	AGS3::DisableInterface();
+}
+
+void GlobalAPI::DisableRegion(ScriptMethodParams &params) {
+	PARAMS1(int, hsnum);
+	AGS3::DisableRegion(hsnum);
+}
+
+void GlobalAPI::ScPl_Display(ScriptMethodParams &params) {
+	Common::String texx = params.format(0);
+	AGS3::DisplaySimple(texx.c_str());
+}
+
+void GlobalAPI::ScPl_DisplayAt(ScriptMethodParams &params) {
+	PARAMS3(int, xxp, int, yyp, int, widd);
+	Common::String texx = params.format(3);
+	AGS3::DisplayAt(xxp, yyp, widd, texx.c_str());
+}
+
+void GlobalAPI::DisplayAtY(ScriptMethodParams &params) {
+	PARAMS2(int, ypos, const char *, texx);
+	AGS3::DisplayAtY(ypos, texx);
+}
+
+void GlobalAPI::DisplayMessage(ScriptMethodParams &params) {
+	PARAMS1(int, msnum);
+	AGS3::DisplayMessage(msnum);
+}
+
+void GlobalAPI::DisplayMessageAtY(ScriptMethodParams &params) {
+	PARAMS2(int, msnum, int, ypos);
+	AGS3::DisplayMessageAtY(msnum, ypos);
+}
+
+void GlobalAPI::DisplayMessageBar(ScriptMethodParams &params) {
+	PARAMS5(int, ypos, int, ttexcol, int, backcol, const char *, title, int, msgnum);
+	AGS3::DisplayMessageBar(ypos, ttexcol, backcol, title, msgnum);
+}
+
+void GlobalAPI::ScPl_sc_displayspeech(ScriptMethodParams &params) {
+	PARAMS1(int, chid);
+	Common::String texx = params.format(1);
+	AGS3::__sc_displayspeech(chid, texx.c_str());
+}
+
+void GlobalAPI::DisplaySpeechAt(ScriptMethodParams &params) {
+	PARAMS5(int, xx, int, yy, int, wii, int, aschar, const char *, spch);
+	AGS3::DisplaySpeechAt(xx, yy, wii, aschar, spch);
+}
+
+void GlobalAPI::DisplaySpeechBackground(ScriptMethodParams &params) {
+	PARAMS2(int, charid, const char *, speel);
+	params._result = AGS3::DisplaySpeechBackground(charid, speel);
+}
+
+void GlobalAPI::ScPl_DisplayThought(ScriptMethodParams &params) {
+	PARAMS1(int, chid);
+	Common::String texx = params.format(1);
+	AGS3::DisplayThought(chid, texx.c_str());
+}
+
+void GlobalAPI::ScPl_DisplayTopBar(ScriptMethodParams &params) {
+	PARAMS4(int, ypos, int, ttexcol, int, backcol, char *, title);
+	Common::String texx = params.format(4);
+	AGS3::DisplayTopBar(ypos, ttexcol, backcol, title, texx.c_str());
+}
+
+void GlobalAPI::enable_cursor_mode(ScriptMethodParams &params) {
+	PARAMS1(int, modd);
+	AGS3::enable_cursor_mode(modd);
+}
+
+void GlobalAPI::EnableGroundLevelAreas(ScriptMethodParams &params) {
+	AGS3::EnableGroundLevelAreas();
+}
+
+void GlobalAPI::EnableHotspot(ScriptMethodParams &params) {
+	PARAMS1(int, hsnum);
+	AGS3::EnableHotspot(hsnum);
+}
+
+void GlobalAPI::EnableInterface(ScriptMethodParams &params) {
+	AGS3::EnableInterface();
+}
+
+void GlobalAPI::EnableRegion(ScriptMethodParams &params) {
+	PARAMS1(int, hsnum);
+	AGS3::EnableRegion(hsnum);
+}
+
+void GlobalAPI::EndCutscene(ScriptMethodParams &params) {
+	params._result = AGS3::EndCutscene();
+}
+
+void GlobalAPI::FaceCharacter(ScriptMethodParams &params) {
+	PARAMS2(int, cha, int, toface);
+	AGS3::FaceCharacter(cha, toface);
+}
+
+void GlobalAPI::FaceLocation(ScriptMethodParams &params) {
+	PARAMS3(int, cha, int, xx, int, yy);
+	AGS3::FaceLocation(cha, xx, yy);
+}
+
+void GlobalAPI::FadeIn(ScriptMethodParams &params) {
+	PARAMS1(int, sppd);
+	AGS3::FadeIn(sppd);
+}
+
+void GlobalAPI::my_fade_out(ScriptMethodParams &params) {
+	PARAMS1(int, spdd);
+	AGS3::my_fade_out(spdd);
+}
+
+void GlobalAPI::FileClose(ScriptMethodParams &params) {
+	PARAMS1(int32_t, handle);
+	AGS3::FileClose(handle);
+}
+
+void GlobalAPI::FileIsEOF(ScriptMethodParams &params) {
+	PARAMS1(int32_t, handle);
+	params._result = AGS3::FileIsEOF(handle);
+}
+
+void GlobalAPI::FileIsError(ScriptMethodParams &params) {
+	PARAMS1(int32_t, handle);
+	params._result = AGS3::FileIsError(handle);
+}
+
+void GlobalAPI::FileOpenCMode(ScriptMethodParams &params) {
+	PARAMS2(const char *, fnmm, const char *, cmode);
+	params._result = AGS3::FileOpenCMode(fnmm, cmode);
+}
+
+void GlobalAPI::FileRead(ScriptMethodParams &params) {
+	PARAMS2(int32_t, handle, char *, toread);
+	AGS3::FileRead(handle, toread);
+}
+
+void GlobalAPI::FileReadInt(ScriptMethodParams &params) {
+	PARAMS1(int32_t, handle);
+	params._result = AGS3::FileReadInt(handle);
+}
+
+void GlobalAPI::FileReadRawChar(ScriptMethodParams &params) {
+	PARAMS1(int32_t, handle);
+	params._result = AGS3::FileReadRawChar(handle);
+}
+
+void GlobalAPI::FileReadRawInt(ScriptMethodParams &params) {
+	PARAMS1(int32_t, handle);
+	params._result = AGS3::FileReadRawInt(handle);
+}
+
+void GlobalAPI::FileWrite(ScriptMethodParams &params) {
+	PARAMS2(int32_t, handle, const char *, towrite);
+	AGS3::FileWrite(handle, towrite);
+}
+
+void GlobalAPI::FileWriteInt(ScriptMethodParams &params) {
+	PARAMS2(int32_t, handle, int, into);
+	AGS3::FileWriteInt(handle, into);
+}
+
+void GlobalAPI::FileWriteRawChar(ScriptMethodParams &params) {
+	PARAMS2(int32_t, handle, int, chartoWrite);
+	AGS3::FileWriteRawChar(handle, chartoWrite);
+}
+
+void GlobalAPI::FileWriteRawLine(ScriptMethodParams &params) {
+	PARAMS2(int32_t, handle, const char *, towrite);
+	AGS3::FileWriteRawLine(handle, towrite);
+}
+
+void GlobalAPI::FindGUIID(ScriptMethodParams &params) {
+	PARAMS1(const char *, GUIName);
+	params._result = AGS3::FindGUIID(GUIName);
+}
+
+void GlobalAPI::FlipScreen(ScriptMethodParams &params) {
+	PARAMS1(int, amount);
+	AGS3::FlipScreen(amount);
+}
+
+void GlobalAPI::FloatToInt(ScriptMethodParams &params) {
+	PARAMS2(float, value, int, roundDirection);
+	params._result = AGS3::FloatToInt(value, roundDirection);
+}
+
+void GlobalAPI::FollowCharacter(ScriptMethodParams &params) {
+	PARAMS2(int, who, int, tofollow);
+	AGS3::FollowCharacter(who, tofollow);
+}
+
+void GlobalAPI::FollowCharacterEx(ScriptMethodParams &params) {
+	PARAMS4(int, who, int, tofollow, int, distaway, int, eagerness);
+	AGS3::FollowCharacterEx(who, tofollow, distaway, eagerness);
+}
+
+void GlobalAPI::GetBackgroundFrame(ScriptMethodParams &params) {
+	params._result = AGS3::GetBackgroundFrame();
+}
+
+void GlobalAPI::GetButtonPic(ScriptMethodParams &params) {
+	PARAMS3(int, guin, int, objn, int, ptype);
+	params._result = AGS3::GetButtonPic(guin, objn, ptype);
+}
+
+void GlobalAPI::GetCharIDAtScreen(ScriptMethodParams &params) {
+	PARAMS2(int, xx, int, yy);
+	params._result = AGS3::GetCharIDAtScreen(xx, yy);
+}
+
+void GlobalAPI::GetCharacterProperty(ScriptMethodParams &params) {
+	PARAMS2(int, cha, const char *, property);
+	params._result = AGS3::GetCharacterProperty(cha, property);
+}
+
+void GlobalAPI::GetCharacterPropertyText(ScriptMethodParams &params) {
+	PARAMS3(int, item, const char *, property, char *, buffer);
+	AGS3::GetCharacterPropertyText(item, property, buffer);
+}
+
+void GlobalAPI::GetCurrentMusic(ScriptMethodParams &params) {
+	params._result = AGS3::GetCurrentMusic();
+}
+
+void GlobalAPI::GetCursorMode(ScriptMethodParams &params) {
+	params._result = AGS3::GetCursorMode();
+}
+
+void GlobalAPI::GetDialogOption(ScriptMethodParams &params) {
+	PARAMS2(int, dlg, int, opt);
+	params._result = AGS3::GetDialogOption(dlg, opt);
+}
+
+void GlobalAPI::GetGameOption(ScriptMethodParams &params) {
+	PARAMS1(int, opt);
+	params._result = AGS3::GetGameOption(opt);
+}
+
+void GlobalAPI::GetGameParameter(ScriptMethodParams &params) {
+	PARAMS4(int, parm, int, data1, int, data2, int, data3);
+	params._result = AGS3::GetGameParameter(parm, data1, data2, data3);
+}
+
+void GlobalAPI::GetGameSpeed(ScriptMethodParams &params) {
+	params._result = AGS3::GetGameSpeed();
+}
+
+void GlobalAPI::GetGlobalInt(ScriptMethodParams &params) {
+	PARAMS1(int, index);
+	params._result = AGS3::GetGlobalInt(index);
+}
+
+void GlobalAPI::GetGlobalString(ScriptMethodParams &params) {
+	PARAMS2(int, index, char *, strval);
+	AGS3::GetGlobalString(index, strval);
+}
+
+void GlobalAPI::GetGraphicalVariable(ScriptMethodParams &params) {
+	PARAMS1(const char *, varName);
+	params._result = AGS3::GetGraphicalVariable(varName);
+}
+
+void GlobalAPI::GetGUIAt(ScriptMethodParams &params) {
+	PARAMS2(int, xx, int, yy);
+	params._result = AGS3::GetGUIAt(xx, yy);
+}
+
+void GlobalAPI::GetGUIObjectAt(ScriptMethodParams &params) {
+	PARAMS2(int, xx, int, yy);
+	params._result = AGS3::GetGUIObjectAt(xx, yy);
+}
+
+void GlobalAPI::GetHotspotIDAtScreen(ScriptMethodParams &params) {
+	PARAMS2(int, xx, int, yy);
+	params._result = AGS3::GetHotspotIDAtScreen(xx, yy);
+}
+
+void GlobalAPI::GetHotspotName(ScriptMethodParams &params) {
+	PARAMS2(int, hotspot, char *, buffer);
+	AGS3::GetHotspotName(hotspot, buffer);
+}
+
+void GlobalAPI::GetHotspotPointX(ScriptMethodParams &params) {
+	PARAMS1(int, hotspot);
+	params._result = AGS3::GetHotspotPointX(hotspot);
+}
+
+void GlobalAPI::GetHotspotPointY(ScriptMethodParams &params) {
+	PARAMS1(int, hotspot);
+	params._result = AGS3::GetHotspotPointY(hotspot);
+}
+
+void GlobalAPI::GetHotspotProperty(ScriptMethodParams &params) {
+	PARAMS2(int, hss, const char *, property);
+	params._result = AGS3::GetHotspotProperty(hss, property);
+}
+
+void GlobalAPI::GetHotspotPropertyText(ScriptMethodParams &params) {
+	PARAMS3(int, item, const char *, property, char *, buffer);
+	AGS3::GetHotspotPropertyText(item, property, buffer);
+}
+
+void GlobalAPI::GetInvAt(ScriptMethodParams &params) {
+	PARAMS2(int, xx, int, yy);
+	params._result = AGS3::GetInvAt(xx, yy);
+}
+
+void GlobalAPI::GetInvGraphic(ScriptMethodParams &params) {
+	PARAMS1(int, indx);
+	params._result = AGS3::GetInvGraphic(indx);
+}
+
+void GlobalAPI::GetInvName(ScriptMethodParams &params) {
+	PARAMS2(int, indx, char *, buff);
+	AGS3::GetInvName(indx, buff);
+}
+
+void GlobalAPI::GetInvProperty(ScriptMethodParams &params) {
+	PARAMS2(int, item, const char *, property);
+	params._result = AGS3::GetInvProperty(item, property);
+}
+
+void GlobalAPI::GetInvPropertyText(ScriptMethodParams &params) {
+	PARAMS3(int, item, const char *, property, char *, buffer);
+	AGS3::GetInvPropertyText(item, property, buffer);
+}
+
+void GlobalAPI::GetLocationName(ScriptMethodParams &params) {
+	PARAMS3(int, xx, int, yy, char *, tempo);
+	AGS3::GetLocationName(xx, yy, tempo);
+}
+
+void GlobalAPI::GetLocationType(ScriptMethodParams &params) {
+	PARAMS2(int, xx, int, yy);
+	params._result = AGS3::GetLocationType(xx, yy);
+}
+
+// TODO: The rest
+void GlobalAPI::GetMessageText(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetMIDIPosition(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetMP3PosMillis(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetObjectIDAtScreen(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetObjectBaseline(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetObjectGraphic(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetObjectName(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetObjectProperty(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetObjectPropertyText(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetObjectX(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetObjectY(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetPlayerCharacter(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetRawTime(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetRegionIDAtRoom(ScriptMethodParams &params) {}
+
+void GlobalAPI::Room_GetProperty(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetRoomPropertyText(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetSaveSlotDescription(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetScalingAt(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetSliderValue(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetTextBoxText(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetTextHeight(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetTextWidth(ScriptMethodParams &params) {}
+
+void GlobalAPI::sc_GetTime(ScriptMethodParams &params) {}
+
+void GlobalAPI::get_translation(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetTranslationName(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetViewportX(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetViewportY(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetWalkableAreaAtRoom(ScriptMethodParams &params) {}
+
+void GlobalAPI::GetWalkableAreaAtScreen(ScriptMethodParams &params) {}
+
+void GlobalAPI::GiveScore(ScriptMethodParams &params) {}
+
+void GlobalAPI::HasPlayerBeenInRoom(ScriptMethodParams &params) {}
+
+void GlobalAPI::HideMouseCursor(ScriptMethodParams &params) {}
+
+void GlobalAPI::sc_inputbox(ScriptMethodParams &params) {}
+
+void GlobalAPI::InterfaceOff(ScriptMethodParams &params) {}
+
+void GlobalAPI::InterfaceOn(ScriptMethodParams &params) {}
+
+void GlobalAPI::IntToFloat(ScriptMethodParams &params) {}
+
+void GlobalAPI::sc_invscreen(ScriptMethodParams &params) {}
+
+void GlobalAPI::IsButtonDown(ScriptMethodParams &params) {}
+
+void GlobalAPI::IsChannelPlaying(ScriptMethodParams &params) {}
+
+void GlobalAPI::IsGamePaused(ScriptMethodParams &params) {}
+
+void GlobalAPI::IsGUIOn(ScriptMethodParams &params) {}
+
+void GlobalAPI::IsInteractionAvailable(ScriptMethodParams &params) {}
+
+void GlobalAPI::IsInventoryInteractionAvailable(ScriptMethodParams &params) {}
+
+void GlobalAPI::IsInterfaceEnabled(ScriptMethodParams &params) {}
+
+void GlobalAPI::IsKeyPressed(ScriptMethodParams &params) {}
+
+void GlobalAPI::IsMusicPlaying(ScriptMethodParams &params) {}
+
+void GlobalAPI::IsMusicVoxAvailable(ScriptMethodParams &params) {}
+
+void GlobalAPI::IsObjectAnimating(ScriptMethodParams &params) {}
+
+void GlobalAPI::IsObjectMoving(ScriptMethodParams &params) {}
+
+void GlobalAPI::IsObjectOn(ScriptMethodParams &params) {}
+
+void GlobalAPI::IsOverlayValid(ScriptMethodParams &params) {}
+
+void GlobalAPI::IsSoundPlaying(ScriptMethodParams &params) {}
+
+void GlobalAPI::IsTimerExpired(ScriptMethodParams &params) {}
+
+void GlobalAPI::IsTranslationAvailable(ScriptMethodParams &params) {}
+
+void GlobalAPI::IsVoxAvailable(ScriptMethodParams &params) {}
+
+void GlobalAPI::ListBoxAdd(ScriptMethodParams &params) {}
+
+void GlobalAPI::ListBoxClear(ScriptMethodParams &params) {}
+
+void GlobalAPI::ListBoxDirList(ScriptMethodParams &params) {}
+
+void GlobalAPI::ListBoxGetItemText(ScriptMethodParams &params) {}
+
+void GlobalAPI::ListBoxGetNumItems(ScriptMethodParams &params) {}
+
+void GlobalAPI::ListBoxGetSelected(ScriptMethodParams &params) {}
+
+void GlobalAPI::ListBoxRemove(ScriptMethodParams &params) {}
+
+void GlobalAPI::ListBoxSaveGameList(ScriptMethodParams &params) {}
+
+void GlobalAPI::ListBoxSetSelected(ScriptMethodParams &params) {}
+
+void GlobalAPI::ListBoxSetTopItem(ScriptMethodParams &params) {}
+
+void GlobalAPI::LoadImageFile(ScriptMethodParams &params) {}
+
+void GlobalAPI::LoadSaveSlotScreenshot(ScriptMethodParams &params) {}
+
+void GlobalAPI::lose_inventory(ScriptMethodParams &params) {}
+
+void GlobalAPI::LoseInventoryFromCharacter(ScriptMethodParams &params) {}
+
+void GlobalAPI::MergeObject(ScriptMethodParams &params) {}
+
+void GlobalAPI::MoveCharacter(ScriptMethodParams &params) {}
+
+void GlobalAPI::MoveCharacterBlocking(ScriptMethodParams &params) {}
+
+void GlobalAPI::MoveCharacterDirect(ScriptMethodParams &params) {}
+
+void GlobalAPI::MoveCharacterPath(ScriptMethodParams &params) {}
+
+void GlobalAPI::MoveCharacterStraight(ScriptMethodParams &params) {}
+
+void GlobalAPI::MoveCharacterToHotspot(ScriptMethodParams &params) {}
+
+void GlobalAPI::MoveCharacterToObject(ScriptMethodParams &params) {}
+
+void GlobalAPI::MoveObject(ScriptMethodParams &params) {}
+
+void GlobalAPI::MoveObjectDirect(ScriptMethodParams &params) {}
+
+void GlobalAPI::MoveOverlay(ScriptMethodParams &params) {}
+
+void GlobalAPI::MoveToWalkableArea(ScriptMethodParams &params) {}
+
+void GlobalAPI::NewRoom(ScriptMethodParams &params) {}
+
+void GlobalAPI::NewRoomEx(ScriptMethodParams &params) {}
+
+void GlobalAPI::NewRoomNPC(ScriptMethodParams &params) {}
+
+void GlobalAPI::ObjectOff(ScriptMethodParams &params) {}
+
+void GlobalAPI::ObjectOn(ScriptMethodParams &params) {}
+
+void GlobalAPI::ParseText(ScriptMethodParams &params) {}
+
+void GlobalAPI::PauseGame(ScriptMethodParams &params) {}
+
+void GlobalAPI::PlayAmbientSound(ScriptMethodParams &params) {}
+
+void GlobalAPI::play_flc_file(ScriptMethodParams &params) {}
+
+void GlobalAPI::PlayMP3File(ScriptMethodParams &params) {}
+
+void GlobalAPI::PlayMusicResetQueue(ScriptMethodParams &params) {}
+
+void GlobalAPI::PlayMusicQueued(ScriptMethodParams &params) {}
+
+void GlobalAPI::PlaySilentMIDI(ScriptMethodParams &params) {}
+
+void GlobalAPI::play_sound(ScriptMethodParams &params) {}
+
+void GlobalAPI::PlaySoundEx(ScriptMethodParams &params) {}
+
+void GlobalAPI::scrPlayVideo(ScriptMethodParams &params) {}
+
+void GlobalAPI::RoomProcessClick(ScriptMethodParams &params) {}
+
+void GlobalAPI::QuitGame(ScriptMethodParams &params) {}
+
+void GlobalAPI::__Rand(ScriptMethodParams &params) {}
+
+void GlobalAPI::RawClear(ScriptMethodParams &params) {}
+
+void GlobalAPI::RawDrawCircle(ScriptMethodParams &params) {}
+
+void GlobalAPI::RawDrawFrameTransparent(ScriptMethodParams &params) {}
+
+void GlobalAPI::RawDrawImage(ScriptMethodParams &params) {}
+
+void GlobalAPI::RawDrawImageOffset(ScriptMethodParams &params) {}
+
+void GlobalAPI::RawDrawImageResized(ScriptMethodParams &params) {}
+
+void GlobalAPI::RawDrawImageTransparent(ScriptMethodParams &params) {}
+
+void GlobalAPI::RawDrawLine(ScriptMethodParams &params) {}
+
+void GlobalAPI::RawDrawRectangle(ScriptMethodParams &params) {}
+
+void GlobalAPI::RawDrawTriangle(ScriptMethodParams &params) {}
+
+void GlobalAPI::ScPl_RawPrint(ScriptMethodParams &params) {
+	PARAMS2(int, xx, int, yy);
+	Common::String texx = params.format(2);
+
+	AGS3::RawPrint(xx, yy, texx.c_str());
+}
+
+void GlobalAPI::RawPrintMessageWrapped(ScriptMethodParams &params) {}
+
+void GlobalAPI::RawRestoreScreen(ScriptMethodParams &params) {}
+
+void GlobalAPI::RawRestoreScreenTinted(ScriptMethodParams &params) {}
+
+void GlobalAPI::RawSaveScreen(ScriptMethodParams &params) {}
+
+void GlobalAPI::RawSetColor(ScriptMethodParams &params) {}
+
+void GlobalAPI::RawSetColorRGB(ScriptMethodParams &params) {}
+
+void GlobalAPI::RefreshMouse(ScriptMethodParams &params) {}
+
+void GlobalAPI::ReleaseCharacterView(ScriptMethodParams &params) {}
+
+void GlobalAPI::ReleaseViewport(ScriptMethodParams &params) {}
+
+void GlobalAPI::RemoveObjectTint(ScriptMethodParams &params) {}
+
+void GlobalAPI::RemoveOverlay(ScriptMethodParams &params) {}
+
+void GlobalAPI::RemoveWalkableArea(ScriptMethodParams &params) {}
+
+void GlobalAPI::ResetRoom(ScriptMethodParams &params) {}
+
+void GlobalAPI::restart_game(ScriptMethodParams &params) {}
+
+void GlobalAPI::restore_game_dialog(ScriptMethodParams &params) {}
+
+void GlobalAPI::RestoreGameSlot(ScriptMethodParams &params) {}
+
+void GlobalAPI::RestoreWalkableArea(ScriptMethodParams &params) {}
+
+void GlobalAPI::RunAGSGame(ScriptMethodParams &params) {}
+
+void GlobalAPI::RunCharacterInteraction(ScriptMethodParams &params) {}
+
+void GlobalAPI::RunDialog(ScriptMethodParams &params) {}
+
+void GlobalAPI::RunHotspotInteraction(ScriptMethodParams &params) {}
+
+void GlobalAPI::RunInventoryInteraction(ScriptMethodParams &params) {}
+
+void GlobalAPI::RunObjectInteraction(ScriptMethodParams &params) {}
+
+void GlobalAPI::RunRegionInteraction(ScriptMethodParams &params) {}
+
+void GlobalAPI::Said(ScriptMethodParams &params) {}
+
+void GlobalAPI::SaidUnknownWord(ScriptMethodParams &params) {}
+
+void GlobalAPI::SaveCursorForLocationChange(ScriptMethodParams &params) {}
+
+void GlobalAPI::save_game_dialog(ScriptMethodParams &params) {}
+
+void GlobalAPI::save_game(ScriptMethodParams &params) {}
+
+void GlobalAPI::SaveScreenShot(ScriptMethodParams &params) {}
+
+void GlobalAPI::SeekMIDIPosition(ScriptMethodParams &params) {}
+
+void GlobalAPI::SeekMODPattern(ScriptMethodParams &params) {}
+
+void GlobalAPI::SeekMP3PosMillis(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetActiveInventory(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetAmbientTint(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetAreaLightLevel(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetAreaScaling(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetBackgroundFrame(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetButtonPic(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetButtonText(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetChannelVolume(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetCharacterBaseline(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetCharacterClickable(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetCharacterFrame(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetCharacterIdle(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetCharacterIgnoreLight(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetCharacterIgnoreWalkbehinds(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetCharacterProperty(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetCharacterBlinkView(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetCharacterSpeechView(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetCharacterSpeed(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetCharacterSpeedEx(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetCharacterTransparency(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetCharacterView(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetCharacterViewEx(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetCharacterViewOffset(ScriptMethodParams &params) {}
+
+void GlobalAPI::set_cursor_mode(ScriptMethodParams &params) {}
+
+void GlobalAPI::set_default_cursor(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetDialogOption(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetDigitalMasterVolume(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetFadeColor(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetFrameSound(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetGameOption(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetGameSpeed(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetGlobalInt(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetGlobalString(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetGraphicalVariable(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetGUIBackgroundPic(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetGUIClickable(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetGUIObjectEnabled(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetGUIObjectPosition(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetGUIObjectSize(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetGUIPosition(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetGUISize(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetGUITransparency(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetGUIZOrder(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetInvItemName(ScriptMethodParams &params) {}
+
+void GlobalAPI::set_inv_item_pic(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetInvDimensions(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetLabelColor(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetLabelFont(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetLabelText(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetMouseBounds(ScriptMethodParams &params) {}
+
+void GlobalAPI::set_mouse_cursor(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetMousePosition(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetMultitasking(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetMusicMasterVolume(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetMusicRepeat(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetMusicVolume(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetNextCursor(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetNextScreenTransition(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetNormalFont(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetObjectBaseline(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetObjectClickable(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetObjectFrame(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetObjectGraphic(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetObjectIgnoreWalkbehinds(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetObjectPosition(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetObjectTint(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetObjectTransparency(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetObjectView(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetPalRGB(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetPlayerCharacter(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetRegionTint(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetRestartPoint(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetScreenTransition(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetSkipSpeech(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetSliderValue(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetSoundVolume(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetSpeechFont(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetSpeechStyle(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetSpeechVolume(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetTalkingColor(ScriptMethodParams &params) {}
+
+void GlobalAPI::SetTextBoxFont(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::SetTextBoxText(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::ScPl_SetTextOverlay(ScriptMethodParams &params) {
+	PARAMS6(int, ovrid, int, xx, int, yy, int, wii, int, fontid, int, clr);
+	Common::String texx = params.format(6);
+
+	AGS3::SetTextOverlay(ovrid, xx, yy, wii, fontid, clr, texx.c_str());
+}
+
+void GlobalAPI::SetTextWindowGUI(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::script_SetTimer(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::SetViewport(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::SetVoiceMode(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::SetWalkBehindBase(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::ShakeScreen(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::ShakeScreenBackground(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::ShowMouseCursor(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::SkipUntilCharacterStops(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::StartCutscene(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::scStartRecording(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::StopAmbientSound(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::stop_and_destroy_channel(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::StopDialog(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::StopMoving(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::scr_StopMusic(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::StopObjectMoving(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::_sc_strcat(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::ags_stricmp(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::strcmp(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::StrContains(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::_sc_strcpy(ScriptMethodParams &params) {
+
+}
+
+void GlobalAPI::ScPl_sc_sprintf(ScriptMethodParams &params) {
+	PARAMS1(char *, destt);
+	Common::String texx = params.format(1);
+
+	AGS3::_sc_strcpy(destt, texx.c_str());
+}
+
+void GlobalAPI::StrGetCharAt(ScriptMethodParams &params) {
+}
+
+void GlobalAPI::StringToInt(ScriptMethodParams &params) {
+}
+
+void GlobalAPI::strlen(ScriptMethodParams &params) {
+}
+
+void GlobalAPI::StrSetCharAt(ScriptMethodParams &params) {
+}
+
+void GlobalAPI::_sc_strlower(ScriptMethodParams &params) {
+}
+
+void GlobalAPI::_sc_strupper(ScriptMethodParams &params) {
+}
+
+void GlobalAPI::TintScreen(ScriptMethodParams &params) {
+}
+
+void GlobalAPI::UnPauseGame(ScriptMethodParams &params) {
+}
+
+void GlobalAPI::update_invorder(ScriptMethodParams &params) {
+}
+
+void GlobalAPI::UpdatePalette(ScriptMethodParams &params) {
+}
+
+void GlobalAPI::scrWait(ScriptMethodParams &params) {
+}
+
+void GlobalAPI::WaitKey(ScriptMethodParams &params) {
+}
+
+void GlobalAPI::WaitMouseKey(ScriptMethodParams &params) {
+}
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/core/global_api.h b/engines/ags/plugins/core/global_api.h
new file mode 100644
index 0000000000..10369b58fb
--- /dev/null
+++ b/engines/ags/plugins/core/global_api.h
@@ -0,0 +1,403 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef AGS_PLUGINS_CORE_GLOBAL_API_H
+#define AGS_PLUGINS_CORE_GLOBAL_API_H
+
+#include "ags/plugins/plugin_base.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace Core {
+
+class GlobalAPI : public ScriptContainer {
+public:
+	void AGS_EngineStartup(IAGSEngine *engine);
+
+	static void ScPl_sc_AbortGame(ScriptMethodParams &params);
+	static void add_inventory(ScriptMethodParams &params);
+	static void AddInventoryToCharacter(ScriptMethodParams &params);
+	static void AnimateButton(ScriptMethodParams &params);
+	static void scAnimateCharacter(ScriptMethodParams &params);
+	static void AnimateCharacterEx(ScriptMethodParams &params);
+	static void AnimateObject(ScriptMethodParams &params);
+	static void AnimateObjectEx(ScriptMethodParams &params);
+	static void AreCharactersColliding(ScriptMethodParams &params);
+	static void AreCharObjColliding(ScriptMethodParams &params);
+	static void AreObjectsColliding(ScriptMethodParams &params);
+	static void AreThingsOverlapping(ScriptMethodParams &params);
+	static void CallRoomScript(ScriptMethodParams &params);
+	static void cd_manager(ScriptMethodParams &params);
+	static void CentreGUI(ScriptMethodParams &params);
+	static void ChangeCharacterView(ScriptMethodParams &params);
+	static void ChangeCursorGraphic(ScriptMethodParams &params);
+	static void ChangeCursorHotspot(ScriptMethodParams &params);
+	static void ClaimEvent(ScriptMethodParams &params);
+	static void CreateGraphicOverlay(ScriptMethodParams &params);
+	static void ScPl_CreateTextOverlay(ScriptMethodParams &params);
+	static void CyclePalette(ScriptMethodParams &params);
+	static void script_debug(ScriptMethodParams &params);
+	static void DeleteSaveSlot(ScriptMethodParams &params);
+	static void free_dynamic_sprite(ScriptMethodParams &params);
+	static void disable_cursor_mode(ScriptMethodParams &params);
+	static void DisableGroundLevelAreas(ScriptMethodParams &params);
+	static void DisableHotspot(ScriptMethodParams &params);
+	static void DisableInterface(ScriptMethodParams &params);
+	static void DisableRegion(ScriptMethodParams &params);
+	static void ScPl_Display(ScriptMethodParams &params);
+	static void ScPl_DisplayAt(ScriptMethodParams &params);
+	static void DisplayAtY(ScriptMethodParams &params);
+	static void DisplayMessage(ScriptMethodParams &params);
+	static void DisplayMessageAtY(ScriptMethodParams &params);
+	static void DisplayMessageBar(ScriptMethodParams &params);
+	static void ScPl_sc_displayspeech(ScriptMethodParams &params);
+	static void DisplaySpeechAt(ScriptMethodParams &params);
+	static void DisplaySpeechBackground(ScriptMethodParams &params);
+	static void ScPl_DisplayThought(ScriptMethodParams &params);
+	static void ScPl_DisplayTopBar(ScriptMethodParams &params);
+	static void enable_cursor_mode(ScriptMethodParams &params);
+	static void EnableGroundLevelAreas(ScriptMethodParams &params);
+	static void EnableHotspot(ScriptMethodParams &params);
+	static void EnableInterface(ScriptMethodParams &params);
+	static void EnableRegion(ScriptMethodParams &params);
+	static void EndCutscene(ScriptMethodParams &params);
+	static void FaceCharacter(ScriptMethodParams &params);
+	static void FaceLocation(ScriptMethodParams &params);
+	static void FadeIn(ScriptMethodParams &params);
+	static void my_fade_out(ScriptMethodParams &params);
+	static void FileClose(ScriptMethodParams &params);
+	static void FileIsEOF(ScriptMethodParams &params);
+	static void FileIsError(ScriptMethodParams &params);
+	// NOTE: FileOpenCMode is a backwards-compatible replacement for old-style global script function FileOpen
+	static void FileOpenCMode(ScriptMethodParams &params);
+	static void FileRead(ScriptMethodParams &params);
+	static void FileReadInt(ScriptMethodParams &params);
+	static void FileReadRawChar(ScriptMethodParams &params);
+	static void FileReadRawInt(ScriptMethodParams &params);
+	static void FileWrite(ScriptMethodParams &params);
+	static void FileWriteInt(ScriptMethodParams &params);
+	static void FileWriteRawChar(ScriptMethodParams &params);
+	static void FileWriteRawLine(ScriptMethodParams &params);
+	static void FindGUIID(ScriptMethodParams &params);
+	static void FlipScreen(ScriptMethodParams &params);
+	static void FloatToInt(ScriptMethodParams &params);
+	static void FollowCharacter(ScriptMethodParams &params);
+	static void FollowCharacterEx(ScriptMethodParams &params);
+	static void GetBackgroundFrame(ScriptMethodParams &params);
+	static void GetButtonPic(ScriptMethodParams &params);
+	static void GetCharIDAtScreen(ScriptMethodParams &params);
+	static void GetCharacterProperty(ScriptMethodParams &params);
+	static void GetCharacterPropertyText(ScriptMethodParams &params);
+	static void GetCurrentMusic(ScriptMethodParams &params);
+	static void GetCursorMode(ScriptMethodParams &params);
+	static void GetDialogOption(ScriptMethodParams &params);
+	static void GetGameOption(ScriptMethodParams &params);
+	static void GetGameParameter(ScriptMethodParams &params);
+	static void GetGameSpeed(ScriptMethodParams &params);
+	static void GetGlobalInt(ScriptMethodParams &params);
+	static void GetGlobalString(ScriptMethodParams &params);
+	static void GetGraphicalVariable(ScriptMethodParams &params);
+	static void GetGUIAt(ScriptMethodParams &params);
+	static void GetGUIObjectAt(ScriptMethodParams &params);
+	static void GetHotspotIDAtScreen(ScriptMethodParams &params);
+	static void GetHotspotName(ScriptMethodParams &params);
+	static void GetHotspotPointX(ScriptMethodParams &params);
+	static void GetHotspotPointY(ScriptMethodParams &params);
+	static void GetHotspotProperty(ScriptMethodParams &params);
+	static void GetHotspotPropertyText(ScriptMethodParams &params);
+	static void GetInvAt(ScriptMethodParams &params);
+	static void GetInvGraphic(ScriptMethodParams &params);
+	static void GetInvName(ScriptMethodParams &params);
+	static void GetInvProperty(ScriptMethodParams &params);
+	static void GetInvPropertyText(ScriptMethodParams &params);
+	static void GetLocationName(ScriptMethodParams &params);
+	static void GetLocationType(ScriptMethodParams &params);
+	static void GetMessageText(ScriptMethodParams &params);
+	static void GetMIDIPosition(ScriptMethodParams &params);
+	static void GetMP3PosMillis(ScriptMethodParams &params);
+	static void GetObjectIDAtScreen(ScriptMethodParams &params);
+	static void GetObjectBaseline(ScriptMethodParams &params);
+	static void GetObjectGraphic(ScriptMethodParams &params);
+	static void GetObjectName(ScriptMethodParams &params);
+	static void GetObjectProperty(ScriptMethodParams &params);
+	static void GetObjectPropertyText(ScriptMethodParams &params);
+	static void GetObjectX(ScriptMethodParams &params);
+	static void GetObjectY(ScriptMethodParams &params);
+	static void GetPlayerCharacter(ScriptMethodParams &params);
+	static void GetRawTime(ScriptMethodParams &params);
+	static void GetRegionIDAtRoom(ScriptMethodParams &params);
+	static void Room_GetProperty(ScriptMethodParams &params);
+	static void GetRoomPropertyText(ScriptMethodParams &params);
+	static void GetSaveSlotDescription(ScriptMethodParams &params);
+	static void GetScalingAt(ScriptMethodParams &params);
+	static void GetSliderValue(ScriptMethodParams &params);
+	static void GetTextBoxText(ScriptMethodParams &params);
+	static void GetTextHeight(ScriptMethodParams &params);
+	static void GetTextWidth(ScriptMethodParams &params);
+	static void sc_GetTime(ScriptMethodParams &params);
+	static void get_translation(ScriptMethodParams &params);
+	static void GetTranslationName(ScriptMethodParams &params);
+	static void GetViewportX(ScriptMethodParams &params);
+	static void GetViewportY(ScriptMethodParams &params);
+	static void GetWalkableAreaAtRoom(ScriptMethodParams &params);
+	static void GetWalkableAreaAtScreen(ScriptMethodParams &params);
+	static void GiveScore(ScriptMethodParams &params);
+	static void HasPlayerBeenInRoom(ScriptMethodParams &params);
+	static void HideMouseCursor(ScriptMethodParams &params);
+	static void sc_inputbox(ScriptMethodParams &params);
+	static void InterfaceOff(ScriptMethodParams &params);
+	static void InterfaceOn(ScriptMethodParams &params);
+	static void IntToFloat(ScriptMethodParams &params);
+	static void sc_invscreen(ScriptMethodParams &params);
+	static void IsButtonDown(ScriptMethodParams &params);
+	static void IsChannelPlaying(ScriptMethodParams &params);
+	static void IsGamePaused(ScriptMethodParams &params);
+	static void IsGUIOn(ScriptMethodParams &params);
+	static void IsInteractionAvailable(ScriptMethodParams &params);
+	static void IsInventoryInteractionAvailable(ScriptMethodParams &params);
+	static void IsInterfaceEnabled(ScriptMethodParams &params);
+	static void IsKeyPressed(ScriptMethodParams &params);
+	static void IsMusicPlaying(ScriptMethodParams &params);
+	static void IsMusicVoxAvailable(ScriptMethodParams &params);
+	static void IsObjectAnimating(ScriptMethodParams &params);
+	static void IsObjectMoving(ScriptMethodParams &params);
+	static void IsObjectOn(ScriptMethodParams &params);
+	static void IsOverlayValid(ScriptMethodParams &params);
+	static void IsSoundPlaying(ScriptMethodParams &params);
+	static void IsTimerExpired(ScriptMethodParams &params);
+	static void IsTranslationAvailable(ScriptMethodParams &params);
+	static void IsVoxAvailable(ScriptMethodParams &params);
+	static void ListBoxAdd(ScriptMethodParams &params);
+	static void ListBoxClear(ScriptMethodParams &params);
+	static void ListBoxDirList(ScriptMethodParams &params);
+	static void ListBoxGetItemText(ScriptMethodParams &params);
+	static void ListBoxGetNumItems(ScriptMethodParams &params);
+	static void ListBoxGetSelected(ScriptMethodParams &params);
+	static void ListBoxRemove(ScriptMethodParams &params);
+	static void ListBoxSaveGameList(ScriptMethodParams &params);
+	static void ListBoxSetSelected(ScriptMethodParams &params);
+	static void ListBoxSetTopItem(ScriptMethodParams &params);
+	static void LoadImageFile(ScriptMethodParams &params);
+	static void LoadSaveSlotScreenshot(ScriptMethodParams &params);
+	static void lose_inventory(ScriptMethodParams &params);
+	static void LoseInventoryFromCharacter(ScriptMethodParams &params);
+	static void MergeObject(ScriptMethodParams &params);
+	static void MoveCharacter(ScriptMethodParams &params);
+	static void MoveCharacterBlocking(ScriptMethodParams &params);
+	static void MoveCharacterDirect(ScriptMethodParams &params);
+	static void MoveCharacterPath(ScriptMethodParams &params);
+	static void MoveCharacterStraight(ScriptMethodParams &params);
+	static void MoveCharacterToHotspot(ScriptMethodParams &params);
+	static void MoveCharacterToObject(ScriptMethodParams &params);
+	static void MoveObject(ScriptMethodParams &params);
+	static void MoveObjectDirect(ScriptMethodParams &params);
+	static void MoveOverlay(ScriptMethodParams &params);
+	static void MoveToWalkableArea(ScriptMethodParams &params);
+	static void NewRoom(ScriptMethodParams &params);
+	static void NewRoomEx(ScriptMethodParams &params);
+	static void NewRoomNPC(ScriptMethodParams &params);
+	static void ObjectOff(ScriptMethodParams &params);
+	static void ObjectOn(ScriptMethodParams &params);
+	static void ParseText(ScriptMethodParams &params);
+	static void PauseGame(ScriptMethodParams &params);
+	static void PlayAmbientSound(ScriptMethodParams &params);
+	static void play_flc_file(ScriptMethodParams &params);
+	static void PlayMP3File(ScriptMethodParams &params);
+	static void PlayMusicResetQueue(ScriptMethodParams &params);
+	static void PlayMusicQueued(ScriptMethodParams &params);
+	static void PlaySilentMIDI(ScriptMethodParams &params);
+	static void play_sound(ScriptMethodParams &params);
+	static void PlaySoundEx(ScriptMethodParams &params);
+	static void scrPlayVideo(ScriptMethodParams &params);
+	static void RoomProcessClick(ScriptMethodParams &params);
+	static void QuitGame(ScriptMethodParams &params);
+	static void __Rand(ScriptMethodParams &params);
+	static void RawClear(ScriptMethodParams &params);
+	static void RawDrawCircle(ScriptMethodParams &params);
+	static void RawDrawFrameTransparent(ScriptMethodParams &params);
+	static void RawDrawImage(ScriptMethodParams &params);
+	static void RawDrawImageOffset(ScriptMethodParams &params);
+	static void RawDrawImageResized(ScriptMethodParams &params);
+	static void RawDrawImageTransparent(ScriptMethodParams &params);
+	static void RawDrawLine(ScriptMethodParams &params);
+	static void RawDrawRectangle(ScriptMethodParams &params);
+	static void RawDrawTriangle(ScriptMethodParams &params);
+	static void ScPl_RawPrint(ScriptMethodParams &params);
+	static void RawPrintMessageWrapped(ScriptMethodParams &params);
+	static void RawRestoreScreen(ScriptMethodParams &params);
+	static void RawRestoreScreenTinted(ScriptMethodParams &params);
+	static void RawSaveScreen(ScriptMethodParams &params);
+	static void RawSetColor(ScriptMethodParams &params);
+	static void RawSetColorRGB(ScriptMethodParams &params);
+	static void RefreshMouse(ScriptMethodParams &params);
+	static void ReleaseCharacterView(ScriptMethodParams &params);
+	static void ReleaseViewport(ScriptMethodParams &params);
+	static void RemoveObjectTint(ScriptMethodParams &params);
+	static void RemoveOverlay(ScriptMethodParams &params);
+	static void RemoveWalkableArea(ScriptMethodParams &params);
+	static void ResetRoom(ScriptMethodParams &params);
+	static void restart_game(ScriptMethodParams &params);
+	static void restore_game_dialog(ScriptMethodParams &params);
+	static void RestoreGameSlot(ScriptMethodParams &params);
+	static void RestoreWalkableArea(ScriptMethodParams &params);
+	static void RunAGSGame(ScriptMethodParams &params);
+	static void RunCharacterInteraction(ScriptMethodParams &params);
+	static void RunDialog(ScriptMethodParams &params);
+	static void RunHotspotInteraction(ScriptMethodParams &params);
+	static void RunInventoryInteraction(ScriptMethodParams &params);
+	static void RunObjectInteraction(ScriptMethodParams &params);
+	static void RunRegionInteraction(ScriptMethodParams &params);
+	static void Said(ScriptMethodParams &params);
+	static void SaidUnknownWord(ScriptMethodParams &params);
+	static void SaveCursorForLocationChange(ScriptMethodParams &params);
+	static void save_game_dialog(ScriptMethodParams &params);
+	static void save_game(ScriptMethodParams &params);
+	static void SaveScreenShot(ScriptMethodParams &params);
+	static void SeekMIDIPosition(ScriptMethodParams &params);
+	static void SeekMODPattern(ScriptMethodParams &params);
+	static void SeekMP3PosMillis(ScriptMethodParams &params);
+	static void SetActiveInventory(ScriptMethodParams &params);
+	static void SetAmbientTint(ScriptMethodParams &params);
+	static void SetAreaLightLevel(ScriptMethodParams &params);
+	static void SetAreaScaling(ScriptMethodParams &params);
+	static void SetBackgroundFrame(ScriptMethodParams &params);
+	static void SetButtonPic(ScriptMethodParams &params);
+	static void SetButtonText(ScriptMethodParams &params);
+	static void SetChannelVolume(ScriptMethodParams &params);
+	static void SetCharacterBaseline(ScriptMethodParams &params);
+	static void SetCharacterClickable(ScriptMethodParams &params);
+	static void SetCharacterFrame(ScriptMethodParams &params);
+	static void SetCharacterIdle(ScriptMethodParams &params);
+	static void SetCharacterIgnoreLight(ScriptMethodParams &params);
+	static void SetCharacterIgnoreWalkbehinds(ScriptMethodParams &params);
+	static void SetCharacterProperty(ScriptMethodParams &params);
+	static void SetCharacterBlinkView(ScriptMethodParams &params);
+	static void SetCharacterSpeechView(ScriptMethodParams &params);
+	static void SetCharacterSpeed(ScriptMethodParams &params);
+	static void SetCharacterSpeedEx(ScriptMethodParams &params);
+	static void SetCharacterTransparency(ScriptMethodParams &params);
+	static void SetCharacterView(ScriptMethodParams &params);
+	static void SetCharacterViewEx(ScriptMethodParams &params);
+	static void SetCharacterViewOffset(ScriptMethodParams &params);
+	static void set_cursor_mode(ScriptMethodParams &params);
+	static void set_default_cursor(ScriptMethodParams &params);
+	static void SetDialogOption(ScriptMethodParams &params);
+	static void SetDigitalMasterVolume(ScriptMethodParams &params);
+	static void SetFadeColor(ScriptMethodParams &params);
+	static void SetFrameSound(ScriptMethodParams &params);
+	static void SetGameOption(ScriptMethodParams &params);
+	static void SetGameSpeed(ScriptMethodParams &params);
+	static void SetGlobalInt(ScriptMethodParams &params);
+	static void SetGlobalString(ScriptMethodParams &params);
+	static void SetGraphicalVariable(ScriptMethodParams &params);
+	static void SetGUIBackgroundPic(ScriptMethodParams &params);
+	static void SetGUIClickable(ScriptMethodParams &params);
+	static void SetGUIObjectEnabled(ScriptMethodParams &params);
+	static void SetGUIObjectPosition(ScriptMethodParams &params);
+	static void SetGUIObjectSize(ScriptMethodParams &params);
+	static void SetGUIPosition(ScriptMethodParams &params);
+	static void SetGUISize(ScriptMethodParams &params);
+	static void SetGUITransparency(ScriptMethodParams &params);
+	static void SetGUIZOrder(ScriptMethodParams &params);
+	static void SetInvItemName(ScriptMethodParams &params);
+	static void set_inv_item_pic(ScriptMethodParams &params);
+	static void SetInvDimensions(ScriptMethodParams &params);
+	static void SetLabelColor(ScriptMethodParams &params);
+	static void SetLabelFont(ScriptMethodParams &params);
+	static void SetLabelText(ScriptMethodParams &params);
+	static void SetMouseBounds(ScriptMethodParams &params);
+	static void set_mouse_cursor(ScriptMethodParams &params);
+	static void SetMousePosition(ScriptMethodParams &params);
+	static void SetMultitasking(ScriptMethodParams &params);
+	static void SetMusicMasterVolume(ScriptMethodParams &params);
+	static void SetMusicRepeat(ScriptMethodParams &params);
+	static void SetMusicVolume(ScriptMethodParams &params);
+	static void SetNextCursor(ScriptMethodParams &params);
+	static void SetNextScreenTransition(ScriptMethodParams &params);
+	static void SetNormalFont(ScriptMethodParams &params);
+	static void SetObjectBaseline(ScriptMethodParams &params);
+	static void SetObjectClickable(ScriptMethodParams &params);
+	static void SetObjectFrame(ScriptMethodParams &params);
+	static void SetObjectGraphic(ScriptMethodParams &params);
+	static void SetObjectIgnoreWalkbehinds(ScriptMethodParams &params);
+	static void SetObjectPosition(ScriptMethodParams &params);
+	static void SetObjectTint(ScriptMethodParams &params);
+	static void SetObjectTransparency(ScriptMethodParams &params);
+	static void SetObjectView(ScriptMethodParams &params);
+	static void SetPalRGB(ScriptMethodParams &params);
+	static void SetPlayerCharacter(ScriptMethodParams &params);
+	static void SetRegionTint(ScriptMethodParams &params);
+	static void SetRestartPoint(ScriptMethodParams &params);
+	static void SetScreenTransition(ScriptMethodParams &params);
+	static void SetSkipSpeech(ScriptMethodParams &params);
+	static void SetSliderValue(ScriptMethodParams &params);
+	static void SetSoundVolume(ScriptMethodParams &params);
+	static void SetSpeechFont(ScriptMethodParams &params);
+	static void SetSpeechStyle(ScriptMethodParams &params);
+	static void SetSpeechVolume(ScriptMethodParams &params);
+	static void SetTalkingColor(ScriptMethodParams &params);
+	static void SetTextBoxFont(ScriptMethodParams &params);
+	static void SetTextBoxText(ScriptMethodParams &params);
+	static void ScPl_SetTextOverlay(ScriptMethodParams &params);
+	static void SetTextWindowGUI(ScriptMethodParams &params);
+	static void script_SetTimer(ScriptMethodParams &params);
+	static void SetViewport(ScriptMethodParams &params);
+	static void SetVoiceMode(ScriptMethodParams &params);
+	static void SetWalkBehindBase(ScriptMethodParams &params);
+	static void ShakeScreen(ScriptMethodParams &params);
+	static void ShakeScreenBackground(ScriptMethodParams &params);
+	static void ShowMouseCursor(ScriptMethodParams &params);
+	static void SkipUntilCharacterStops(ScriptMethodParams &params);
+	static void StartCutscene(ScriptMethodParams &params);
+	static void scStartRecording(ScriptMethodParams &params);
+	static void StopAmbientSound(ScriptMethodParams &params);
+	static void stop_and_destroy_channel(ScriptMethodParams &params);
+	static void StopDialog(ScriptMethodParams &params);
+	static void StopMoving(ScriptMethodParams &params);
+	static void scr_StopMusic(ScriptMethodParams &params);
+	static void StopObjectMoving(ScriptMethodParams &params);
+	static void _sc_strcat(ScriptMethodParams &params);
+	static void ags_stricmp(ScriptMethodParams &params);
+	static void strcmp(ScriptMethodParams &params);
+	static void StrContains(ScriptMethodParams &params);
+	static void _sc_strcpy(ScriptMethodParams &params);
+	static void ScPl_sc_sprintf(ScriptMethodParams &params);
+	static void StrGetCharAt(ScriptMethodParams &params);
+	static void StringToInt(ScriptMethodParams &params);
+	static void strlen(ScriptMethodParams &params);
+	static void StrSetCharAt(ScriptMethodParams &params);
+	static void _sc_strlower(ScriptMethodParams &params);
+	static void _sc_strupper(ScriptMethodParams &params);
+	static void TintScreen(ScriptMethodParams &params);
+	static void UnPauseGame(ScriptMethodParams &params);
+	static void update_invorder(ScriptMethodParams &params);
+	static void UpdatePalette(ScriptMethodParams &params);
+	static void scrWait(ScriptMethodParams &params);
+	static void WaitKey(ScriptMethodParams &params);
+	static void WaitMouseKey(ScriptMethodParams &params);
+};
+
+} // namespace Core
+} // namespace Plugins
+} // namespace AGS3
+
+#endif




More information about the Scummvm-git-logs mailing list