From be23c5f9cfba584390b84bc0e877e126e3ef641f Mon Sep 17 00:00:00 2001 From: Belovese <60344544+Belovese@users.noreply.github.com> Date: Sat, 12 Oct 2024 15:32:28 +0200 Subject: [PATCH] Update luaPlugin.cpp updated example for getScriptCounter() --- M2TWEOP Code/M2TWEOP library/luaPlugin.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/M2TWEOP Code/M2TWEOP library/luaPlugin.cpp b/M2TWEOP Code/M2TWEOP library/luaPlugin.cpp index 201532c3..0a6266d6 100644 --- a/M2TWEOP Code/M2TWEOP library/luaPlugin.cpp +++ b/M2TWEOP Code/M2TWEOP library/luaPlugin.cpp @@ -792,7 +792,13 @@ sol::state* luaPlugin::init(std::string& luaFilePath, std::string& modPath) @tparam string counterName The name of the counter @treturn int counterValue Returns the value of the counter @usage - isExist, counterValue = M2TWEOP.getScriptCounter("SomeCounter") + ---@param eventData eventTrigger + function onEventCounter(eventData) + -- get the name and value of the triggered counter + local counterName = eventData.eventCounter + local counterValue = M2TWEOP.getScriptCounter(counterName) + print('counter : '..counterName..' has been set to : '..counterValue) + end */ tables.M2TWEOP.set_function("getScriptCounter", &gameHelpers::getScriptCounterNoBool);