Skip to content

Commit

Permalink
👼 Script: global thisScript & getScriptDetails();
Browse files Browse the repository at this point in the history
    new global var in every script: `const int thisScript = {};` containing the ScriptUnitID aka uniqueId aka NID of the script.

    /**
    * Returns active ScriptUnitIDs; check agains global var `thisScript` or use `getScriptDetails()` to get name etc...
    */
    array<int> getRunningScripts();

    /**
    * Returns all info about running script; obtain the NID from `getRunningScripts()`, global var `thisScript` or event callbacks:
    *   * "uniqueId" (int64)
    *   * "scriptName" (string)
    *   * "scriptCategory" (enum ScriptCategory)
    *   * "eventMask" (int64)
    *   * "scriptBuffer" (string)
    */
    dictionary@ getScriptDetails(int nid);
  • Loading branch information
ohlidalp committed Sep 27, 2023
1 parent b160c0c commit 3050847
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions source/main/scripting/GameScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1015,16 +1015,6 @@ AngelScript::CScriptDictionary* GameScript::getScriptDetails(ScriptUnitId_t nid)
dict->Set("scriptName", new std::string(info.scriptName), stringTypeid);
dict->Set("scriptCategory", &info.scriptCategory, scriptCategoryTypeid);
dict->Set("eventMask", (asINT64)info.eventMask);
dict->Set("scriptBuffer", new std::string(info.scriptBuffer), stringTypeid);

// TBD Some other time...
//AngelScript::asIScriptModule* scriptModule = nullptr;
//AngelScript::asIScriptFunction* frameStepFunctionPtr = nullptr; //!< script function pointer to the frameStep function
//AngelScript::asIScriptFunction* eventCallbackFunctionPtr = nullptr; //!< script function pointer to the event callback function
//AngelScript::asIScriptFunction* eventCallbackExFunctionPtr = nullptr; //!< script function pointer to the event callback function
//AngelScript::asIScriptFunction* defaultEventCallbackFunctionPtr = nullptr; //!< script function pointer for spawner events
//ActorPtr associatedActor; //!< For ScriptCategory::ACTOR
//Ogre::String scriptHash;

return dict;
}
Expand Down

0 comments on commit 3050847

Please sign in to comment.