- priority: 5 --> 7
Let's say we have common submodule that is imported in 2 different modules. Those modules are then imported in a main script.
As long as the submodule has no parameters in its definition, it works fine. If you add parameters to the submodule, you get "... imported from module is already defined" error (the error shows up in the main script).
Example:
// Common.lslm submodule:
$module (integer whisper)
Say(string text)
{
if (whisper)
llWhisper(0, text);
else
llSay(0, text);
}
// Module1.lslm module
$module ()
integer whisper1 = FALSE;
$import Common.lslm(whisper = whisper1);
SayHallo()
{
Say("Hallo!");
}
// Module2.lslm module
$module ()
integer whisper2 = FALSE;
$import Common.lslm(whisper = whisper2);
SayGoodBye()
{
Say("Good bye!");
}
// Main script
$import Module1.lslm;
$import Module2.lslm; // Error: Say imported from module is already defined
default
{
state_entry()
{
SayHallo();
SayGoodBye();
}
}