You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 5, 2024. It is now read-only.
Changed const ordering in MovableObject script methods, changed OnPieMenu method comment and moved OnPieMenu nearer the back of the supported script function names in MovableObject since it makes more sense
Moved scriptString construction logic into LuaMan so it can be used by things that aren't MovableObjects (i.e. GAScripted and GlobalScript). Also changed string in RunScript to be const &
int status = g_LuaMan.RunScriptedFunction(fullFunctionName, m_ScriptObjectName, {presetAndFunctionName, m_ScriptObjectName, fullFunctionName}, functionEntityArguments, functionLiteralArguments);
684
668
functionEntityArguments.clear();
685
669
functionLiteralArguments.clear();
670
+
686
671
if (status < 0 && m_LoadedScripts.size() > 1) {
687
-
g_ConsoleMan.PrintString("ERROR: An error occured while trying to run " + functionName + "function for script at path " + scriptPath);
672
+
g_ConsoleMan.PrintString("ERROR: An error occured while trying to run the " + functionName + "function for script at path " + scriptPath);
688
673
return -2;
689
674
}
690
675
@@ -693,7 +678,7 @@ int MovableObject::RunScriptedFunction(std::string const &scriptPath, std::strin
/// <param name="scriptPath">The path to the script to load.</param>
185
185
/// <param name="loadAsEnabledScript">Whether or not the script should load as enabled. Defaults to true.</param>
186
186
/// <returns>0 on success. -1 if scriptPath is empty. -2 if the script is already loaded. -3 if setup to load the script or modify the global lua state fails. -4 if the script fails to load.</returns>
/// Reloads the all of the scripts on this object. This will also update the original preset in PresetMan with the updated scripts so future objects spawned will use the new scripts.
/// <param name="functionEntityArguments">Optional vector of entity pointers that should be passed into the Lua function. Their internal Lua states will not be accessible. Defaults to empty.</param>
251
251
/// <param name="functionLiteralArguments">Optional vector of strings, that should be passed into the Lua function. Entries must be surrounded with escaped quotes (i.e.`\"`) they'll be passed in as-is, allowing them to act as booleans, etc.. Defaults to empty.</param>
252
252
/// <returns>An error return value signaling sucess or any particular failure. Anything below 0 is an error signal.</returns>
/// Runs the given function in all scripts that have it, with the given arguments, with the ability to not run on disabled scripts and to cease running if there's an error.
/// <param name="functionEntityArguments">Optional vector of entity pointers that should be passed into the Lua function. Their internal Lua states will not be accessible. Defaults to empty.</param>
263
263
/// <param name="functionLiteralArguments">Optional vector of strings, that should be passed into the Lua function. Entries must be surrounded with escaped quotes (i.e.`\"`) they'll be passed in as-is, allowing them to act as booleans, etc.. Defaults to empty.</param>
264
264
/// <returns>An error return value signaling sucess or any particular failure. Anything below 0 is an error signal.</returns>
/// Does necessary work to setup a script object name for this object, allowing it to be accessed in Lua, then runs all of the MO's scripts' Create functions in Lua.
/// Runs the given Lua function with optional safety checks and arguments. The first argument to the function will always be the self object.
232
+
/// If either argument list has entries, they will be passed into the function in order, with entity arguments first.
233
+
/// </summary>
234
+
/// <param name="functionName">The name that gives access to the function in the global Lua namespace.</param>
235
+
/// <param name="selfObjectName">The name that gives access to the self object in the global Lua namespace.</param>
236
+
/// <param name="variablesToSafetyCheck">Optional vector of strings that should be safety checked in order before running the Lua function. Defaults to empty.</param>
237
+
/// <param name="functionEntityArguments">Optional vector of entity pointers that should be passed into the Lua function. Their internal Lua states will not be accessible. Defaults to empty.</param>
238
+
/// <param name="functionLiteralArguments">Optional vector of strings that should be passed into the Lua function. Entries must be surrounded with escaped quotes (i.e.`\"`) they'll be passed in as-is, allowing them to act as booleans, etc.. Defaults to empty.</param>
239
+
/// <returns>An error return value signaling sucess or any particular failure. Anything below 0 is an error signal.</returns>
0 commit comments