//------------------------------------------------------------------------------------------------------------------------// Useful to call custom functions from the map script module to the game script module.// Otherwise just use the ScriptObject's ScriptObject() function to get a handle to it.// // Required:// Function header: void funcName(kActor @actor, const float arg1, const float arg2, const float arg3, const float arg4)// Function body condition check: if (actor.Type() != BP_AT_FUNCTIONCALL) return;//------------------------------------------------------------------------------------------------------------------------void CallFunc(kActor@ actor, const kStr &in funcName, const float arg1 = 0.0f, const float arg2 = 0.0f, const float arg3 = 0.0f, const float arg4 = 0.0f){ kActor@ playerActor = Player.Actor().CastToActor(); kActor@ dummy = Spawn(BP_AT_FUNCTIONCALL, playerActor.Origin(), 0.0f, playerActor.SectorIndex()); dummy.Flags() |= AF_SOLID; actor.InteractActorsAtPosition(playerActor.Origin(), funcName, arg1, arg2, arg3, arg4); dummy.Remove();}
Shared entities have a restriction in that they cannot access non-shared entities because the non-shared entities are exclusive to the script module in which they were compiled.
So to answer my own question, if you wanted to get a handle to the dummy actor's script object, it'd have to be declared shared. But if it's shared, then it wouldn't be able to interact with any non-shared entities. So you use InteractActorsAtPosition() to interact with non-shared entities in the game module from the level module.
This may be naiive, but then why not just redeclare everything shared? You wouldn't be able to access global variables, but those could be changed to member variables in a shared class.
void Game.CallDelayedMapScript(const int scriptID, kActor @instigator, const float delay)
I just checked it again, and yes it looks like kSelectionListFloat is exactly the same as kSelectionListInt. And int& Select(const bool = false) has a bool parameter.
Some more info on map scripts. $restart remaps to Code: [Select]void Game.CallDelayedMapScript(const int scriptID, kActor @instigator, const float delay)where scriptID is taken from the last $script <id> value used in the script before $restart. instigator is placed in the instigator actor arg and the delay is 0. So it's calling itself and will execute itself on the next script execution cycle (not immediately). You can do this same thing and call CallDelayedMapScript(const kStr &in funcName, kActor @instigator, const float delay) for your custom map functions in order to loop them.
$script 1{}void Blah(){ $restart;}$script 2{ Blah();}